BNO085 responds at I²C address 0x4A but initialization fails on Arduino UNO R4 WiFi


Hello,

I am trying to connect a BNO085 9-DoF IMU to an Arduino UNO R4 WiFi using a Qwiic cable.

The Arduino UNO R4 WiFi Qwiic connector uses the secondary I²C bus, so I am using Wire1. An I²C scanner successfully detects the sensor:

Scanning Wire1...
Found 0x4A

However, the Adafruit BNO08x library fails during initialization.

Code:

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

Adafruit_BNO08x bno08x(-1);
sh2_SensorValue_t sensorValue;

void setup() {
  Serial.begin(115200);
  delay(1000);

  Wire1.begin();
  Wire1.setClock(100000);
  delay(500);

  Serial.println("BNO085 connection attempt...");

  if (!bno08x.begin_I2C(0x4A, &Wire1)) {
    Serial.println("BNO085 initialization failed");
    while (1) delay(10);
  }

  Serial.println("BNO085 connected");
}

void loop() {
}

Serial output:

BNO085 connection attempt...
I2C address not found
BNO085 initialization failed

I have tested the following:

  • Arduino UNO R4 WiFi
  • Direct Qwiic connection without the MultiPort
  • Multiple Qwiic cables
  • Both Qwiic connectors on the BNO085
  • Full power cycling by disconnecting both USB-C and Qwiic cables
  • Wire1 instead of Wire
  • I²C addresses 0x4A and 0x4B

The sensor power LED is on, and the scanner consistently detects 0x4A, but begin_I2C() cannot complete initialization.

Does the BNO085 require the RST pin to be connected for reliable initialization? Is there another software reset or initialization sequence I should try? Could this be related to BNO085 I²C clock stretching or compatibility with the UNO R4 WiFi?

Check very carefully which I2C interface the Qwiic connector uses. What is its name and what voltage does it work at ?

Adafruit themselves list the BNO085 as one of their "troublesome I²C chips":

"BNO085 – Uses clock stretching, violates I2C protocol timing in some cases, and sometimes needs to be reset."

Therefore, an I²C scanner detecting address 0x4A does not necessarily mean that the higher-level SHTP initialization performed by begin_I2C() will succeed.

I tried a BNO085 without success. I had to go back to my BNO055, and even it has glitches, but it is recoverable. The 085 just quits responding.

Are you sure the library that you're using is compatible with R4?

You might try the Sparkfun BNO08X library.

the document Adafruit 9-DOF Orientation IMU Fusion Breakout - BNO085 states
The BNO08x I2C implementation violates the I2C protocol in some
circumstances. This causes it not to work well with certain chip families. It
does not work well with Espressif ESP32, ESP32-S3, and NXP i.MX RT1011, and
it does not work well with I2C multiplexers. Operation with SAMD51, RP2040,
STM32F4, and nRF52840 is more reliable.

I don't have a BN0085 sensor
however, to test the UNO R4 WiFi Qwiic I2C interface I used the following code

// UNO R4 WiFi GY-91 (9-axis MPU9250 + BMP280) sensor using  Qwiic connector 

// UNO R4 WiFi manual https://docs.arduino.cc/tutorials/uno-r4-wifi/cheat-sheet/?queryID=02def294265afed46fc5704f9d452a8e

// states "he Qwiic connector on the UNO R4 WiFi is connected to the secondary I2C bus (IIC0), which uses the Wire1 object rather than Wire"

// GY-91 (9-axis MPU9250 + BMP280)sensor
//   https://electropeak.com/learn/interfacing-gy-91-9-axis-mpu9250-bmp280-module-with-arduino/

// original code -  by MohammedDamirchi

#include <MPU9250_asukiaaa.h>
#include <Adafruit_BMP280.h>

Adafruit_BMP280 bme(&Wire1);  // I2C
MPU9250_asukiaaa mySensor;
float aX, aY, aZ, aSqrt, gX, gY, gZ, mDirection, mX, mY, mZ;

void setup() {
  Serial.begin(115200);
  while (!Serial)
    ;

#ifdef _ESP32_HAL_I2C_H_  // For ESP32
  Wire1.begin();          //(SDA_PIN, SCL_PIN);
  mySensor.setWire(&Wire1);
#else
  Wire1.begin();
  mySensor.setWire(&Wire1);
#endif

  bme.begin(0x76);
  mySensor.beginAccel();
  mySensor.beginGyro();
  mySensor.beginMag();

  // You can set your own offset for mag values
  // mySensor.magXOffset = -50;
  // mySensor.magYOffset = -55;
  // mySensor.magZOffset = -10;
}

void loop() {
  // read MPU9250 sensor
  if (mySensor.accelUpdate() == 0) {
    aX = mySensor.accelX();
    aY = mySensor.accelY();
    aZ = mySensor.accelZ();
    aSqrt = mySensor.accelSqrt();
    Serial.print("accelX: " + String(aX));
    Serial.print("\taccelY: " + String(aY));
    Serial.print("\taccelZ: " + String(aZ));
    Serial.print("\taccelSqrt: " + String(aSqrt));
  }
  if (mySensor.gyroUpdate() == 0) {
    gX = mySensor.gyroX();
    gY = mySensor.gyroY();
    gZ = mySensor.gyroZ();
    Serial.print("\tgyroX: " + String(gX));
    Serial.print("\tgyroY: " + String(gY));
    Serial.print("\tgyroZ: " + String(gZ));
  }
  if (mySensor.magUpdate() == 0) {
    mX = mySensor.magX();
    mY = mySensor.magY();
    mZ = mySensor.magZ();
    mDirection = mySensor.magHorizDirection();
    Serial.print("\tmagX: " + String(mX));
    Serial.print("\tmaxY: " + String(mY));
    Serial.print("\tmagZ: " + String(mZ));
    Serial.print("\thorizontalDirection: " + String(mDirection));
  }

  // read BMP280 sensor
  Serial.print("\tTemperature(*C): ");
  Serial.print(bme.readTemperature());
  Serial.print("\tPressure(Inches(Hg)): ");
  Serial.print(bme.readPressure() / 3377);
  Serial.print("\tApproxAltitude(m): ");
  Serial.print(bme.readAltitude(1013.25));  // this should be adjusted to your local forcase
  Serial.println("");  // Add an empty line
  delay(1000);
}

serial monitor output as the sensor is moved around

accelX: 0.14	accelY: -0.05	accelZ: -1.01	accelSqrt: 1.02	gyroX: 9.46	gyroY: -9.46	gyroZ: -58.96	Temperature(*C): 23.47	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.55
accelX: 0.35	accelY: -0.71	accelZ: -0.08	accelSqrt: 0.80	gyroX: -42.91	gyroY: -125.92	gyroZ: -7.32	Temperature(*C): 23.47	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.74
accelX: -0.25	accelY: -1.02	accelZ: 0.05	accelSqrt: 1.05	gyroX: -53.71	gyroY: -13.06	gyroZ: 21.06	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.71
accelX: -0.07	accelY: -0.06	accelZ: -0.55	accelSqrt: 0.56	gyroX: -58.96	gyroY: 104.68	gyroZ: 14.34	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.77
accelX: -0.32	accelY: -0.47	accelZ: -0.76	accelSqrt: 0.95	gyroX: -44.86	gyroY: -16.11	gyroZ: 25.76	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.68
accelX: 0.09	accelY: -1.06	accelZ: -0.34	accelSqrt: 1.12	gyroX: -79.59	gyroY: 30.33	gyroZ: 16.97	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.40
accelX: 0.39	accelY: -0.76	accelZ: 0.60	accelSqrt: 1.04	gyroX: 48.03	gyroY: -23.25	gyroZ: 84.05	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.29
accelX: 1.10	accelY: -0.20	accelZ: -0.26	accelSqrt: 1.15	gyroX: -32.96	gyroY: 108.64	gyroZ: 50.96	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.44
accelX: 0.98	accelY: 0.33	accelZ: -0.04	accelSqrt: 1.03	gyroX: 109.56	gyroY: -30.03	gyroZ: 57.62	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.52
accelX: 0.82	accelY: 0.65	accelZ: -0.02	accelSqrt: 1.05	gyroX: -57.74	gyroY: 8.91	gyroZ: -6.77	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.51
accelX: 0.42	accelY: -0.37	accelZ: -1.05	accelSqrt: 1.19	gyroX: -46.08	gyroY: -19.78	gyroZ: -88.32	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.59
accelX: 0.14	accelY: -1.08	accelZ: 0.96	accelSqrt: 1.45	gyroX: -197.75	gyroY: -91.55	gyroZ: 88.62	Temperature(*C): 23.45	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.64
accelX: -1.02	accelY: -0.28	accelZ: 0.58	accelSqrt: 1.21	gyroX: 173.40	gyroY: -284.30	gyroZ: -15.99	Temperature(*C): 23.45	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.57
accelX: -0.88	accelY: 0.01	accelZ: 0.03	accelSqrt: 0.88	gyroX: -3.91	gyroY: 2.62	gyroZ: -30.40	Temperature(*C): 23.45	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.50
accelX: -0.55	accelY: -0.48	accelZ: -0.82	accelSqrt: 1.10	gyroX: 57.07	gyroY: -174.87	gyroZ: -36.13	Temperature(*C): 23.45	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.44
accelX: 0.12	accelY: 0.10	accelZ: -1.04	accelSqrt: 1.06	gyroX: -3.66	gyroY: -16.36	gyroZ: -9.22	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.69
accelX: -0.25	accelY: -0.00	accelZ: -0.94	accelSqrt: 0.97	gyroX: 21.30	gyroY: -16.30	gyroZ: -35.64	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.55
accelX: 0.07	accelY: 0.04	accelZ: -0.99	accelSqrt: 0.99	gyroX: -7.93	gyroY: 0.67	gyroZ: 0.00	Temperature(*C): 23.46	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.52
accelX: -0.03	accelY: 0.02	accelZ: -1.01	accelSqrt: 1.01	gyroX: -2.38	gyroY: -11.47	gyroZ: -0.18	Temperature(*C): 23.47	Pressure(Inches(Hg)): 30.49	ApproxAltitude(m): -135.67

photo