Magnetometer
Reports the magnetic flux density (typically in microtesla) along three orthogonal axes. Combined with an accelerometer for tilt-compensation, gives heading.
Most consumer chips use anisotropic magnetoresistance (AMR) or tunnel magnetoresistance (TMR): the resistance of a thin-film element changes with the applied magnetic field. On-chip excitation coils 'set' and 'reset' the element to remove offset, and ADCs digitize each axis.
In plain terms
A 3-axis compass needle on a chip: tells you which way Earth's magnetic field is pointing in your reference frame.
Why designers use it
- Digital compass on phones and navigation devices.
- Heading reference fused with GPS and gyro for drone yaw.
- Industrial sensing of motor-pole position.
- Detection of ferromagnetic objects (door open/close).
Best for
- Compass heading
- Yaw fusion
- Door sense
Key specifications
- Operating limits: Check the exact manufacturer's datasheet (A family name does not establish voltage, current, temperature or timing limits.)
- Pin assignment: Match the complete part and package code (A similar name or function does not guarantee the same wiring.)
- Mechanical fit: Use the exact package drawing (Check pad layout, dimensions and viewing direction before building.)
When not to use it
- Inside steel enclosures or near motors — the field gets distorted (hard- and soft-iron effects).
- When you need sub-degree absolute heading without calibration — every install needs hard/soft-iron correction.
Common mistakes
- Skipping the figure-8 calibration for hard-iron offset.
- Mounting near a buck inductor and getting tens of µT of switching ripple coupled in.
Where you will find it
- Phones use a 3-axis magnetometer (Bosch BMM, AKM AK09xxx) for compass apps.
- DJI flight controllers fuse magnetometer with IMU for yaw.
- Industrial encoders use AMR/TMR magnetometers to read shaft position.
A short history
Lord Kelvin observed the AMR effect in 1856. Practical AMR magnetometers became commercially common with Honeywell HMC parts in the 1990s. TMR sensors emerged in the 2000s with much higher sensitivity.