# Adafruit SensorLab - Magnetometer Calibration

## Magnetometer Calibration

![](https://cdn-learn.adafruit.com/assets/assets/000/087/569/medium800/sensors_image.png?1580019780 https://en.wikipedia.org/wiki/Earth%27s_magnetic_field#/media/File:Geodynamo_Between_Reversals.gif)

Magnetometers can be used&nbsp; to detect orientation with respect to the Earths magnetic field. Basically, like a compass! We can tell which way is North, and thus correct for motion calculation errors and 'absolute orientation'

Good stuff! But, magnetometers have to measure a very small magnetic field of 35-65 uTesla, in a world full of magnets. And there's some offset when they are manufactured and pick and placed.

Of all the sensors that need calibration, **magnetometers are the most essential to calibrate!** Unless you're detecting strong magnets, there's no way for a magnetometer to work unless you perform a _hard iron offset calculation_. Once this is done, you will get rid of any strong magnetic offset values and be able to find magnetic North!

- [Next Page](https://learn.adafruit.com/adafruit-sensorlab-magnetometer-calibration/install-sensorlab.md)

## Featured Products

### Adafruit Triple-axis Magnetometer - LIS3MDL

[Adafruit Triple-axis Magnetometer - LIS3MDL](https://www.adafruit.com/product/4479)
Sense the magnetic fields that surround us with this handy triple-axis magnetometer (compass) module. Magnetometers can sense where the strongest magnetic force is coming from, generally used to detect magnetic north, but can also be used for measuring magnetic fields. This sensor tends to be...

In Stock
[Buy Now](https://www.adafruit.com/product/4479)
[Related Guides to the Product](https://learn.adafruit.com/products/4479/guides)
### Adafruit LSM6DS33 + LIS3MDL - 9 DoF IMU with Accel / Gyro / Mag

[Adafruit LSM6DS33 + LIS3MDL - 9 DoF IMU with Accel / Gyro / Mag](https://www.adafruit.com/product/4485)
_This item is discontinued - **you can grab** [Adafruit LSM6DS3 + LIS3MDL - Precision 9 DoF IMU](https://adafruit.com/products/5543) **instead!&nbsp;** _

Add motion,&nbsp;direction and orientation&nbsp;sensing to your Arduino project with this all-in-one 9 Degree...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4485)
[Related Guides to the Product](https://learn.adafruit.com/products/4485/guides)
### Adafruit 9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS1

[Adafruit 9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS1](https://www.adafruit.com/product/3387)
Add motion, direction and orientation sensing to your Arduino project with this all-in-one 9-DOF sensor. Inside the chip are three sensors, one is a classic 3-axis accelerometer, which can tell you which direction is down towards the Earth (by measuring gravity) or how fast the board is...

In Stock
[Buy Now](https://www.adafruit.com/product/3387)
[Related Guides to the Product](https://learn.adafruit.com/products/3387/guides)
### Adafruit Precision NXP 9-DOF Breakout Board

[Adafruit Precision NXP 9-DOF Breakout Board](https://www.adafruit.com/product/3463)
The NXP Precision 9DoF breakout combines two of the best motion sensors we've tested here at Adafruit: The **FXOS8700** 3-Axis accelerometer and magnetometer, and the **FXAS21002** 3-axis gyroscope.

These two sensors combine to make a nice 9-DoF kit, that...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3463)
[Related Guides to the Product](https://learn.adafruit.com/products/3463/guides)
### Triple-axis Accelerometer+Magnetometer (Compass) Board - LSM303

[Triple-axis Accelerometer+Magnetometer (Compass) Board - LSM303](https://www.adafruit.com/product/1120)
Discontinued - **you can grab** [Adafruit LSM303AGR Accelerometer Magnetometer - STEMMA QT Qwiic](https://www.adafruit.com/product/4413) instead!

&nbsp;

He told you "Go West, young maker!" - but you don't know which way is West! Ah, if only you had this...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1120)
[Related Guides to the Product](https://learn.adafruit.com/products/1120/guides)
### Adafruit LSM303AGR Accelerometer Magnetometer - STEMMA QT Qwiic

[Adafruit LSM303AGR Accelerometer Magnetometer - STEMMA QT Qwiic](https://www.adafruit.com/product/4413)
Do you know which way the wind blows? You will now, with this triple-axis accelerometer/magnetometer compass module. Inside are two sensors, one is a classic 3-axis accelerometer, which can tell you which direction is down towards the Earth (by measuring gravity). The other is a magnetometer...

In Stock
[Buy Now](https://www.adafruit.com/product/4413)
[Related Guides to the Product](https://learn.adafruit.com/products/4413/guides)
### FLORA Accelerometer/Compass Sensor - LSM303

[FLORA Accelerometer/Compass Sensor - LSM303](https://www.adafruit.com/product/1247)
Add motion and direction sensing to your wearable FLORA project with this high precision 3-axis Accelerometer+Compass sensor. Inside are two sensors, one is a classic 3-axis accelerometer, which can tell you which direction is down towards the Earth (by measuring gravity) or how fast the board...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1247)
[Related Guides to the Product](https://learn.adafruit.com/products/1247/guides)

## Related Guides

- [LSM303 Accelerometer + Compass Breakout](https://learn.adafruit.com/lsm303-accelerometer-slash-compass-breakout.md)
- [LIS3MDL Triple-axis Magnetometer](https://learn.adafruit.com/lis3mdl-triple-axis-magnetometer.md)
- [How to Fuse Motion Sensor Data into AHRS Orientation (Euler/Quaternions)](https://learn.adafruit.com/how-to-fuse-motion-sensor-data-into-ahrs-orientation-euler-quaternions.md)
- [Adafruit LSM6DS33 6-DoF IMU Breakout](https://learn.adafruit.com/lsm6ds33-6-dof-imu-accelerometer-gyro.md)
- [I2C Addresses and Troublesome Chips](https://learn.adafruit.com/i2c-addresses.md)
- [Comparing Gyroscope Datasheets](https://learn.adafruit.com/comparing-gyroscope-datasheets.md)
- [Adafruit SensorLab - Gyroscope Calibration](https://learn.adafruit.com/adafruit-sensorlab-gyroscope-calibration.md)
- [Glitter Positioning System](https://learn.adafruit.com/glitter-positioning-system.md)
- [Adafruit LSM9DS1 Accelerometer + Gyro + Magnetometer 9-DOF Breakout](https://learn.adafruit.com/adafruit-lsm9ds1-accelerometer-plus-gyro-plus-magnetometer-9-dof-breakout.md)
- [Adafruit SGP30 TVOC/eCO2 Gas Sensor](https://learn.adafruit.com/adafruit-sgp30-gas-tvoc-eco2-mox-sensor.md)
- [reef-pi Guide 2: Power Controller](https://learn.adafruit.com/reef-pi-power-controller.md)
- [Adafruit TRRS Jack Breakout Board](https://learn.adafruit.com/trrs-jack-breakout.md)
- [Introducing the Adafruit Bluefruit LE UART Friend](https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-friend.md)
- [Gemma M0 Vibration Sensor Motion Alarm](https://learn.adafruit.com/motion-alarm.md)
- [Adafruit USB Host BFF](https://learn.adafruit.com/adafruit-usb-host-bff.md)
