What Is the HMC5883L? 3-Axis Magnetometer (Compass) and Uses
The HMC5883L is a 3-axis magnetometer (digital compass) sensor over I²C. By measuring the Earth's magnetic field it allows heading calculation; used in robot/drone navigation. IMPORTANT: it is largely discontinued; most 'HMC5883L' modules are actually the QMC5883L, which has a different address/register layout. Calibration is a must for the compass.
The HMC5883L is a 3-axis magnetometer (digital compass) sensor communicating over I²C. By measuring the Earth's magnetic field it allows heading calculation. For the concept, see what is a sensor.
What is the HMC5883L used for?
A digital compass, robot/drone heading and navigation. It is usually combined with an accelerometer/gyroscope (MPU6050) to get a tilt-compensated compass and orientation (AHRS). It is common on the GY-271 module.
Specifications
| Parameter | Value |
|---|---|
| Type | 3-axis magnetometer (I²C) |
| Measurement | Magnetic field (X/Y/Z) |
| Maker | Honeywell |
| Supply | 3.3 V (module may have a regulator) |
Watch out
IMPORTANT: the HMC5883L is largely discontinued; most "HMC5883L" modules on the market are actually the QMC5883L chip, which has a different address/register layout. Choose the library by the actual chip. The magnetometer is disturbed near iron/magnets and motors; for the compass, calibration (hard/soft iron) is a must.
Equivalents
- QMC5883L: the common replacement chip (different register/address).
- QMC5883L / GY-271: often confused as a module.
- LIS3MDL: a modern 3-axis magnetometer.
Find it in our catalog
Use the HMC5883L search.