

The GY-BNO08X is an advanced Inertial Measurement Unit (IMU) that integrates a 3-axis accelerometer, 3-axis gyroscope, and 3-axis magnetometer. It features a built-in sensor fusion algorithm, enabling it to provide highly accurate orientation, heading, and motion data. This makes it an ideal choice for applications requiring precise motion tracking and spatial awareness.








The GY-BNO08X is a versatile IMU with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V - 5V |
| Communication Interfaces | I2C, SPI, UART |
| Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
| Gyroscope Range | ±125°/s, ±250°/s, ±500°/s, ±1000°/s, ±2000°/s |
| Magnetometer Range | ±4900 µT |
| Orientation Output | Quaternion, Euler angles |
| Operating Temperature | -40°C to +85°C |
| Dimensions | 15mm x 15mm |
The GY-BNO08X module has the following pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VIN | Power input (3.3V - 5V) |
| 2 | GND | Ground |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
| 5 | PS0 | Protocol selection (I2C/SPI/UART) |
| 6 | PS1 | Protocol selection (I2C/SPI/UART) |
| 7 | INT | Interrupt output (optional) |
| 8 | RST | Reset pin (active low) |
The GY-BNO08X can be easily interfaced with an Arduino UNO using the I2C protocol. Follow these steps to connect the module:
Wiring:
VIN pin of the GY-BNO08X to the 5V pin on the Arduino.GND pin of the GY-BNO08X to the GND pin on the Arduino.SDA pin of the GY-BNO08X to the A4 pin on the Arduino (I2C data line).SCL pin of the GY-BNO08X to the A5 pin on the Arduino (I2C clock line).PS0 and PS1 pins unconnected for I2C mode (default).Install Required Libraries:
Adafruit_BNO08x library from the Arduino Library Manager.Example Code: Use the following example code to read orientation data from the GY-BNO08X:
#include <Wire.h>
#include <Adafruit_BNO08x.h>
// Create an instance of the BNO08x sensor
Adafruit_BNO08x bno08x;
void setup() {
Serial.begin(115200); // Initialize serial communication
while (!Serial) delay(10); // Wait for serial monitor to open
// Initialize the sensor
if (!bno08x.begin_I2C()) {
Serial.println("Failed to initialize BNO08x! Check connections.");
while (1);
}
Serial.println("BNO08x initialized successfully!");
// Configure the sensor to output rotation vector data
if (!bno08x.enableReport(SH2_ROTATION_VECTOR)) {
Serial.println("Failed to enable rotation vector report!");
while (1);
}
}
void loop() {
// Check if new data is available
if (bno08x.getSensorEvent(&sensorEvent)) {
// Extract quaternion data
float qw = sensorEvent.un.rotationVector.real;
float qx = sensorEvent.un.rotationVector.i;
float qy = sensorEvent.un.rotationVector.j;
float qz = sensorEvent.un.rotationVector.k;
// Print quaternion data to the serial monitor
Serial.print("Quaternion: ");
Serial.print("qw = "); Serial.print(qw, 4);
Serial.print(", qx = "); Serial.print(qx, 4);
Serial.print(", qy = "); Serial.print(qy, 4);
Serial.print(", qz = "); Serial.println(qz, 4);
}
delay(100); // Delay to limit output frequency
}
VIN voltage matches the module's operating range (3.3V - 5V).SDA and SCL lines if not already present.Sensor Not Detected:
0x4B).Incorrect or No Data Output:
Unstable Orientation Data:
Q: Can the GY-BNO08X be used with a 3.3V microcontroller?
A: Yes, the module supports both 3.3V and 5V logic levels, making it compatible with a wide range of microcontrollers.
Q: How do I switch to SPI or UART communication?
A: Use the PS0 and PS1 pins to configure the desired protocol. Refer to the module's datasheet for the specific pin configurations.
Q: Is the GY-BNO08X suitable for outdoor use?
A: While the sensor operates in a wide temperature range, it is not waterproof. Protect it from moisture and extreme environmental conditions.
By following this documentation, you can effectively integrate the GY-BNO08X IMU into your projects and achieve accurate motion tracking and orientation sensing.