Reefwing AHRS Arduino Library for Drones — Part 1

David Such
11 min readAug 8

The Reefwing AHRS library provides an Attitude and Heading Reference System (AHRS) class for use with Arduino compatible boards. The library has been tested with the Arduino Nano, Nano 33 BLE, Nano 33 BLE SENSE (REV 1 and REV 2), Nano 33 IoT, MKR Vidor 4000, Portenta H7 and the Seeed XIAO nRF52840 Sense boards.

An Attitude and Heading Reference System (AHRS) takes information from the Inertial Measurement Unit (IMU) and processes it to provide reliable roll, pitch and yaw angles (Figure 1). Our library can be downloaded using the Arduino IDE Library Manager, or directly from the Reefwing GitHub Repository.

Figure 1. Attitude and Heading Reference System (AHRS)

The initial version of this library was released in February 2022. It is now time for a substantial update!

We wrote about the sensor changes in the Nano 33 BLE revision 2 boards in an earlier article. Version 2 of the Nano 33 BLE Sense, replaces the LSM9DS1 9 axis IMU with a combination of two IMUs, the BMI270, a 6 axis gyro & accelerometer and the BMM150, a 3 axis magnetometer. In order to support the new hardware, it makes sense to separate the sensor processing from the sensor fusion algorithms.

Consequently, we are pulling out the LSM9DS1 IMU code from the Reefwing AHRS Library and have released it as a separate Library. The LSM9DS1 library is targeting the Nano 33 BLE and Nano 33 BLE Sense Rev 1 Arduino boards.

Similarly, we removed the LPS22HB barometer code from our AHRS library and released a stand alone Library for the LPS22HB Pressure Sensor, found in the Arduino Nano 33 BLE Sense Revisions 1 and 2.

David Such

Reefwing Software · Embedded Systems Engineer · iOS & Android Development · Robotics · Drones · Arduino · Raspberry Pi · Flight Control

Recommended from Medium


See more recommendations