This guide has been refactored and updated for more sensors, calibration storage, and more algorithms, including quaternion output. Please visit to read the new guide!
The current example Arduino sketches are available on Github as part of the Adafruit AHRS libray.

Downloading the AHRS Sample Code

To install the drivers and AHRS sketch for your breakout, you simply need to install the Adafruit_AHRS library and it's dependencies on your PC (the exact dependencies you choose will depend on which IMU board you are currently using).

We've put together a tutorial showing you everything you need to do to install dependent libraries if you're just getting started with your breakout. Follow the guide below to install the right libraries depending on which board you are using:

In addition to the dependencies above, make sure to install the Adafruit_AHRS library. You can do that via the Arduino Library Manager.

Open up the Arduino Library manager:

Search for the Adafruit AHRS library and install it

If you aren't familiar with how to install an Arduino library, check out this guide on installing libraries.

Loading the Sample Sketch

Once the repository has been added to your libraries folder ("/libraries/Adafruit_AHRS/", etc.) you should be able to access the AHRS examples from 'File > Examples > Adafruit_AHRS' in the Arduino IDE. There should be an ahrs_9dof, ahrs_10dof, and ahrs_lsm9ds0 exampe.

Pick the appropriate example for your board, for example the ahrs_10dof example should be used with the 10-DOF board:
If you compile the sketch and then program your Uno with the code, you should be able to open up the Serial Monitor (Tools > Serial Monitor), set the baud rate to 115200, and see the following output:
This raw data shows the main orientation data, consisting of 'roll', 'pitch' and 'heading' (or 'yaw) in degrees, followed by the current altitude and temperature if you are are using the 10-DOF breakout (the 9-DOF and LSM9DSO breakouts can't measure altitude).

Now close the Serial Monitor and read on to the next page to do something useful with this data!

This guide was first published on Mar 19, 2014. It was last updated on Mar 19, 2014.

This page (Installing the Software) was last updated on May 10, 2021.

Text editor powered by tinymce.