Magnetometer
A magnetometer (Magnetic, M-Sensor), also called a geomagnetic sensor or magnetic sensor, can be used to measure the strength and direction of a magnetic field and to determine the orientation of a device. Its working principle is similar to that of a compass. The mPython Board uses an MMC5983MA geomagnetic sensor with a measurement range of ±5 Gauss, capable of measuring the magnetic flux density and indicating direction.
Fun fact – the geomagnetic field
The geomagnetic field originates inside the Earth and extends into space. Roughly speaking, it is a magnetic dipole tilted 11° from the Earth’s rotation axis, as if a tilted magnetic bar were placed at the center of the Earth. The current geomagnetic north pole is located near Greenland in the Northern Hemisphere; in fact it is the south pole of the geomagnetic field, while the geomagnetic south pole is the north pole of the field.
As heat radiates outward from the Earth’s core, it drives convective motion of molten iron in the outer core, which in turn generates electric currents; the geomagnetic field is produced by these currents. This principle of how celestial bodies form magnetic fields is called dynamo theory.
The units used to measure magnetic flux density are the Tesla or the Gauss [1 Tesla = 10000 Gauss]. Depending on the geographic location, the geomagnetic field strength is typically 250~600 milligauss.
Distribution of the geomagnetic field
Using the Magnetometer on the mPython Board
Geomagnetic Field
The geomagnetic field is a vector. For a fixed location, this vector can be decomposed into two components parallel to the local horizontal plane and one component perpendicular to it. If the electronic compass is kept parallel to the local horizontal plane, the three axes of the magnetometer in the compass correspond to these three components, as shown in Figure 2.
Mathematical description
At any point in space, the geomagnetic field can be described by a three-dimensional vector. The most basic method of measuring the vector direction is to use a compass to determine the direction of the magnetic north pole. The angle between this direction and true north is called the “declination” (D), and the angle between it and the horizontal plane is called the “inclination” (I). The field intensity (F) is proportional to the magnetic force on a magnet. Another way to describe it is with north (X), east (Y) and down (Z) coordinates. [12]
The Earth’s magnetic field runs from the magnetic north pole to the magnetic south pole, like a bar magnet. At the magnetic poles the field is perpendicular to the local horizontal plane, while at the equator it is parallel to the local horizontal plane, so in the Northern Hemisphere the field direction tilts downward toward the ground. The units used to measure magnetic flux density are the Tesla or the Gauss (1 Tesla = 10000 Gauss). Depending on the geographic location, the geomagnetic field strength is typically 0.4-0.6 Gauss. Note that the magnetic north pole does not coincide with the geographic north pole; there is usually an angle of about 11 degrees between them.
The geomagnetic field is a vector. For a fixed location, this vector can be decomposed into two components parallel to the local horizontal plane and one component perpendicular to it. If the electronic compass is kept parallel to the local horizontal plane, the three axes of the magnetometer in the compass correspond to these three components, as shown in the figure.
Magnetic Fields in Daily Life
Compass Applications
The geomagnetic north pole is near the geographic south pole The geomagnetic south pole is near the geographic north pole Like magnetic poles repel each other; unlike magnetic poles attract So the north pole of a compass needle always points to the geographic north pole (the geomagnetic south pole)
A compass, also called a magnetic north-seeking needle, mainly consists of a magnetic needle mounted on an axis. Under the action of the natural geomagnetic field, the needle can rotate freely and stay along the tangent of the magnetic meridian; the north pole of the needle points toward the geographic north pole, and this property can be used to tell directions. It is commonly used in navigation, geodesy, travel and military applications. Physically, the invention of the direction-indicating compass consists of three parts: the sinan (ancient Chinese south-pointing spoon), the magnetic needle and the compass card. They are all inventions of China.