Angled top view of the pre-soldered BNO085 orientation sensor board

BNO085 Pre-Soldered IMU Orientation Sensor Module | ShillehTek Product Manual

ArduinoESP32Raspberry PiPicomanual-product-10645385969951
$34.99 USD In stock · Order by 3pm ET, ships today

Overview

The BNO085 is a 9-axis motion sensor with its own sensor-fusion processor. One package holds a 3-axis accelerometer, gyroscope and magnetometer plus a small processor running CEVA's SH-2 firmware, which blends all three and hands you finished results: orientation as a quaternion, linear acceleration, gravity, step counts and more. You get stable orientation without writing or tuning a fusion filter yourself.

This pre-soldered GY-BNO08X board breaks out ten pins: VCC, GND, SCL, SDA, ADD, CS, INT, RST, PS1 and PS0. It has no regulator or level shifter, so it is a 3.3 V-only board (2.4 to 3.6 V). With PS0 and PS1 left alone it speaks I2C. Connecting PS0 to 3.3 V switches it to UART-RVC, a one-wire stream of yaw, pitch, roll and acceleration at 115200 baud that even an Arduino Uno can read.

Typical uses are robot heading, self-balancing robots, gimbals, head tracking and motion capture. This manual covers the pinout, wiring for Arduino, ESP32, Raspberry Pi and Pico, working code for each, and answers on the I2C address, UART-RVC mode, yaw drift and connection problems.

At a Glance

Sensor
BNO085 9-axis IMU with fusion
Outputs
Quaternion · yaw, pitch, roll
Interfaces
I2C · UART-RVC · UART · SPI
I2C Address
0x4B (0x4A with ADD on GND)
Supply
3.3 V only (2.4 – 3.6 V)
Header
10 pins, pre-soldered

Specifications

Parameter Value
Sensor IC CEVA BNO085 with SH-2 sensor-fusion firmware
Sensors 3-axis accelerometer, gyroscope and magnetometer
Fusion outputs Rotation vector, game rotation vector, linear acceleration, gravity and more
Supply voltage 2.4 – 3.6 V (use 3.3 V). No regulator on the board.
Logic level 3.3 V. Not 5 V tolerant.
I2C Normally 0x4B on this board, 0x4A with ADD on GND · 100 or 400 kHz
UART-RVC 115200 baud, 100 frames per second, data out on the SDA pin
Mode pins PS1 / PS0: 00 I2C · 01 UART-RVC · 10 UART · 11 SPI
INT and RST Interrupt output and reset input, both active low, optional for I2C
Header 10-pin: VCC · GND · SCL · SDA · ADD · CS · INT · RST · PS1 · PS0

Pinout Diagram

Ten pins sit in one row. VCC and GND power the board (3.3 V only). SCL and SDA are the I2C lines, and in UART-RVC mode the SDA pin becomes the data output instead. ADD sets the I2C address, CS is the chip select for SPI mode, INT is the interrupt output and RST is the reset input. PS1 and PS0 select the interface: leave both unconnected for I2C, or connect PS0 to 3.3 V for UART-RVC. The pad marked BOOT is for firmware updates only, so leave it unconnected.

GY-BNO08X BNO085 IMU module pinout diagram showing VCC, GND, SCL, SDA, ADD, CS, INT, RST, PS1 and PS0 pins

Wiring Guide

Two interfaces are used below. The ESP32 and Raspberry Pi use I2C with the full SH-2 library. The Arduino Uno / Nano and the Pico use UART-RVC, where the sensor streams yaw, pitch, roll and acceleration on a single wire and no library is needed. The mode pins are read only at power-up, so power-cycle the board after changing PS0.

Arduino Uno / Nano Wiring (UART-RVC)

The SH-2 libraries from Adafruit and SparkFun need more memory than an Uno or Nano has, so this setup uses UART-RVC instead. With PS0 on 3.3 V the sensor sends a ready-made heading 100 times a second on its SDA pin.

BNO085 Pin Arduino Uno / Nano
VCC 3.3V pin
GND GND
PS0 3.3V pin (selects UART-RVC)
SDA RX0 (pin 0), data from the sensor
3.3 V only: Never connect VCC or PS0 to 5V. The board has no regulator and the chip's limit is 3.6 V. Share the 3.3V pin between VCC and PS0 on a breadboard rail.
Uploading: Pin 0 is shared with USB. Unplug the wire from pin 0 before every upload and reconnect it afterward, or the upload will fail.

ESP32 Wiring (I2C)

BNO085 Pin ESP32 Pin Notes
VCC 3V3 Power
GND GND Ground
SDA GPIO 21 I2C data
SCL GPIO 22 I2C clock
If not found: Leave PS0 and PS1 unconnected for I2C, then run an I2C scanner to see whether the board answers at 0x4B or 0x4A. The example sketch tries both addresses.

Raspberry Pi Wiring (I2C)

BNO085 Pin Raspberry Pi Pin Notes
VCC 3.3V (Pin 1) Power
GND GND (Pin 6) Ground
SDA GPIO 2 (Pin 3) I2C data
SCL GPIO 3 (Pin 5) I2C clock
Set 400 kHz: Enable I2C in raspi-config, then add dtparam=i2c_arm_baudrate=400000 to /boot/firmware/config.txt and reboot. The BNO085 works best on a Pi at that bus speed.

Raspberry Pi Pico Wiring (UART-RVC)

BNO085 Pin Pico Pin Notes
VCC 3V3(OUT) (Pin 36) Power
GND GND (Pin 38) Ground
PS0 3V3(OUT) (Pin 36) RVC mode
SDA GP5 (Pin 7) UART1 RX
One data wire: UART-RVC is one-way, so only the sensor's SDA pin goes to the Pico. The example assigns GP4 as UART1 TX, but nothing is connected to it.

Code Examples

View or download this product's example code on GitHub.

All four examples print yaw, pitch and roll in degrees about ten times a second. The UART-RVC examples decode the sensor's 19-byte frames directly. The I2C examples read the game rotation vector, a quaternion built from the accelerometer and gyroscope, and convert it to angles.

Arduino Uno / Nano — UART-RVC (No Library)

bno085_rvc_uno.ino
// BNO085 (GY-BNO08X) in UART-RVC mode on an Arduino Uno or Nano - no library needed
// Wiring: VCC -> 3.3V, GND -> GND, PS0 -> 3.3V, SDA pin (data out) -> RX0 (pin 0)
// Unplug the wire from pin 0 while uploading, then reconnect it.
// The sensor sends a 19-byte frame 100 times per second at 115200 baud.

uint8_t frame[17];            // everything after the two 0xAA header bytes
unsigned long lastPrint = 0;

int16_t toInt16(uint8_t low, uint8_t high) {
  return (int16_t)(((uint16_t)high << 8) | low);
}

void setup() {
  Serial.begin(115200);       // RX listens to the sensor, TX prints to the Serial Monitor
}

// Returns true when frame[] holds a complete frame with a valid checksum
bool readFrame() {
  while (Serial.available() >= 19) {
    if (Serial.read() != 0xAA) continue;       // first header byte
    if (Serial.peek() != 0xAA) continue;       // second header byte
    Serial.read();
    for (uint8_t i = 0; i < 17; i++) frame[i] = Serial.read();
    uint8_t sum = 0;
    for (uint8_t i = 0; i < 16; i++) sum += frame[i];
    if (sum == frame[16]) return true;
  }
  return false;
}

void loop() {
  if (!readFrame()) return;
  if (millis() - lastPrint < 100) return;      // print 10 times per second
  lastPrint = millis();

  float yaw   = toInt16(frame[1], frame[2]) * 0.01;   // degrees
  float pitch = toInt16(frame[3], frame[4]) * 0.01;
  float roll  = toInt16(frame[5], frame[6]) * 0.01;

  Serial.print("Yaw: ");
  Serial.print(yaw, 2);
  Serial.print("   Pitch: ");
  Serial.print(pitch, 2);
  Serial.print("   Roll: ");
  Serial.println(roll, 2);
}

ESP32 — I2C with the Adafruit BNO08x Library

bno085_esp32_i2c.ino
// BNO085 (GY-BNO08X) on an ESP32 over I2C - quaternion to yaw / pitch / roll
// Library Manager: install "Adafruit BNO08x" (it pulls in Adafruit BusIO and Unified Sensor)
// Wiring: VCC -> 3V3, GND -> GND, SDA -> GPIO 21, SCL -> GPIO 22 (PS0 and PS1 left open)
#include <Adafruit_BNO08x.h>

#define BNO08X_RESET -1            // RST pin not wired
Adafruit_BNO08x bno08x(BNO08X_RESET);
sh2_SensorValue_t sensorValue;

void setReports() {
  // Game rotation vector: smooth orientation from the accelerometer and gyroscope
  if (!bno08x.enableReport(SH2_GAME_ROTATION_VECTOR, 20000)) {   // one report every 20 ms
    Serial.println("Could not enable the game rotation vector");
  }
}

void setup() {
  Serial.begin(115200);
  // This board style normally answers at 0x4B; it moves to 0x4A when ADD is tied to GND
  if (!bno08x.begin_I2C(0x4B) && !bno08x.begin_I2C(0x4A)) {
    Serial.println("BNO085 not found - check wiring and 3.3 V power");
    while (true) { delay(1000); }
  }
  setReports();
}

void loop() {
  if (bno08x.wasReset()) setReports();            // turn the report back on after a reset
  if (!bno08x.getSensorEvent(&sensorValue)) return;
  if (sensorValue.sensorId != SH2_GAME_ROTATION_VECTOR) return;

  float qr = sensorValue.un.gameRotationVector.real;
  float qi = sensorValue.un.gameRotationVector.i;
  float qj = sensorValue.un.gameRotationVector.j;
  float qk = sensorValue.un.gameRotationVector.k;

  float yaw   = atan2(2.0 * (qi * qj + qk * qr), 1.0 - 2.0 * (qj * qj + qk * qk)) * RAD_TO_DEG;
  float pitch = asin(constrain(2.0 * (qj * qr - qi * qk), -1.0, 1.0)) * RAD_TO_DEG;
  float roll  = atan2(2.0 * (qj * qk + qi * qr), 1.0 - 2.0 * (qi * qi + qj * qj)) * RAD_TO_DEG;

  Serial.print("Yaw: ");
  Serial.print(yaw, 1);
  Serial.print("   Pitch: ");
  Serial.print(pitch, 1);
  Serial.print("   Roll: ");
  Serial.println(roll, 1);
}

Raspberry Pi — Python over I2C

bno085_pi.py
#!/usr/bin/env python3
# BNO085 (GY-BNO08X) on Raspberry Pi over I2C
# Install once: pip3 install adafruit-circuitpython-bno08x   (enable I2C in raspi-config)
# Recommended: add dtparam=i2c_arm_baudrate=400000 to /boot/firmware/config.txt, then reboot
import math
import time
import board
import busio
from adafruit_bno08x import BNO_REPORT_GAME_ROTATION_VECTOR
from adafruit_bno08x.i2c import BNO08X_I2C

i2c = busio.I2C(board.SCL, board.SDA, frequency=400000)
bno = BNO08X_I2C(i2c, address=0x4B)      # use 0x4A if ADD is tied to GND
bno.enable_feature(BNO_REPORT_GAME_ROTATION_VECTOR)

while True:
    qi, qj, qk, qr = bno.game_quaternion
    yaw = math.degrees(math.atan2(2 * (qi * qj + qk * qr), 1 - 2 * (qj * qj + qk * qk)))
    pitch = math.degrees(math.asin(max(-1.0, min(1.0, 2 * (qj * qr - qi * qk)))))
    roll = math.degrees(math.atan2(2 * (qj * qk + qi * qr), 1 - 2 * (qi * qi + qj * qj)))
    print(f"Yaw: {yaw:7.1f}   Pitch: {pitch:6.1f}   Roll: {roll:7.1f}")
    time.sleep(0.1)

Raspberry Pi Pico — MicroPython over UART-RVC

bno085_pico_rvc.py
# BNO085 (GY-BNO08X) on Raspberry Pi Pico in UART-RVC mode (MicroPython, no driver needed)
# Wiring: VCC -> 3V3(OUT), GND -> GND, PS0 -> 3V3(OUT), SDA pin (data out) -> GP5 (UART1 RX)
from machine import UART, Pin
import struct
import time

uart = UART(1, baudrate=115200, tx=Pin(4), rx=Pin(5), rxbuf=512)
HEADER = bytes([0xAA])


def read_frame():
    """Return ((yaw, pitch, roll) in degrees, (x, y, z) in m/s^2), or None."""
    while uart.any() >= 19:
        if uart.read(1) != HEADER:              # first header byte
            continue
        if uart.read(1) != HEADER:              # second header byte
            continue
        frame = uart.read(17)
        if frame is None or len(frame) != 17:
            return None
        if sum(frame[0:16]) & 0xFF != frame[16]:
            continue                            # checksum mismatch
        index, yaw, pitch, roll, ax, ay, az = struct.unpack_from("<Bhhhhhh", frame, 0)
        angles = (yaw * 0.01, pitch * 0.01, roll * 0.01)
        accel = (ax * 0.0098067, ay * 0.0098067, az * 0.0098067)    # mg to m/s^2
        return angles, accel
    return None


while True:
    latest = None
    reading = read_frame()
    while reading:                              # drain the buffer and keep the newest frame
        latest = reading
        reading = read_frame()
    if latest:
        (yaw, pitch, roll), (ax, ay, az) = latest
        print("Yaw: {:7.2f}  Pitch: {:6.2f}  Roll: {:7.2f}  Accel: {:5.2f} {:5.2f} {:5.2f}".format(
            yaw, pitch, roll, ax, ay, az))
    time.sleep(0.1)

Frequently Asked Questions

Can I power the BNO085 module from 5 V?
No. This board has no regulator or level shifter, and the chip is rated for 2.4 to 3.6 V. VCC and every signal pin must stay at 3.3 V. On an Uno or Nano, use the 3.3V pin and the UART-RVC wiring from the Arduino tab. The data only travels from the sensor to the Arduino there, so no level converter is needed.
What is UART-RVC mode, and when should I use it?
RVC stands for robot vacuum cleaner, the product this simplified mode was made for. With PS0 on 3.3 V the sensor needs no commands: it sends a 19-byte frame 100 times a second at 115200 baud with yaw, pitch, roll and three-axis acceleration. It is ideal for small boards such as the Uno and for quick tests. The trade-off is that you only get those values, and yaw is counted from the direction the sensor faced at power-up.
Which I2C address does my board use?
Boards of this GY-BNO08X style normally answer at 0x4B with ADD left open, and at 0x4A when ADD is connected to GND. Many online examples assume 0x4A, so run an I2C scanner if a library reports that it cannot find the sensor. The ESP32 example tries both addresses, and the Raspberry Pi example has the address on one clearly marked line.
Why does my yaw drift, or not point north?
The examples use the game rotation vector, which ignores the magnetometer. It is smooth and immune to magnetic interference, but its yaw has no absolute reference and can drift slowly. For a heading tied to magnetic north, enable the rotation vector report instead (SH2_ROTATION_VECTOR in Arduino, BNO_REPORT_ROTATION_VECTOR in Python), move the sensor in a figure-eight to calibrate, and keep it away from motors, magnets and steel.
The ESP32 or Raspberry Pi cannot find the sensor. What should I check?
Confirm 3.3 V on VCC and that SDA and SCL are not swapped. PS0 and PS1 must be unconnected for I2C. If PS0 is still on 3.3 V from a UART-RVC test, the chip is not in I2C mode. Power-cycle after any change, keep the wires short, and try both addresses. On a Raspberry Pi, set the bus to 400 kHz as shown in the wiring tab. If I2C stays unreliable, UART-RVC is a dependable fallback.
Do I need the INT, RST, CS and BOOT pins?
Not for the examples in this manual. The Adafruit library runs over I2C without INT or RST, although wiring RST to a spare GPIO lets the library hard-reset the sensor. INT and RST become important in SPI mode, where CS is the chip select. BOOT is only for firmware updates and should stay unconnected.
pip3 reports externally-managed-environment on my Raspberry Pi. What now?
Current Raspberry Pi OS blocks system-wide pip installs. Create a virtual environment once with python3 -m venv --system-site-packages ~/sensors, activate it with source ~/sensors/bin/activate, and then run the pip3 install line from the example inside it. Activate the environment again whenever you open a new terminal to run the script.

Related Tutorials