Reefwing MPU6000/MPU6500 IMU Arduino Library

David Such
5 min readJul 10, 2023

While testing our updated Attitude and Heading Reference System (AHRS) library with a variety of IMUs, we found that there were not a lot of options for the MPU6500. The most popular library appears to be fastIMU, which supports a LOT of different IMU sensors. Unfortunately for us, this library includes a Quaternion structure which clashes with our Quaternion class in imuTypes. Also, it doesn’t provide a time stamp for each sensor reading which we use when displaying the data using the xIMU3 application. So we decided to publish our own version. The Reefwing MPU-6x00 Library can be downloaded via the Arduino IDE Library Manager or directly from our GitHub Repository.

Figure 1. The Arduino Portenta H7 Flight Stack

In an effort to not reinvent the wheel, our library is a fork of the MPU6x00 Library by Simon D. Levy. This is a simple, header-only Arduino library for the InvenSense/TDK MPU6000 and MPU6500 inertial measurement units (IMU) using the SPI bus.

It has been modified to use the Reefwing imuTypes library header to make it compatible with the Reefwing AHRS Library and allow easy graphing of IMU values via the Reefwing

--

--

David Such

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