Magnetometer ============ A magnetometer (also called magnetic sensor or M-Sensor) can be used to measure magnetic field strength and direction, and determine device orientation. The principle of a magnetometer is similar to that of a compass. The mPython Board uses the MMC5983MA geomagnetic sensor with a measurement range of ±5 Gauss, capable of measuring magnetic induction intensity and indicating direction. .. admonition:: Fun Fact - Earth's Magnetic Field The Earth's magnetic field originates from within the Earth and extends into space. Roughly speaking, the geomagnetic field is a magnetic dipole tilted at an 11° angle to the Earth's rotation axis, equivalent to placing a tilted magnetic bar at the Earth's center. The current geomagnetic north pole is located near Greenland in the Northern Hemisphere. It is actually the south pole of the geomagnetic field, while the geomagnetic south pole is the north pole of the geomagnetic field. When heat radiates from the Earth's core, it causes convective motion of molten iron in the outer core, which generates electric currents. The geomagnetic field is produced by these currents. This principle of forming celestial magnetic fields is called dynamo theory. The unit for measuring magnetic induction intensity is Tesla or Gauss [1 Tesla = 10000 Gauss]. Depending on geographic location, the typical geomagnetic field strength is 250-600 milligauss. .. figure:: /_static/products/ledong-v2/_static/image/tutorials/magnetic/earth_magnetic.jpg :width: 600px :align: center Earth's magnetic field distribution map Using the Magnetometer on the mPython Board ------------------------------------------- Earth's Magnetic 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 the local horizontal plane. 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 The geomagnetic field at any point in space can be described by a three-dimensional vector. The most basic method of measuring vector direction is to use a compass to determine the direction of magnetic north. The angle between this direction and true north is called "declination" (D), and the angle between it and the horizontal plane is called "inclination" (I). The magnetic field strength (F) is proportional to the magnetic force on the magnet. Another description method uses North (X), East (Y), and Down (Z) coordinates. [12] The Earth's magnetic field points 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; at the equator, it is parallel to the local horizontal plane. Therefore, in the Northern Hemisphere, the magnetic field direction tilts toward the ground. The unit for measuring magnetic induction intensity is Tesla or Gauss (1 Tesla = 10000 Gauss). Depending on geographic location, the typical geomagnetic field strength is 0.4-0.6 Gauss. Note that the magnetic north pole and geographic north pole do not coincide; there is typically 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 the local horizontal plane. 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; unlike magnetic poles attract. Therefore, the north pole of a compass always points toward the geographic north pole (geomagnetic south pole). A compass, also called a north-seeking needle, mainly consists of a magnetic needle mounted on an axis. Under the influence of the natural geomagnetic field, the magnetic needle can rotate freely and remain in the tangential direction of the magnetic meridian. The north pole of the magnetic needle points toward the geographic north pole. This property can be used to determine direction. It is commonly used in navigation, geodesy, travel, and military applications. The invention of the direction-indicating compass in physics consists of three parts: the sinan (ancient Chinese compass), the magnetic needle, and the compass. They are all Chinese inventions.