ESP32 Feather V2 + BNO055 Stemma QT not working

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
wirelesswarrior
 
Posts: 2
Joined: Fri Jan 15, 2021 6:01 am

ESP32 Feather V2 + BNO055 Stemma QT not working

Post by wirelesswarrior »

Hi all.

I have a BNO055 connected with Stemma QT connector. I am able to detect the device on 0x29 when running a scan, however when I run a basic example it is not able to find the device. I get a NACK I2C error. I read some places that there may be some issues with time stretching, but if that is the case a warning about incompatibility would have been great.
I also have DRV2506 connected in the bus, but tried to remove this from the bus, same problem.

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by Franklin97355 »

Which basic code did you try?

User avatar
somethingz
 
Posts: 9
Joined: Fri Nov 04, 2022 9:38 am

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by somethingz »

Franklin97355 wrote: Sat Nov 05, 2022 7:12 pm Which basic code did you try?
Hi Franklin.

I ran the "read_all_data"

I2C scan:

Code: Select all

������������������������������������������������������������������������������������������[     4][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[   228][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[   249][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=22 scl=20 freq=100000
Scanning for I2C devices ...
I2C device found at address 0x29
I2C device found at address 0x5A
Error:

Code: Select all

������������������������������������������������������������������������������������������������������������������������������������[     4][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[   228][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Orientation Sensor Test

[   249][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=22 scl=20 freq=100000
Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
Code:

Code: Select all

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>

/* This driver uses the Adafruit unified sensor library (Adafruit_Sensor),
   which provides a common 'type' for sensor data and some helper functions.

   To use this driver you will also need to download the Adafruit_Sensor
   library and include it in your libraries folder.

   You should also assign a unique ID to this sensor for use with
   the Adafruit Sensor API so that you can identify this particular
   sensor in any data logs, etc.  To assign a unique ID, simply
   provide an appropriate value in the constructor below (12345
   is used by default in this example).

   Connections
   ===========
   Connect SCL to analog 5
   Connect SDA to analog 4
   Connect VDD to 3.3-5V DC
   Connect GROUND to common ground

   History
   =======
   2015/MAR/03  - First release (KTOWN)
*/

/* Set the delay between fresh samples */
uint16_t BNO055_SAMPLERATE_DELAY_MS = 100;

// Check I2C device address and correct line below (by default address is 0x29 or 0x28)
//                                   id, address
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x29);

void setup(void)
{
  Serial.begin(115200);
  Serial.println("Orientation Sensor Test"); Serial.println("");

  /* 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);
  }

  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);

  printEvent(&orientationData);
  printEvent(&angVelocityData);
  printEvent(&linearAccelData);
  printEvent(&magnetometerData);
  printEvent(&accelerometerData);
  printEvent(&gravityData);

  int8_t boardTemp = bno.getTemp();
  Serial.println();
  Serial.print(F("temperature: "));
  Serial.println(boardTemp);

  uint8_t system, gyro, accel, mag = 0;
  bno.getCalibration(&system, &gyro, &accel, &mag);
  Serial.println();
  Serial.print("Calibration: Sys=");
  Serial.print(system);
  Serial.print(" Gyro=");
  Serial.print(gyro);
  Serial.print(" Accel=");
  Serial.print(accel);
  Serial.print(" Mag=");
  Serial.println(mag);

  Serial.println("--");
  delay(BNO055_SAMPLERATE_DELAY_MS);
}

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);
}
Attachments
Skærmbillede 2022-11-07 kl. 14.10.52.png
Skærmbillede 2022-11-07 kl. 14.10.52.png (204.13 KiB) Viewed 321 times

User avatar
somethingz
 
Posts: 9
Joined: Fri Nov 04, 2022 9:38 am

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by somethingz »

Tried some other examples, I get the same error:

Code: Select all

[   249][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=22 scl=20 freq=100000
Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by adafruit2 »

please post photos of your setup and Tools menu also make sure you have all libraries and board support packages updated

User avatar
somethingz
 
Posts: 9
Joined: Fri Nov 04, 2022 9:38 am

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by somethingz »

I installed Arduino IDE 2.0.1 few days ago utilizing the latest version of the BNO055 library.
Attachments
Skærmbillede 2022-11-07 kl. 21.54.48.png
Skærmbillede 2022-11-07 kl. 21.54.48.png (443.34 KiB) Viewed 301 times
IMG_8566.jpeg
IMG_8566.jpeg (258.66 KiB) Viewed 301 times

User avatar
somethingz
 
Posts: 9
Joined: Fri Nov 04, 2022 9:38 am

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by somethingz »

And the tools menu
Attachments
Skærmbillede 2022-11-07 kl. 21.59.19.png
Skærmbillede 2022-11-07 kl. 21.59.19.png (88.63 KiB) Viewed 296 times

User avatar
gammaburst
 
Posts: 1013
Joined: Thu Dec 31, 2015 12:06 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by gammaburst »

Hi somethingz,
Not sure if this will help you ...
I don't have your exact same ESP32 V2 board, or your DRV2605L board.
Your code runs on my ESP32-S2 (FeatherS2) after I changed the I2C address from 0x29 to 0x28.
Does your BNO055 breakout have the jumper installed (bottom side) that makes it 0x29?

The project crashes rather easily though, just by touching the I2C signals with my finger, so I added an extra pullup resistor (2K to 3K ohms) from SDA to VIN to make it more stable.

User avatar
somethingz
 
Posts: 9
Joined: Fri Nov 04, 2022 9:38 am

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by somethingz »

gammaburst wrote: Tue Nov 08, 2022 7:09 pm Hi somethingz,
Not sure if this will help you ...
I don't have your exact same ESP32 V2 board, or your DRV2605L board.
Your code runs on my ESP32-S2 (FeatherS2) after I changed the I2C address from 0x29 to 0x28.
Does your BNO055 breakout have the jumper installed (bottom side) that makes it 0x29?

The project crashes rather easily though, just by touching the I2C signals with my finger, so I added an extra pullup resistor (2K to 3K ohms) from SDA to VIN to make it more stable.
Thank you for reaching out. I tried with 0x28 first, which I was able to scan, but not connect, so when this occurred, I soldered the bridge on the back, and was able to scan it on 0x29, but still not able to connect to that either. I have also tried to disconnect the DRV2605L board, but the result is the same. Unfortunately I do not have my oscilloscope around or any resistors at hand as I have just moved, but if this is a potential fix I will try to find some, however it kills a bit the plug-n-play thrills.

User avatar
gammaburst
 
Posts: 1013
Joined: Thu Dec 31, 2015 12:06 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by gammaburst »

The pullup resistor fix is worthwhile for improving I2C stability, however your project seems unusually dead. Here's a simple test to see if the resistor will help you: Connect a short bare wire to signal SCL, grab the bare wire with two fingers, and restart the project. (Your fingers add some capacitance that slows SCL's risetime.) If your fingers help the project run better, then the extra pullup resistor on SDA will probably help you (it speeds up SDA's risetime). If no luck, then something else is probably wrong.

User avatar
somethingz
 
Posts: 9
Joined: Fri Nov 04, 2022 9:38 am

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by somethingz »

gammaburst wrote: Wed Nov 09, 2022 4:32 pm The pullup resistor fix is worthwhile for improving I2C stability, however your project seems unusually dead. Here's a simple test to see if the resistor will help you: Connect a short bare wire to signal SCL, grab the bare wire with two fingers, and restart the project. (Your fingers add some capacitance that slows SCL's risetime.) If your fingers help the project run better, then the extra pullup resistor on SDA will probably help you (it speeds up SDA's risetime). If no luck, then something else is probably wrong.
I tried this trick however it made no difference. I am currently testing this with the DRV2605L disconnected as well, no difference.

I2C Scan is still positive:

Code: Select all

[     4][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[   228][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[   249][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: sda=22 scl=20 freq=100000
Scanning for I2C devices ...
I2C device found at address 0x29

User avatar
gammaburst
 
Posts: 1013
Joined: Thu Dec 31, 2015 12:06 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by gammaburst »

Ok, probably something else wrong.
I tried an Adafruit 3619 (a plain Feather ESP32 but no Stemma connector like your V2 version), and your code still runs fine for me, although the extra SDA pullup resistor improves stability. I just now updated all my Arduino IDE libraries and boards to current version, and is still works fine.

I can't think of anything else to try. Need Adafruit tech support.

Here's my output and a photo:

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13160
load:0x40080400,len:3036
entry 0x400805e4
Orientation Sensor Test

Orient:  x= 357.87 |       y= -0.44 |        z= -7.69
Gyro:    x= -1.55 |        y= -0.26 |        z= -0.23
Linear:  x= -0.97 |        y= 0.58 |         z= 0.53
Mag:     x= 4.56 |         y= 11.56 |        z= -27.50
Accl:    x= -1.03 |        y= 1.75 |         z= 10.27
Gravity: x= -0.06 |        y= 1.16 |         z= 9.73

temperature: 31

Calibration: Sys=0 Gyro=0 Accel=0 Mag=0
--
Orient:  x= 358.62 |       y= -0.06 |        z= 0.00
Gyro:    x= -0.16 |        y= 0.18 |         z= -0.08
Linear:  x= -0.72 |        y= -1.51 |        z= 0.74
Mag:     x= 4.69 |         y= 17.56 |        z= -23.19
Accl:    x= -0.76 |        y= -1.53 |        z= 10.55
Gravity: x= -0.03 |        y= -0.01 |        z= 9.80

temperature: 31

Calibration: Sys=0 Gyro=0 Accel=0 Mag=0
--
Orient:  x= 357.37 |       y= 3.12 |         z= 0.37
Gyro:    x= 0.43 |         y= -0.75 |        z= 0.31
Linear:  x= -0.56 |        y= -1.47 |        z= -1.17
Mag:     x= 5.00 |         y= 18.25 |        z= -22.69
Accl:    x= -0.02 |        y= -1.53 |        z= 8.61
Gravity: x= 0.54 |         y= -0.06 |        z= 9.79

temperature: 31

Calibration: Sys=0 Gyro=0 Accel=0 Mag=0
--
Adafruit 3619 (ESP32 Feather) and BNO055
Adafruit 3619 (ESP32 Feather) and BNO055
IMG_2709a.jpg (199.35 KiB) Viewed 198 times

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by adafruit2 »

we think we fixed it in this PR/branch, can either of you test it? https://github.com/adafruit/Adafruit_BNO055/pull/117

User avatar
gammaburst
 
Posts: 1013
Joined: Thu Dec 31, 2015 12:06 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by gammaburst »

Hi adafruit2, If "either of you" includes me, I have not yet observed the malfunction. However, I should receive an Adafruit 5400 on Friday, so maybe then I can reproduce the problem.

I don't know how to use github 117. I looked for a ZIP file containing the modified library, or a group of modified files that I could drop into my Adafruit_BNO055 library folder.

I see a suspicious code comment in the 117 "Files changed" tab: "can take 500 ms to boot!" If that's referring to the BNO055's boot time after reset, then 500 ms is too short. Search the BNO055 datasheet for "POR time" and it says typically 650 ms from reset to config mode. The datasheet unfortunately doesn't tell the maximum time, but hey it's Bosch. In my projects I've been allowing 800 ms.

User avatar
gammaburst
 
Posts: 1013
Joined: Thu Dec 31, 2015 12:06 pm

Re: ESP32 Feather V2 + BNO055 Stemma QT not working

Post by gammaburst »

I received the Adafruit 5400, ESP32 Feather V2.
I now see the malfunction: "Ooops, no BNO055 detected ..."

In somethingz's "setup()" function, I added line "delay(800);" just before line "if (!bno.begin())".
No more malfunction. Project now runs fine for me.

I also removed the (unnecessary?) line "delay(1000);"

I have not attempted to figure out the github 117 info.

In my various projects, here's my BNO055 startup procedure (described in words rather than code):
viewtopic.php?f=25&t=108290&p=541754#p541754

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”