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?
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.
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