Using the BNO055 + BMP280 BFF with Arduino involves involves plugging the breakout into your Arduino-compatible QT Py or Xiao form factor board, installing the Adafruit_BNO055 and Adafruit_BMP280 libraries, and running the provided example code.
If you are using an Espressif board (ESP32/S2/S3) make sure you are using board support package 3.0.0 or newer to avoid issues with I2C clock-stretching.
The BNO055 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 I2C multiplexers or Espressif chips with older board support packages. Operation with SAMD51, RP2040, STM32F4, nRF52840 and Espressif with BSP 3.0.0 or newer are more reliable.
Wiring
Plug a BNO055 + BMP280 BFF into your QT Py or Xiao form factor board exactly as shown below. Here's an example of connecting a QT Py RP2040 to the BFF.
Connect the QT Py RP2040 with plug headers into the BNO055 + BMP280 BFF with socket headers. They should be plugged in with the backs of the boards facing each other.
For more information on soldering socket headers, check out this Learn Guide.
Library Installation
You can install the Adafruit BNO055 and Adafruit BMP280 libraries for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit BMP280 and select the Adafruit BMP280 library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!
Then, search for Adafruit BNO055 and select the Adafruit BNO055 library:
The BNO055 library has the same library dependencies as the BMP280.
// SPDX-FileCopyrightText: 2024 Liz Clark for Adafruit Industries // // SPDX-License-Identifier: MIT // BNO055 + BMP280 BFF Demo #include <Wire.h> #include <Adafruit_Sensor.h> #include <Adafruit_BMP280.h> #include <Adafruit_BNO055.h> #include <utility/imumaths.h> Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28, &Wire); Adafruit_BMP280 bmp; void setup(void) { Serial.begin(115200); while (!Serial) delay(10); // wait for serial port to open! Serial.println("Adafruit BNO055 + BMP280 BFF Demo"); /* Initialise the sensor */ if (!bno.begin()) { /* There was a problem detecting the BNO055 ... check your connections */ Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!"); while (1); } if (!bmp.begin()) { Serial.print("Ooops, no BMP280 detected ... Check your wiring or I2C ADDR!"); while (1); } bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */ Adafruit_BMP280::SAMPLING_X2, /* Temp. oversampling */ Adafruit_BMP280::SAMPLING_X16, /* Pressure oversampling */ Adafruit_BMP280::FILTER_X16, /* Filtering. */ Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */ Serial.println("Found BNO055 and BMP280 sensors!"); Serial.println(); delay(1000); } void loop(void) { //could add VECTOR_ACCELEROMETER, VECTOR_MAGNETOMETER,VECTOR_GRAVITY... sensors_event_t orientationData , angVelocityData , linearAccelData, magnetometerData, accelerometerData, gravityData; bno.getEvent(&orientationData, Adafruit_BNO055::VECTOR_EULER); bno.getEvent(&angVelocityData, Adafruit_BNO055::VECTOR_GYROSCOPE); bno.getEvent(&linearAccelData, Adafruit_BNO055::VECTOR_LINEARACCEL); bno.getEvent(&magnetometerData, Adafruit_BNO055::VECTOR_MAGNETOMETER); bno.getEvent(&accelerometerData, Adafruit_BNO055::VECTOR_ACCELEROMETER); bno.getEvent(&gravityData, Adafruit_BNO055::VECTOR_GRAVITY); Serial.println("BNO055 data:"); printEvent(&orientationData); printEvent(&angVelocityData); printEvent(&linearAccelData); printEvent(&magnetometerData); printEvent(&accelerometerData); printEvent(&gravityData); Serial.println("--"); Serial.println("BMP280 data:"); Serial.print(F("Temperature = ")); Serial.print(bmp.readTemperature()); Serial.println(" *C"); Serial.print(F("Pressure = ")); Serial.print(bmp.readPressure()); Serial.println(" Pa"); Serial.print(F("Approx altitude = ")); Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */ Serial.println(" m"); Serial.println(); delay(2000); } void printEvent(sensors_event_t* event) { double x = -1000000, y = -1000000 , z = -1000000; //dumb values, easy to spot problem if (event->type == SENSOR_TYPE_ACCELEROMETER) { Serial.print("Accl:"); x = event->acceleration.x; y = event->acceleration.y; z = event->acceleration.z; } else if (event->type == SENSOR_TYPE_ORIENTATION) { Serial.print("Orient:"); x = event->orientation.x; y = event->orientation.y; z = event->orientation.z; } else if (event->type == SENSOR_TYPE_MAGNETIC_FIELD) { Serial.print("Mag:"); x = event->magnetic.x; y = event->magnetic.y; z = event->magnetic.z; } else if (event->type == SENSOR_TYPE_GYROSCOPE) { Serial.print("Gyro:"); x = event->gyro.x; y = event->gyro.y; z = event->gyro.z; } else if (event->type == SENSOR_TYPE_ROTATION_VECTOR) { Serial.print("Rot:"); x = event->gyro.x; y = event->gyro.y; z = event->gyro.z; } else if (event->type == SENSOR_TYPE_LINEAR_ACCELERATION) { Serial.print("Linear:"); x = event->acceleration.x; y = event->acceleration.y; z = event->acceleration.z; } else if (event->type == SENSOR_TYPE_GRAVITY) { Serial.print("Gravity:"); x = event->acceleration.x; y = event->acceleration.y; z = event->acceleration.z; } else { Serial.print("Unk:"); } Serial.print("\tx= "); Serial.print(x); Serial.print(" |\ty= "); Serial.print(y); Serial.print(" |\tz= "); Serial.println(z); }
Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You'll see the BNO055 and BMP280 sensors recognized over I2C. Then, you'll see sensor data from the BNO055 and the BMP280 print out to the Serial Monitor.
Page last edited January 22, 2025
Text editor powered by tinymce.