# 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!

# Adafruit SensorLab - Magnetometer Calibration

## Install SensorLab

Since there's dozens of different sensor manufacturers out there, and we don't want to have a ton of #ifdef's in our code to manage each kind, we'll be using Adafruit SensorLab to manage detecting the various magnetometers, accelerometers, pressure sensors... etc!

Adafruit SensorLab automatically detects a wide range of sensors, over I2C, no matter what I2C address it's on. It will return an [Adafruit Unified Sensor](https://github.com/adafruit/Adafruit_Sensor) object that we can query for events. You can't do advanced stuff like manually setting ranges or internal filters, but for many projects the basics will do just fine!

We'll be assuming you have the sensor on the main I2C port, and of course use the matching Adafruit library to verify the sensor is working and powered right before you continue!

[A list of supported sensors is available here](https://github.com/adafruit/Adafruit_SensorLab/blob/master/README.md)

Info: 

# Install SensorLab

Since there are a ton of sensors, and [we also use Arcada in a few examples](https://learn.adafruit.com/adafruit-pybadge/arcada-libraries), there's **a lot of libraries to install**

No really, we have a lot of software involved here - probably 20 or so libraries total!

For that reason **we really strongly recommend you use Arduino 1.8.10 or greater** which handles automatic library dependency installation. Otherwise you will be frustrated...

Select the **Sketch -\> Include Library -\> Manage Libraries...**

![](https://cdn-learn.adafruit.com/assets/assets/000/087/571/medium800/sensors_image.png?1580020735)

Search for **Sensor Lab** and install the Adafruit library you see

![](https://cdn-learn.adafruit.com/assets/assets/000/087/570/medium800/sensors_image.png?1580020685)

# Adafruit SensorLab - Magnetometer Calibration

## Simple Magnetic Calibration

If you don't want to set up a graphical interface for calibration a magnetic sensor, you can do a simple hard iron calibration using just the serial interface. The nice thing about this is it will work for any and all boards, and does not require any additional software installation!

Info: 

# Step 1 - Upload the SensorLab `hardiron simplecal` Example

We have a simple sketch that will repeatedly read magnetometer data and calculate hard iron offsets

Open up the `Adafruit_SensorLab->calibration->mag_hardiron_simplecal`

![](https://cdn-learn.adafruit.com/assets/assets/000/087/431/medium800/sensors_image.png?1579827046)

# Step 2 - Open Serial Port
Open the serial port to launch the SensorLab calibration. You should see your magnetometer detected

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/556/medium640/sensors_image.png?1580017067)

Spin the board around until you see the last three numbers settle closer to each other and [range from 25uT to 65uT](https://en.wikipedia.org/wiki/Earth%27s_magnetic_field)

The middle three numbers are the hard offsets in uTesla.

In this case shown below, the screenshot indicates `x = -5.68, y = 7.48, z = 19.34`

![](https://cdn-learn.adafruit.com/assets/assets/000/087/555/medium800/sensors_image.png?1580017042)

# Adafruit SensorLab - Magnetometer Calibration

## Magnetic Calibration with MotionCal

[Paul Stoffregen of PJRC](https://www.pjrc.com) wrote a really awesome cross-platform calibration helper that is great for doing both soft and hard iron magnetometer calibration. What's nice about it is you get a 3D visualization of the magnetometer output and it also tosses outliers and tells you how much spherical coverage you got!

Warning: 

# Step 1 - Download MotionCal Software

MotionCal is available for Mac, Windows and Linux, [you can download it from clicking here](https://www.pjrc.com/store/prop_shield.html).

Look for this section in the website:

![](https://cdn-learn.adafruit.com/assets/assets/000/087/416/medium800/sensors_image.png?1579824297)

And click the one that matches your computer the best.

# Step 2 - Upload the SensorLab `imucal` Example

Next we have to tell the microcontroller board to send the magnetometer (and, if there is one, accelerometer and gyroscope) data out over serial in the right format.

Open up the `Adafruit_SensorLab->calibration->imucal`

![](https://cdn-learn.adafruit.com/assets/assets/000/087/418/medium800/sensors_image.png?1579825201)

Select your desired board & port from the **Tools** menu then click **Upload**

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/420/medium640/sensors_image.png?1579825411)

Open up the serial console, you'll see SensorLab initialization and detection of whatever magnetometer is available. In this case is a LIS3MDL, but any magnetometer can be calibrated!

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/422/medium640/sensors_image.png?1579825857)

You'll then see a stream of data that looks like:  
`Raw:-58,-815,8362,76,-121,-95,-375,-159,-24`  
`Uni:-0.07,-0.98,10.00,0.0832,-0.1327,-0.1046,-37.50,-15.93,-2.50`

The first three numbers are accelerometer data - if you don't have an accelerometer, they will be 0

The middle three numbers are gyroscope data - if you don't have an gyroscope, they will be 0

The last three numbers are magnetometer, they should _definitely_ not be zeros!

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/424/medium640/sensors_image.png?1579826324)

 **Close the serial port** , and launch MotionCal

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/425/medium640/sensors_image.png?1579826468)

Select the same COM / Serial port you used in Arduino

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/426/medium640/sensors_image.png?1579826562)

Twist the board/sensor around. Make sure its not near any strong magnets (unless that's part of the installation)

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/427/medium640/sensors_image.png?1579826638)

Keep twisting until you get a complete 'sphere' of red dots. At this point you are calibrated!

![sensors_motioncal_mag.png](https://cdn-learn.adafruit.com/assets/assets/000/087/428/medium640/sensors_motioncal_mag.png?1579826684)

In the top right you'll see the hard magnetic offsets at the top, the soft offsets in the middle and the field strength at the bottom.

In this case, the hard iron offsets are `[-6.16, -7.95, 20.77]`

**Take a screenshot of this display, so you can refer to these numbers later!**

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/565/medium640/sensors_image.png?1580019194)

# Adafruit SensorLab - Magnetometer Calibration

## Magnetic Calibration with Jupyter

[Jupyter Notebooks are a powerful cross-platform method for analyzing data using Python](https://jupyter.org/)

You can definitely use Jupyter to plot, analyze and calibrate your sensor data. This method is the most powerful because you can do plotting and calculations. However, we assume you already have Jupyter installed (either desktop or thru Anaconda) and have some familiarity with running 'notebook' style Python!

Warning: 

# Step 1 - Download Calibration Notebook

The gyro/magnetometer notebook lives in the [SensorLab Arduino library, in the `notebooks` folder.](https://github.com/adafruit/Adafruit_SensorLab/tree/master/notebooks)

Look for this section in the website:

[Click to download the iPython/Jupyter Notebook](https://raw.githubusercontent.com/adafruit/Adafruit_SensorLab/master/notebooks/Mag_Gyro_Calibration.ipynb)
 **You must open this notebook within Jupyter - you cannot run it direct from github or from the command line as a text file!**

Once open, your browser will look like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/087/558/medium800/sensors_image.png?1580018118)

# Step 2 - Upload the SensorLab `imucal` Example

Next we have to tell the microcontroller board to send the magnetometer (and, if there is one, accelerometer and gyroscope) data out over serial in the right format.

Open up the `Adafruit_SensorLab->calibration->imucal`

![](https://cdn-learn.adafruit.com/assets/assets/000/087/418/medium800/sensors_image.png?1579825201)

Select your desired board & port from the **Tools** menu then click **Upload**

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/420/medium640/sensors_image.png?1579825411)

Open up the serial console, you'll see SensorLab initialization and detection of whatever magnetometer is available. In this case is a LIS3MDL, but any magnetometer can be calibrated!

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/422/medium640/sensors_image.png?1579825857)

You'll then see a stream of data that looks like:  
`Raw:-58,-815,8362,76,-121,-95,-375,-159,-24`  
`Uni:-0.07,-0.98,10.00,0.0832,-0.1327,-0.1046,-37.50,-15.93,-2.50`

The first three numbers are accelerometer data - if you don't have an accelerometer, they will be 0

The middle three numbers are gyroscope data - if you don't have an gyroscope, they will be 0

The last three numbers are magnetometer, they should _definitely_ not be zeros!

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/424/medium640/sensors_image.png?1579826324)

# Configure the notebook
 **Close the serial port** , and go back to Jupyter. In the first cell, find where we define the **PORT** and change the port to match your serial/COM port. For windows it'll be something like **COM4** for Mac/Linux it'll be like **/dev/cu.USBSERIAL** or something

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/559/medium640/sensors_image.png?1580018346)

Run the first cell so the serial port is set

Then run the second cell, you should see output like this - the serial port is opened and IMU raw data is output as numbers

If you get errors or no numbers, hard-reset the board (click the reset button once) then try re-running the cell again.

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/560/medium640/sensors_image.png?1580018495)

At the next cell we will perform the data capture. Move the board away from any strong magnets and run this cell

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/561/medium640/sensors_image.png?1580018665)

At the bottom of the cell you should start seeing a live plot of 3 circles - each one represents the X, Y and Z offsets. Keep spinning the board in various directions until you get 3 spheroids

Once you're happy, use the mouse to click on the graph. This will cause the data capture to stop

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/562/medium640/sensors_image.png?1580018804)

![sensors_ezgif-7-ae7b654e3a46.gif](https://cdn-learn.adafruit.com/assets/assets/000/087/572/medium640thumb/sensors_ezgif-7-ae7b654e3a46.jpg?1580022363)

Run the next cell to perform the analysis. You'll get your X/Y/Z magnetic ranges and the final hard-offset calibration values.

In this case, the calibration is **X=-5.21, Y=-7.7 and Z= 20.86**

![](https://cdn-learn.adafruit.com/assets/assets/000/087/564/medium800/sensors_image.png?1580018954)

You'll also see the results of removing the offset, this should be 3 nearly-perfectly-superimposed circles with centers at 0,0

![sensors_image.png](https://cdn-learn.adafruit.com/assets/assets/000/087/563/medium640/sensors_image.png?1580018918)

# Adafruit SensorLab - Magnetometer Calibration

## Calibration with Raspberry Pi using Blinka

You can easily calibrate a sensor using the Raspberry Pi using our calibration script. It runs from the command line using Blinka. This page assumes you have already set up Blinka on the Raspberry Pi, but if not, be sure to follow our [CircuitPython Libraries on Linux and Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux) guide.

The easiest way to connect a 9-DoF sensor to the Raspberry Pi is to use a [STEMMA QT/Qwiic](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt) connector which many of our sensors include.

## Using a STEMMA QT Cable

To add a STEMMA connector to your Pi, the easiest way is to use one of our Raspberry Pi add ons that feature the STEMMA QT connector such as a display:

### Adafruit 2.23" Monochrome OLED Bonnet for Raspberry Pi

[Adafruit 2.23" Monochrome OLED Bonnet for Raspberry Pi](https://www.adafruit.com/product/4567)
If you're looking for a bright, readable OLED display for a [Raspberry Pi](https://www.adafruit.com/category/361) (most&nbsp;likely a [Pi Zero](https://www.adafruit.com/category/813)) project, this might be just the thing you need!

The **...**

In Stock
[Buy Now](https://www.adafruit.com/product/4567)
[Related Guides to the Product](https://learn.adafruit.com/products/4567/guides)
![Angled shot of 2.23" OLED display PCB.](https://cdn-shop.adafruit.com/640x480/4567-14.jpg)

### Adafruit Mini PiTFT 1.3" - 240x240 TFT Add-on for Raspberry Pi

[Adafruit Mini PiTFT 1.3" - 240x240 TFT Add-on for Raspberry Pi](https://www.adafruit.com/product/4484)
If you're looking for the most compact li'l color display for a [Raspberry Pi](https://www.adafruit.com/category/361) (most&nbsp;likely a [Pi Zero](https://www.adafruit.com/category/813)) project, this might be just the thing you need!

The **...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/4484)
[Related Guides to the Product](https://learn.adafruit.com/products/4484/guides)
![Video of Adafruit Mini PiTFT 1.3" - 240x240 TFT Add-on on a Raspberry Pi 4. The TFT displays a bootup sequence.](https://cdn-shop.adafruit.com/product-videos/640x480/4484-05.jpg)

### Adafruit Mini PiTFT - 135x240 Color TFT Add-on for Raspberry Pi

[Adafruit Mini PiTFT - 135x240 Color TFT Add-on for Raspberry Pi](https://www.adafruit.com/product/4393)
If you're looking for the most compact li'l color display for a [Raspberry Pi](https://www.adafruit.com/category/361) (most&nbsp;likely a [Pi Zero](https://www.adafruit.com/category/813)) project, this might be just the thing you need!

The **...**

In Stock
[Buy Now](https://www.adafruit.com/product/4393)
[Related Guides to the Product](https://learn.adafruit.com/products/4393/guides)
![Video of Adafruit Mini PiTFT - 135x240 Color TFT Add-on assembled onto a Raspberry Pi 3. The TFT displays a bootup.](https://cdn-shop.adafruit.com/product-videos/640x480/4393-03.jpg)

Or if you'd prefer something more minimal, you could even use a STEMMA QT SHIM:

You'll need a STEMMA cable as well.

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

## Wiring the Sensor

If your sensor does not have a STEMMA connector, you could just wire it up directly to the Pi. The sensors typically have an I2C interface and connecting them up is easy. Here's an example using the LIS3MDL+LSM6DS33 sensor:

- **Pi 3V** &nbsp;to&nbsp;**sensor VCC (red wire)**
- **Pi GND** &nbsp;to&nbsp;**sensor GND (black wire)**
- **Pi SCL** &nbsp;to&nbsp;**sensor SCL (green wire)**
- **Pi SDA** &nbsp;to&nbsp;**sensor SDA (yellow wire)**

![sensors_9-DoF_Sensor_Wiring_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/092/419/medium640/sensors_9-DoF_Sensor_Wiring_bb.jpg?1592698665)

[Download Fritzing Object](https://cdn-learn.adafruit.com/assets/assets/000/092/420/original/9-DoF_Sensor_Wiring.fzz?1592698677)
For more details on wiring up other sensors, be sure to check out [the Python page in our ST 9-DoF Combo Breakouts and Wings](https://learn.adafruit.com/st-9-dof-combo/python-circuitpython) guide.

## Install the libraries

The calibration script uses the the Adafruit\_CircuitPython\_LIS3MDL and Adafruit\_CircuitPython\_LSM6DS libraries. To install, run the following commands:

- `pip3 install adafruit-circuitpython-lis3mdl`
- `pip3 install adafruit-circuitpython-lsm6ds`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported! On some boards, you may need to add `sudo` before `pip3`.

If that complains about pip3 not being installed, then run this first to install it:

- `sudo apt-get install python3-pip`

## Full Example Code

Here's the full script to run the calibration. Go ahead and save that to your Pi as **9dof\_calibration.py**.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Raspberry_Pi_9DoF_Sensor_Calibration/9dof_calibration.py

## Using the Script

Start the script by typing:

- `python3 9dof_calibration.py`

The script will first start by letting you know that it wants to calibrate the magnetometer.

![](https://cdn-learn.adafruit.com/assets/assets/000/092/415/medium800/sensors_step1.png?1592697840)

Press ENTER to continue.

It will start measuring the magnetometer and scrolling the values. Start moving the sensor around in every direction.

![](https://cdn-learn.adafruit.com/assets/assets/000/092/416/medium800/sensors_step2.png?1592697924)

The magnetic Hard Offset values should stop changing after a bit. After it does, press ENTER again.

![](https://cdn-learn.adafruit.com/assets/assets/000/092/417/medium800/sensors_step3.png?1592697971)

The next step is to calibrate the Gyroscope. Place the sensor on a flat surface like a desk or table. Once it is lying still, press ENTER.

![](https://cdn-learn.adafruit.com/assets/assets/000/092/418/medium800/sensors_step4.png?1592698038)

It will run through the numbers and then give you your final calibration values.

## Using a different Sensor

If you are using a different sensor, you will need to install the appropriate library and then make a few changes to the script. The easiest way to find the correct library for your sensor is to look at the associated learn guide for that sensor. This can usually be found on the product page or by searching the Adafruit Learn System.

Here are the changes you will need to make depending on the sensor you have:

### LIS3MDL+LSM6DSOX

No changes are necessary for this sensor.

### LIS3MDL+LSM6DS33

You will need to change the import line from

```python
from adafruit_lsm6ds import LSM6DSOX
```

to

```python
from adafruit_lsm6ds import LSM6DS33
```

You will also need to change the declaration line from

```python
gyro_accel = LSM6DSOX(i2c)
```

to

```python
gyro_accel = LSM6DS33(i2c)
```

### LSM9DS1

You will need to change the import lines from

```python
from adafruit_lsm6ds import LSM6DSOX
from adafruit_lis3mdl import LIS3MDL
```

to

```python
from adafruit_lsm9ds1 import LSM9DS1_I2C
```

You will also need to change the declaration lines from

```python
gyro_accel = LSM6DSOX(i2c)
magnetometer = LIS3MDL(i2c)
```

to

```python
magnetometer = gyro_accel = LSM9DS1_I2C(i2c)
```

### FXOS8700 + FXAS21002

You will need to change the import lines from

```python
from adafruit_lsm6ds import LSM6DSOX
from adafruit_lis3mdl import LIS3MDL
```

to

```python
from adafruit_fxos8700 import FXOS8700
from adafruit_fxas21002c import FXAS21002C
```

You will also need to change the declaration lines from

```python
gyro_accel = LSM6DSOX(i2c)
magnetometer = LIS3MDL(i2c)
```

to

```python
gyro_accel = FXAS21002C(i2c)
magnetometer = FXOS8700(i2c)
```

Also, change any instance of `gyro_accel.gyro` to `gyro_accel.gyroscope` and any instance of `magnetometer.magnetic` to `magnetometer.magnetometer`.


## 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...

Out of 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...

Out of 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)
- [Adafruit SensorLab - Gyroscope Calibration](https://learn.adafruit.com/adafruit-sensorlab-gyroscope-calibration.md)
- [Comparing Gyroscope Datasheets](https://learn.adafruit.com/comparing-gyroscope-datasheets.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 LSM6DS33 6-DoF IMU Breakout](https://learn.adafruit.com/lsm6ds33-6-dof-imu-accelerometer-gyro.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)
- [I2C Addresses and Troublesome Chips](https://learn.adafruit.com/i2c-addresses.md)
- [Adafruit Shield Compatibility Guide](https://learn.adafruit.com/adafruit-shield-compatibility.md)
- [Raspberry Pi I2C Clock Stretching Fixes](https://learn.adafruit.com/raspberry-pi-i2c-clock-stretching-fixes.md)
- [Adafruit 1.28" 240x240 Round TFT LCD](https://learn.adafruit.com/adafruit-1-28-240x240-round-tft-lcd.md)
- [LED Campfire](https://learn.adafruit.com/led-campfire.md)
- [Joy Featherwing](https://learn.adafruit.com/joy-featherwing.md)
- [Adafruit Pixel Trinkey](https://learn.adafruit.com/adafruit-pixel-trinkey.md)
