BNO055
Works with
Any CircuitPython board with I2C or UART
What it does
The BNO055 is a 9-DOF absolute orientation sensor that combines an accelerometer, gyroscope, and magnetometer with a dedicated onboard processor running sensor fusion algorithms. Rather than returning raw sensor data that your code must combine into orientation estimates, it outputs ready-to-use Euler angles (heading, roll, pitch in degrees) and quaternions directly. It also separates linear acceleration (movement without gravity) from gravity itself. This makes it the right choice when you need stable, drift-free orientation — at the cost of a higher price than raw IMUs like the MPU6050. Allow a few seconds after startup for the internal calibration to settle before relying on orientation values.
Installing the library
Copy adafruit_bno055.mpy from the Adafruit CircuitPython Bundle to your board's lib/ folder. Also copy adafruit_bus_device/ if it is not already present.
Quick start
import board
import busio
import adafruit_bno055
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bno055.BNO055_I2C(i2c)
heading, roll, pitch = sensor.euler
print(heading, roll, pitch) # degrees
Key things you can do
| What you want | How to do it |
|---|---|
| Read Euler angles (degrees) | sensor.euler → (heading, roll, pitch) |
| Read quaternion | sensor.quaternion → (w, x, y, z) |
| Read total acceleration (m/s²) | sensor.acceleration → (x, y, z) |
| Read acceleration without gravity | sensor.linear_acceleration → (x, y, z) |
| Read gravity vector only | sensor.gravity → (x, y, z) |
| Check calibration status | sensor.calibration_status → (sys, gyro, accel, mag) each 0–3 |
Reading the official docs
https://docs.circuitpython.org/projects/bno055/en/latest/
The calibration_status property returns a tuple of four values (0–3 each). A value of 3 means fully calibrated for that subsystem. The docs explain how to save and restore calibration data to avoid repeating the calibration process on every power cycle.
Projects using this library
- Adafruit BNO055 Absolute Orientation Sensor — full guide covering calibration, Euler angles, and quaternion output. Credit: Adafruit Learning System
- Digital Compass — displays heading on a small screen using the BNO055 magnetometer output. Credit: This wiki