Alps Geomagnetic Sensor Application Note

Geomagnetic Sensor
Application note
2012/09/04
Page 1/7
Alps Geomagnetic Sensor
Application Note
www.alps.co.jp
Geomagnetic Sensor
Application note
2012/09/04
Page 2/7
-CONTENTS1. Basic Information about Geomagnetic...................................................................... 3
2. Data Flow for the Electric Compass............................................................................ 4
2.1. Composition chart of the Electric Compass ................................................... 4
2.2. Definition of X, Y and Z-Sensor .......................................................................... 4
3. Azimuth calculation flow............................................................................................... 4
4. Calibration........................................................................................................................ 4
5. Notice for sensor location............................................................................................. 5
6. Example of combination with acceleration sensor (I2C interface)....................... 6
7. Application Examples.................................................................................................... 6
8. Legal Disclaimer ............................................................................................................. 6
www.alps.co.jp
Geomagnetic Sensor
Application note
2012/09/04
Page 3/7
1. Basic Information about
Geomagnetic
Z
Y(North)
Hy
declination
→
Geomagnetism is generated by dynamo theory
I n c l i n a t i o n H'(Magnetic North)
of the core of the earth. And its lines of magnetic
force are exit from the South Pole and enter into
Hx
Hz
→
H
North Pole.
X
Strength of Geomagnetism is about 30 to 60µT.
In general, it is weaker near the equator. Oppositely, it
is stronger in the higher latitude region. The strength
around the vicinity of Tokyo is about 45µT. This is
very weak field strength and it is about 1/100 strength
of typical magnetic memo holder.
However, the magnetic north is not exactly same
Geomagnetism
30 ∼ 60µT
as geographic north. Magnetic pole is in north
MEMO
MAGNET
5mT
Canada and it is off aligned about 12 degree from
geographic north. This angle difference is called
1.E-06
1 .E- 05
1.E-0 4
1.E- 03
1.E-02
Magneto-Therapeutic
Pain Patch
Speaker
80 ∼ 180mT
1 ∼ 3T
1 .E- 01
1.E+0 0
磁場 の強
さ (T)
Strength
of magnetic(T)
declination.
Magnetic field strength around the earth is not
North
Magnetic North
completely uniform. It is said that the field strength is
affected by mineral under the ground. For example,
there are strong magnetic field spot around Siberia.
Magnetic field is parallel near the equator. In the
northern hemisphere, the field exits from the ground
and it enter into the ground in the southern
hemisphere. This angle is called inclination. The
inclination at the North Pole is about +90 degree, and
-90 degree at the South Pole.
www.alps.co.jp
1.E+ 01
Geomagnetic Sensor
Application note
2012/09/04
Page 4/7
based on the sensor signal. The figure below shows
2. Data Flow for the Electric Compass
2.1. Composition chart of the Electric
Compass
the sensor output wave form when the sensor is
horizontally rotated around the z-axis. In this case,
the azimuth θ is calculated by the next expression.
X

Y 
θ = tan −1 
Fig 1 Composition chart of the Electric Compass
Y-Sensor
I2C
A
M
P
A
D
C
I
/
F
Communication
& Application
or SPI
Z-Sensor
Calcuration
Communication
IC
HSCD
1.
CPU(e.g MSMXXXX、SHX、etc)
X, Y and Z axis sensor produce voltage
according to the geomagnetic field strength.
2.
The function of IC is to amplify the sensor
output (AMP), Analog to Digital conversion
(ADC), and translating to I2C interface (I/F).
3.
Fig 3 The Direction of the geomagnetism
sin?
1
N ormalized output value
X-Sensor
X
0.5
0
Y
-0.5
cos?
-1
0
90
180
270
360
θ [deg.]
The function of CPU is to receive the sensor
signal calculate azimuth based on the
application program. (Refer to Section 4 to the
Fig 4 The Direction of the geomagnetism
azimuth calculation flow)
S
2.2. Definition of X, Y and Z-Sensor
θ
Fig 2 Definition of X-Sensor, Y-Sensor, and
Z-Sensor
N
4. Calibration
The sensor output is influenced by the
surrounding magnetic field. And almost any situation,
there is interference field is applied to the sensor. To
obtain decent azimuth accuracy, sensitivity and offset
3. Azimuth calculation flow
calibration is required.
The information from the sensor is the field
Soft magnetism martial like as parts of NFC ( Near
strength of 3-axis. Azimuth needs to be calculated
Filed Connection ) makes the distortion on
www.alps.co.jp
Geomagnetic Sensor
Application note
2012/09/04
Page 5/7
geomagnetic filed. It is observed the sensitivity
the dynamic range, sensor output is saturated.
change form the system view. Alps can provide
Magnetized soft magnetic material such as iron and
some correlation method for t these issues.
some stainless steel near the sensor become source
The offset is observed on the sensor output under
of interference field. In general, leakage field from the
Zero magnetic field. The azimuth should be
material has temperature dependency. We need to
calculated with these offsets.
understand the physical property. To avoid the
interference, component layout design is very
important.
The correction of the inclination
When rotating the Geomagnetic sensor in X-Y
plane around the axis perpendicular to the ground
(2) Field strength of other components.
plane, the trace of the sensor output of X-axis and
The figure below shows example of leakage
Y-axis draws a circle. But holding the sensor with
magnetic field strength of vibrator, speaker and
some angle which is not horizontal to the ground,
magnet for open/close detection in the cell phone.
and then rotating the sensor around axis which is
perpendicular to the ground, the trace of the sensor
output of X-axis and Y-axis draws an ellipse. In this
0
5
10
15
20
25
30
Leakage magnetic field [mT]
Vibrator
case, inclination correction is required to calculate
Speaker
Magnet for detecting open/close
azimuth. Accelerometer is used to obtain sensor
inclination angle.
Memory card connector and shield material for
Fig 5 Definition of X-Sensor, Y-Sensor, and
Z-Sensor
wireless module also possibly generate magnetic
field once they are magnetized.
(3) Example of field distribution
The figure below shows distribution of the magnetic
Z
Inclination rotation
Y
field strength of a smart phone. It is impossible to
implement the Geomagnetic sensor in the area in
which there has over 2.0 mT value of the magnetic
field.
Horizontal
rotation
X
5. Notice for sensor location
(1) Influence of the magnetic field from other
components.
Sensor dynamic range is ±2.4 [mT].
Beyond
www.alps.co.jp
Geomagnetic Sensor
Application note
2012/09/04
Page 6/7
7. Application Examples
Geomagnetic sensor is usually used as electro
6. Example of combination with
acceleration sensor (I2C interface)
compass to detect that azimuth that mentioned on
this paper. And high accurate geomagnetic sensor
could be achieved as one of motion sensing and
high resolution magnetometer.
KXP84-2050 (KIONIX Co.) is used in the
demonstration kits. One connection example and
8. Legal Disclaimer
control procedure is seen following figures.
(1) Block chart
THIS
AVDD(2.5V)
DVDD(1.8V)
10k
VDD(5V)
Pull-Up
10k
10k
Compass Sensor
Acc. Sensor
Level Translator
KXP84
PCA9306
THE
NOTE
GUIDE.
RS232C
PCA9306
ON
("INFORMATION") SHOULD BE USED ONLY AS A
10k
Level Translator
HSCD**
Compass
INFORMATION
PIC18F
PC
I 2C
ALPS MAKES, AND YOU RECEIVE, NO
I 2C
WARRANTIES
OR
CONDITION,
EXPRESS,
IMPLIED, STATUTORY, OR OTHERWISE, AND
10k
AVDD(3.3V)
DVDD(1.8V)
10k
Pull-Up
10k
10k
VDD(5V)
ALPS SPECIFICALLY DISCLAIMS ANY IMPLIED
WARRANTIES
OF
MERCHANTABILITY,
NON-INFRINGEMENT AND FITNESS FOR A
PARTICULAR PURPOSE.
ALPS DOES NOT WARRANT THAT THE USE
OF
THIS
INFORMATION
WILL
BE
UNINTERRUPTED OR ERROR FREE OR THAT
THIS
INFORMATION
WILL
MEET
YOUR
REQUIREMENTS.
THE USE OF THIS INFORMATION IS
www.alps.co.jp
Geomagnetic Sensor
Application note
2012/09/04
Page 7/7
ENTIRELY AT YOUR RISK
IN NO EVENT WILL ALPS BE LIABLE FOR
SPECIAL,
INDIRECT,
INCIDENTAL,
WILLFUL,
PUNITIVE,
EXEMPLARY,
OR
CONSEQUENTIAL DAMAGES, DAMAGES FOR
LOSS OF BUSINESS PROFITS, OR DAMAGES
FOR LOSS OF BUSINESS
OR ANY THIRD
PARTY ARISING OUT OF THE USE OF THIS
INFORMATION , INCLUDING BUT NOT LIMITED
TO THOSE RESULTING FROM DEFECTS IN THE
INFORMATION, OR LOSS OR INACCURACY OF
DATA OF ANY KIND, WHETHER BASED ON
CONTRACT, TORT OR ANY OTHER LEGAL
THEORY, EVEN IF ALPS HAS BEEN ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.
www.alps.co.jp