ESP32 WROOM-32 + BNO08x IMU (GY-BNO080) Fails to Return Readings — I²C Setup Help Needed

Hello everyone,

I’m working on a VR project and need help getting sensor data from the BNO08x using an ESP32 Dev Board over I²C.

:wrench: Hardware I’m Using:

  1. BNO08x IMU (GY-BNO080/BNO085 breakout)

    :link: Amazon Link
    9DOF AHRS sensor, supports quaternion output and sensor fusion.

  2. ESP32 WROOM-32 Dev Board by OceanLabz

    :link: Amazon Link
    Dual-core WiFi + Bluetooth module, USB-C with CP2102 chip.


:puzzle_piece: Goal:

Read accurate Yaw / Pitch / Roll (orientation) data from the BNO08x via I²C using the Adafruit BNO08x library.


:electric_plug: Wiring Connections (I²C Mode)

BNO08x Pin ESP32 Pin Purpose
VIN / VCC 3.3V
GND GND
SDA GPIO 21
SCL GPIO 22
PS0 GND
PS1 GND
ADO Not connected
INT Not connected
RST Not connected
CS Not connected

:books: Libraries Used

  • Adafruit BNO08x Library (installed via Library Manager)
  • Wire.h (default I²C library)
  • Board: ESP32 Dev Module (from Espressif)

:white_check_mark: Step 1: I²C Scanner Test

To confirm the I²C address, I used the standard scanner:

#include <Wire.h>
#define SDA_PIN 21
#define SCL_PIN 22

void setup() {
  Serial.begin(115200);
  Wire.begin(SDA_PIN, SCL_PIN);
  Serial.println("I2C Scanner Running...");

  for (byte addr = 1; addr < 127; addr++) {
    Wire.beginTransmission(addr);
    if (Wire.endTransmission() == 0) {
      Serial.print("I2C device found at 0x");
      Serial.println(addr, HEX);
    }
  }
}
void loop() {}

:check_mark: Output:

I2C device found at 0x4B

So the sensor is connected properly and acknowledged by the ESP32.


:test_tube: Step 2: Reading Sensor Data (Code Below)

Then, I tried using the Adafruit BNO08x example for rotation vector output (modified for my pins and I²C address):

#include <Wire.h>
#include <Adafruit_BNO08x.h>

#define SDA_PIN 21
#define SCL_PIN 22

Adafruit_BNO08x bno08x;
sh2_SensorValue_t sensorValue;

struct euler_t { float yaw, pitch, roll; } ypr;
sh2_SensorId_t reportType = SH2_ARVR_STABILIZED_RV;
long reportIntervalUs = 5000;

void setReports() {
  if (!bno08x.enableReport(reportType, reportIntervalUs)) {
    Serial.println("❌ Could not enable report");
  }
}

void quaternionToEuler(float qr, float qi, float qj, float qk, euler_t* ypr) {
  float sqr = qr*qr, sqi = qi*qi, sqj = qj*qj, sqk = qk*qk;
  ypr->yaw = atan2(2*(qi*qj + qk*qr), (sqi - sqj - sqk + sqr)) * RAD_TO_DEG;
  ypr->pitch = asin(-2*(qi*qk - qj*qr) / (sqi + sqj + sqk + sqr)) * RAD_TO_DEG;
  ypr->roll = atan2(2*(qj*qk + qi*qr), (-sqi - sqj + sqk + sqr)) * RAD_TO_DEG;
}

void setup() {
  Serial.begin(115200);
  Wire.begin(SDA_PIN, SCL_PIN);
  Wire.setClock(100000);

  Serial.println("BNO08x I2C Test");
  if (!bno08x.begin_I2C(0x4B, &Wire)) {
    Serial.println("❌ BNO08x not found at 0x4B");
    while (1);
  }

  Serial.println("✅ BNO08x Found!");
  setReports();
}

void loop() {
  if (bno08x.wasReset()) {
    setReports();
  }

  if (bno08x.getSensorEvent(&sensorValue)) {
    if (sensorValue.sensorId == SH2_ARVR_STABILIZED_RV) {
      quaternionToEuler(sensorValue.un.arvrStabilizedRV.real,
                        sensorValue.un.arvrStabilizedRV.i,
                        sensorValue.un.arvrStabilizedRV.j,
                        sensorValue.un.arvrStabilizedRV.k,
                        &ypr);

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

:cross_mark: Output

Despite successful I²C detection at 0x4B, the output is fails with this error:

❌ BNO08x not found at 0x4B

:red_question_mark: What I Need Help With

  • Is the connection wrong ?
  • Is the hardware wrong ?
  • Or anything else ?

:magnifying_glass_tilted_right: Related Posts

I found similar issues by other users like:

  • Anis – "Sensor not detected"
  • Shivpat – QuaternionYawPitchRoll issues

Unfortunately, those threads don’t explain how the issue was eventually resolved.


I’ll be uploading photos of my hardware setup shortly in case it helps spot wiring issues.

You could try if you have better luck with sparkfun library examples.

Try address 0x4A instead.

1 Like

I just checked an example from Adafruit and it has

#define BNO08x_I2CADDR_DEFAULT 0x4A ///< The default I2C address

Since the sensor at the link showed a separate PCB and header, and because so many people fail to do this, I have to ask: is that header soldered to the sensor PCB?

is this in the .h library where should i change because if you were asking to change in code that i did and it is showing the same error

yes i have soldered the header to the pcb

It is in the sample code in the .ino file. I think you have 0x4B, it should be 0x4A. Just do a global search if you don't see it near the top of the file.

hii , i have tried it using 0x4A in the sketch as well it didn't worked accordingly though

Is your issue "module not detected?"

yess i am thinking it because of hardware issue so is the reason asking suggestions on which to buy

Hi all,
I’m building a wearable, real-time head-tracking system for FPV drone teleoperation, where head orientation directly controls the drone’s yaw/pitch/roll (see project details below). My main sensor is the BNO08x (planning to get the official Adafruit breakout), and the MCU should stream fused orientation (quaternions/Euler angles) to a host system at high rate (~400Hz), ideally with minimal latency and no missed frames.

Project Phases:

  1. Phase 1: Get fused orientation (yaw/pitch/roll) via BNO08x and stream over USB (no drone yet).
  2. Phase 2: Add wireless (Wi-Fi/BLE) and radio protocol for actual drone control (MAVLink, etc).
  3. Phase 3: Integrate with FPV goggles, full wearable build.

My Hardware Experience So Far:

  • Sensor: Currently using a Teyleten GY-BNO085 (BNO080/BNO085 breakout).
  • MCU: OceanLabz ESP32-WROOM-32 (CP2102 USB).
  • Issues:
    • Inconsistent I²C/SPI behavior on ESP32 (sometimes not detected, or random errors)
    • Arduino blog and forum posts mention ESP32’s I²C/SPI peripherals can be quirky with advanced sensors, especially for high-frequency reads or tight timing.
    • I want reliable, low-latency, high-rate sensor fusion—so I’m considering switching to an Adafruit Metro M4 Express or Feather M4 (SAMD51), since Adafruit’s guides/tested code target those boards.

Questions:

  • Has anyone run the Adafruit BNO08x library (in I²C or SPI mode) at 400Hz on Metro M4 Express / Feather M4? Any issues?
  • Are there noticeably fewer bugs and more robust performance on these boards compared to ESP32 for sensor fusion tasks?
  • Would you recommend M4 Express or Feather M4 (SAMD51) as a “known good” board for this kind of real-time sensor work, especially for SPI/I²C?
  • Any caveats when using Adafruit BNO08x with these M4 boards at high data rates?

Any tips or experience appreciated!

I have merged your forum topics due to them having too much overlap on the same subject matter @ruykendoo01.

In the future, please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.

The reason is that generating multiple forum topics on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Thanks in advance for your cooperation.