Problem with DFRobot BNO055 + BMP280 and ESP32

userHead silvia.verch 2019-05-17 15:24:02 5734 Views3 Replies
I have a problem with modul Gravity BNO055 + BMP280.
The data of BNO055 will not be read.
1. My Hardware
- ESP32 DevkitC from AZ-Delivery
- Gravity BNO055+BMP280 intelligent 10D OF AHRS SKU SEN0253 from DFRobot

2. IDE and Libraries
IDE : Arduino V1.8.9
Modul : Gravity BNO055+BMP280 intelligent 10D OF AHRS SKU SEN0253
Libraries : Original from DFRobot wiki page BNO055 Library and BMP280 Library

3. Test I2C Interface
For the test of the I2C interfaces I use the sketch “I2CScanner”.
And the scan result shows this picture.
It is all ok. In channel 2 the I2C address 76 = BMP280 and address 28= BNO055.
See the pictures below!

4. Test BMP280 Sensor
For the test I use the example "read_data" from the DFRobot_BMP280-master.
You can see, it works fine.
First the I2C Scan Interface one and two und than read the data from BMP280.
See the pictures below!

5. Test BNO055 from “DFRobot_BNO055-master” -> examples -> readData

And now my problem. The module BNO055 is not recognized. Why is that?
The Arduino project file : ESP32 Projekt.zip
The zip file contains all three Arduino projects
I2C scanner, BMP280 and BNO055.
See Attachment!
2024-05-14 19:23:23

I have the same problem, have you found a solution?

userHeadPic clasher
2019-05-17 17:41:20 ESP32 project BNO055.ino
This sketch does not work.
The Scanresult shows I2C addresses 28 and 76.

Serial Port send the message
"bno begin faild"
"device not detected"


/*
example - Simultaneously use the two I2C bus of the ESP32
https://github.com/espressif/arduino-esp32/issues/977

*/

//1. Load the Headerfiles
#include <Wire.h>
#include <dummy.h> //for esp32
#include "DFRobot_BNO055.h"


//2. Define address pins I2C
#define SDA1 21
#define SCL1 22

#define SDA2 5
#define SCL2 4



//3. Create I2C objects
TwoWire I2Cone = TwoWire(0);
TwoWire I2Ctwo = TwoWire(1);


//4. BNO055
typedef DFRobot_BNO055_IIC BNO; // ******** use abbreviations instead of full names ********
BNO bno(&I2Ctwo, 0x28); // input TwoWire interface and IIC address
// show last sensor operate status
void printLastOperateStatus(BNO::eStatus_t eStatus)
{
switch (eStatus) {
case BNO::eStatusOK: Serial.println("everything ok"); break;
case BNO::eStatusErr: Serial.println("unknow error"); break;
case BNO::eStatusErrDeviceNotDetect: Serial.println("device not detected"); break;
case BNO::eStatusErrDeviceReadyTimeOut: Serial.println("device ready time out"); break;
case BNO::eStatusErrDeviceStatus: Serial.println("device internal status error"); break;
default: Serial.println("unknow status"); break;
}
}





void setup() {
//1. Start Serial communication
Serial.begin(115200); //Start Serial Interface
//2. Start I2C Interfaces
I2Cone.begin(SDA1, SCL1, 400000); // SDA pin 21, SCL pin 22 TTGO TQ
I2Ctwo.begin(SDA2, SCL2, 400000); // SDA pin 5, SCL pin 4 builtin OLED

//3. Scan I2C Interface one
scan1();
Serial.println();
delay(100);
//4. Scan I2C Interface two
scan2();
Serial.println();

//4. BNO055
bno.reset();
while (bno.begin() != BNO::eStatusOK) {
Serial.println("bno begin faild");
printLastOperateStatus(bno.lastOperateStatus);
delay(2000);
}
Serial.println("bno begin success");

}

loop{
;
}
userHeadPic silvia.verch
2019-05-17 17:26:48 ESP32 Arduino Projekt BMP280.ino
This code works fine!

/*
example - Simultaneously use the two I2C bus of the ESP32
https://github.com/espressif/arduino-esp32/issues/977

*/

//1. Load the Headerfiles
#include <Wire.h>
#include <dummy.h> //for esp32
#include "DFRobot_BMP280.h"


//2. Define address pins I2C
#define SDA1 21
#define SCL1 22

#define SDA2 5
#define SCL2 4



//3. Create I2C objects
TwoWire I2Cone = TwoWire(0);
TwoWire I2Ctwo = TwoWire(1);


//4. BMP280
typedef DFRobot_BMP280_IIC BMP; // ******** use abbreviations instead of full names ********
BMP bmp(&I2Ctwo, BMP::eSdo_low);
#define SEA_LEVEL_PRESSURE 1015.0f // sea level pressure
// show last sensor operate status
void printLastOperateStatus(BMP::eStatus_t eStatus)
{
switch (eStatus) {
case BMP::eStatusOK: Serial.println("everything ok"); break;
case BMP::eStatusErr: Serial.println("unknow error"); break;
case BMP::eStatusErrDeviceNotDetected: Serial.println("device not detected"); break;
case BMP::eStatusErrParameter: Serial.println("parameter error"); break;
default: Serial.println("unknow status"); break;
}
}


void setup() {
//1. Start Serial communication
Serial.begin(115200); //Start Serial Interface
//2. Start I2C Interfaces
I2Cone.begin(SDA1, SCL1, 400000); // SDA pin 21, SCL pin 22 TTGO TQ
I2Ctwo.begin(SDA2, SCL2, 400000); // SDA pin 5, SCL pin 4 builtin OLED

//3. Scan I2C Interface one
scan1();
Serial.println();
delay(100);
//4. Scan I2C Interface two
scan2();
Serial.println();

//4. BMP280
bmp.reset();
Serial.println("bmp read data test");
while (bmp.begin() != BMP::eStatusOK) {
Serial.println("bmp begin faild");
printLastOperateStatus(bmp.lastOperateStatus);
delay(2000);
}
Serial.println("bmp begin success");

}

void loop()
{
float temp = bmp.getTemperature();
uint32_t press = bmp.getPressure();
float alti = bmp.calAltitude(SEA_LEVEL_PRESSURE, press);

Serial.println();
Serial.println("======== start print ========");
Serial.print("temperature (unit Celsius): "); Serial.println(temp);
Serial.print("pressure (unit pa): "); Serial.println(press);
Serial.print("altitude (unit meter): "); Serial.println(alti);
Serial.println("======== end print ========");

delay(1000);
}

/*
example - Simultaneously use the two I2C bus of the ESP32
https://github.com/espressif/arduino-esp32/issues/977

*/

//1. Load the Headerfiles
#include <Wire.h>
#include <dummy.h> //for esp32
#include "DFRobot_BMP280.h"


//2. Define address pins I2C
#define SDA1 21
#define SCL1 22

#define SDA2 5
#define SCL2 4



//3. Create I2C objects
TwoWire I2Cone = TwoWire(0);
TwoWire I2Ctwo = TwoWire(1);


//4. BMP280
typedef DFRobot_BMP280_IIC BMP; // ******** use abbreviations instead of full names ********
BMP bmp(&I2Ctwo, BMP::eSdo_low);
#define SEA_LEVEL_PRESSURE 1015.0f // sea level pressure
// show last sensor operate status
void printLastOperateStatus(BMP::eStatus_t eStatus)
{
switch (eStatus) {
case BMP::eStatusOK: Serial.println("everything ok"); break;
case BMP::eStatusErr: Serial.println("unknow error"); break;
case BMP::eStatusErrDeviceNotDetected: Serial.println("device not detected"); break;
case BMP::eStatusErrParameter: Serial.println("parameter error"); break;
default: Serial.println("unknow status"); break;
}
}


void setup() {
//1. Start Serial communication
Serial.begin(115200); //Start Serial Interface
//2. Start I2C Interfaces
I2Cone.begin(SDA1, SCL1, 400000); // SDA pin 21, SCL pin 22 TTGO TQ
I2Ctwo.begin(SDA2, SCL2, 400000); // SDA pin 5, SCL pin 4 builtin OLED

//3. Scan I2C Interface one
scan1();
Serial.println();
delay(100);
//4. Scan I2C Interface two
scan2();
Serial.println();

//4. BMP280
bmp.reset();
Serial.println("bmp read data test");
while (bmp.begin() != BMP::eStatusOK) {
Serial.println("bmp begin faild");
printLastOperateStatus(bmp.lastOperateStatus);
delay(2000);
}
Serial.println("bmp begin success");

}

void loop()
{
float temp = bmp.getTemperature();
uint32_t press = bmp.getPressure();
float alti = bmp.calAltitude(SEA_LEVEL_PRESSURE, press);

Serial.println();
Serial.println("======== start print ========");
Serial.print("temperature (unit Celsius): "); Serial.println(temp);
Serial.print("pressure (unit pa): "); Serial.println(press);
Serial.print("altitude (unit meter): "); Serial.println(alti);
Serial.println("======== end print ========");

delay(1000);
}
userHeadPic silvia.verch