0

BNO055s not working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BNO055s not working

by jbroesch on Tue May 30, 2017 8:04 pm

I have two BNO055 boards. Both were DOA. I have tried each of them with several different Arduinos and no combination works. I am Professional Engineer (as in, I have my P.E. license) and I have done all the usual idiot checks. The boards are just not working. As per several recent post, it appears that there are a number of failures in the recent builds of these boards. I bought them through Amazon so I am returning them via that channel. My intent was to put together an navigation system using the Feather M0 proto and the feather GPS. Both of those units are working with no problem. So it is quite disappointing that the key element, the IMU, fails. Please let me know if you get a batch of these boards in that have actually been tested; I will reorder them and hopefully my time and effort to this point won't be a total waste. BTW, I tried adding 1K pullups on the IIC lines as per the TI app note. However, that did not help.
Attachments
IMG_20170530_161831336.jpg
IMG_20170530_161831336.jpg (83.45 KiB) Viewed 1019 times
IMG_20170530_161617601_HDR (1).jpg
IMG_20170530_161617601_HDR (1).jpg (205.13 KiB) Viewed 1019 times

jbroesch
 
Posts: 5
Joined: Tue May 30, 2017 6:44 pm

Re: BNO055s not working

by gammaburst on Wed May 31, 2017 12:33 am

The black wire appears to be connected to 3vo instead of GND.

gammaburst
 
Posts: 432
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO055s not working

by jbroesch on Wed May 31, 2017 11:32 am

Thanks for the fast feedback. Unfortunately, that is not the problem. I double checked that the wiring is correct but I am still getting the "Orientation Sensor Test

Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!" error. Just to cover all the bases, I did change the address and that does not help.

jbroesch
 
Posts: 5
Joined: Tue May 30, 2017 6:44 pm

Re: BNO055s not working

by gammaburst on Wed May 31, 2017 1:09 pm

Try measuring the +5V current into Vin. My units draw about 9.2 mA after power-up (config mode), increasing to 12.5 mA when running NDOF fusion mode. Also try measuring voltage 3vo to GND - should be 3.3V.

I'm not Adafruit, just a customer.

gammaburst
 
Posts: 432
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO055s not working

by jbroesch on Wed May 31, 2017 2:56 pm

Hi Gamaburst; yes, from your handle I assumed you were a fellow customer. Which makes me appreciate the help all the more. The 3.3V line is spot on and the current draw is just a hair under 9mA. So, both of those look good. Take care.

jbroesch
 
Posts: 5
Joined: Tue May 30, 2017 6:44 pm

Re: BNO055s not working

by gammaburst on Thu Jun 01, 2017 10:15 am

Another hunch - try installing a 1K pullup on SDA, but not on SCL.

gammaburst
 
Posts: 432
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO055s not working

by jbroesch on Thu Jun 01, 2017 3:12 pm

I gave it a shot but no luck. From my own experience, and the other posts, there is clearly a bad batch of Adafruit boards out there. I have ordered a different BNO055 board (the one from Atmel) and hopefully that will work. These two are going back to Amazon this afternoon. At any rate, thanks for the help and take care!

jbroesch
 
Posts: 5
Joined: Tue May 30, 2017 6:44 pm

Re: BNO055s not working

by gregfinger on Fri Jun 09, 2017 10:11 pm

i'm getting the same error. i've successfully used this specific bno055 in the past, so i was thinking maybe somehow my module broke at some point, so i ordered a new one (this time it was a CJMCU-055, since i'm in China) and got the same errors. When I ran an I2C scanner overnight (the one from here: https://playground.arduino.cc/Main/I2cScanner) i got this output
Code: Select all | TOGGLE FULL SIZE
Scanning...
I2C device found at address 0x28  !
done

Scanning...
No I2C devices found

Scanning...
I2C device found at address 0x28  !
done

Scanning...
No I2C devices found

Scanning...
No I2C devices found

Scanning...
No I2C devices found


But most time it just hangs on "Scanning...". When it hangs on scanning and i reupload one of the adafruit bno055 example sketches, it will hang on"Orientation Sensor Raw Data Test" and never tell me about no bno055 being detected. but if i unplug + plug the usb cable again and monitor the serial output, it will give me the original error. I posted about this in the Arduino forums, so you can check out the process I've already done there: https://forum.arduino.cc/index.php?topic=452569.0

not sure how to proceed or what i'm doing wrong.

gregfinger
 
Posts: 11
Joined: Fri Jun 09, 2017 10:04 pm

Re: BNO055s not working

by gammaburst on Sat Jun 10, 2017 12:35 am

Do you recall if anything changed since the last time it worked, such as a different Arduino board, new version Arduino software, new version example sketch, new version Adafrut libraries, etc?

I'm unfamiliar with the I2C scanner, but it sounds like your I2C communication may be erratic. Try touching the SDA and SCL wires, one at a time, with your finger to see if that affects the symptoms, such as speeding-up or slowing-down the error messages.

Maybe try my experimental bit-banged I2C version of the bunny sketch. It uses no special libraries. Notice my pin numbers in the first dozen lines of code. Also, my XYZ axes may be flipped/reversed from the original bunny sketch:

Code: Select all | TOGGLE FULL SIZE
// BNO055 running on Arduino Uno using crude bit-banged I2C.
//
// Connect Adafruit BNO055 breakout to Arduino Uno pins:
//   BNO055 Vin - Arduino Uno 5V
//   BNO055 GND - Arduino Uno GND
//   BNO055 RST - Arduino Uno A3
//   BNO055 SDA - Arduino Uno A4 and optional 2.2K pullup
//   BNO055 SCL - Arduino Uno A5 and optional 4.7K pullup

#define bbRST A3    // bit-banged Arduino Uno pins
#define bbSDA A4
#define bbSCL A5

#define BNO_ADDR 0x28       // BNO I2C address
#define BNO_PERIOD 10       // BNO read interval, milliseconds

#define LO_SDA() do { nsdelay(2500/3); digitalWrite(bbSDA,LOW);  pinMode(bbSDA,OUTPUT); } while (0)  // set SDA low
#define HI_SDA() do { nsdelay(2500/3); pinMode(bbSDA,INPUT);  digitalWrite(bbSDA,HIGH); } while (0)  // set SDA high
#define LO_SCL() do { nsdelay(2500/3); digitalWrite(bbSCL,LOW);  pinMode(bbSCL,OUTPUT); } while (0)  // set SCL low
#define HI_SCL() do { nsdelay(2500/3); pinMode(bbSCL,INPUT);  digitalWrite(bbSCL,HIGH); while (!RD_SCL()); } while (0)  // set SCL high, wait for clock stretching
#define RD_SDA() digitalRead(bbSDA)   // read SDA
#define RD_SCL() digitalRead(bbSCL)   // read SCL
#define LO_RST() do { pinMode(bbRST,OUTPUT);  digitalWrite(bbRST,LOW);  } while (0)
#define HI_RST() do { pinMode(bbRST,OUTPUT);  digitalWrite(bbRST,HIGH); } while (0)

// Some BNO055 Registers Page 0
#define PAGE_ID_0         (0x00+0x07)  // 0x00 Page ID
#define ACC_DATA_X_LSB    (0x00+0x08)  // Acceleration Data X LSB
#define EUL_HEADING_LSB   (0x00+0x1A)  // Euler heading LSB
#define QUA_DATA_W_LSB    (0x00+0x20)  // Quaternion Data W LSB
#define CALIB_STAT        (0x00+0x35)  // SYS Calib Status <7:6>, GYR Calib Status <5:4>, ACC Calib Status <3:2>, MAG Calib Status <1:0>
#define OPR_MODE          (0x00+0x3D)  // 0x1C Operation Mode <3:0>

#define nsdelay(ns) delayMicroseconds((ns) >> 10)

char i2c_repeated_start;

static void start_cond(void)
{
  if (i2c_repeated_start)           // if need to repeat start condition
  {
    HI_SDA();
    HI_SCL();
  }
  LO_SDA();
  LO_SCL();
  i2c_repeated_start = 1;
}

static void write_bit(unsigned char bit)
{
  if (bit)
    HI_SDA();
  else
    LO_SDA();
  HI_SCL();
  LO_SCL();
}

static unsigned char read_bit(void)
{
  unsigned char bit;

  HI_SDA();
  HI_SCL();
  bit = RD_SDA();
  LO_SCL();
  return bit;
}

static void stop_cond(void)
{
  LO_SDA();
  HI_SCL();
  HI_SDA();
  i2c_repeated_start = 0;
}

#define NAK   1
#define START 2
#define STOP  4

static unsigned char i2c_send(unsigned char flags, unsigned char byte)  // allowable flags: START STOP
{
  unsigned char bit;
  unsigned char nak;

  if (flags & START)
    start_cond();
  for (bit=0; bit<8; bit++)
  {
    write_bit(byte & 0x80);
    byte <<= 1;
  }
  nak = read_bit();
  if (flags & STOP)
    stop_cond();
  return nak;
}

static unsigned char i2c_recv(unsigned char flags)  // allowable flags: NAK STOP
{
  unsigned char byte = 0;
  unsigned char bit;

  for (bit=0; bit<8; bit++)
    byte = (byte << 1) | read_bit();
  write_bit(flags & NAK);
  if (flags & STOP)
    stop_cond();
  return byte;
}

static void bno_page(unsigned char reg)  // select page containing specified register
{
  static unsigned char current_page;

  if (!!(reg & 0x80) == current_page)  // if already on correct page
    return;
  current_page = !current_page;
  i2c_send(START,BNO_ADDR*2+0);  // BNO+write
  i2c_send(0, PAGE_ID_0);        // register number
  i2c_send(STOP, current_page);  // write
}

static void bno_write(unsigned char reg, unsigned char data)  // write one BNO register
{
  bno_page(reg);                 // select correct register page
  i2c_send(START,BNO_ADDR*2+0);  // BNO+write
  i2c_send(0, reg & 0x7F);       // register number
  i2c_send(STOP, data);          // write
  nsdelay(2000);                 // ???? idle between writes, tIDLE_wacc_nm
}

//static unsigned char bno_read(unsigned char reg)  // read one BNO register
//{
//  bno_page(reg);                 // select correct register page
//  i2c_send(START,BNO_ADDR*2+0);  // BNO+write
//  i2c_send(0, reg & 0x7F);       // register number
//  i2c_send(START,BNO_ADDR*2+1);  // BNO+read
//  return i2c_recv(NAK+STOP);     // read
//}

static void bno_read_multi(unsigned char reg, int n, unsigned char *buf)  // read multiple BNO registers, doesn't support crossing register page boundary
{
  if (!n)
    return;
  bno_page(reg);                 // select correct register page
  i2c_send(START,BNO_ADDR*2+0);  // BNO+write
  i2c_send(0, reg & 0x7F);       // first register number
  i2c_send(START,BNO_ADDR*2+1);  // BNO+read
  while (n--)
    *buf++ = i2c_recv(n ? 0 : NAK+STOP);  // read
}

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

  Serial.println("Resetting BNO055...");
  HI_SDA();
  HI_SCL();
  LO_RST();                     // reset BNO055
  delay(1);
  HI_RST();
  delay(800);                   // ample time for BNO055 to boot

  Serial.println("Setting BNO055 mode...");
  bno_write(OPR_MODE, 0x0C);    // request NDOF mode
  delay(10);                    // wait for BNO055 to switch modes

  Serial.println("Reading BNO055 data...");
}

void loop(void)
{
  struct
  {
    int16_t acc_x, acc_y, acc_z;
    int16_t mag_x, mag_y, mag_z;
    int16_t gyr_x, gyr_y, gyr_z;
    int16_t eul_heading, eul_roll, eul_pitch;
    int16_t qua_w, qua_x, qua_y, qua_z;
    int16_t lia_x, lia_y, lia_z;
    int16_t grv_x, grv_y, grv_z;
    int8_t  temp;
    uint8_t calib_stat;
  } s;

//bno_read_multi(ACC_DATA_X_LSB,  sizeof s, (uint8_t*)&s);              // read registers ACC_DATA_X_LSB through CALIB_STAT into struct
//bno_read_multi(EUL_HEADING_LSB, 6,        (uint8_t*)&s.eul_heading);  // read registers EUL_HEADING_LSB through EUL_PITCH_MSB into struct
  bno_read_multi(QUA_DATA_W_LSB,  8,        (uint8_t*)&s.qua_w);        // read registers QUA_DATA_W_LSB through QUA_DATA_Z_MSB into struct
  bno_read_multi(CALIB_STAT,      1,        (uint8_t*)&s.calib_stat);   // read register  CALIB_STAT into struct

  // convert quaternion to Euler, because BNO055 Euler data is broken
  float qw =  s.qua_w;  // convert BNO axes to aerospace axes
  float qx =  s.qua_y;
  float qy =  s.qua_x;
  float qz = -s.qua_z;
  float norm = 1.0 / sqrt(qw*qw + qx*qx + qy*qy + qz*qz);
  qw *= norm;  // normalize quaternion
  qx *= norm;
  qy *= norm;
  qz *= norm;
  float heading = 180/M_PI * atan2(qw*qz + qx*qy, 0.5 - qy*qy - qz*qz);
  float roll    = 180/M_PI * atan2(qw*qx + qy*qz, 0.5 - qx*qx - qy*qy);
  float pitch   = 180/M_PI * asin(2 * (qw*qy - qx*qz));

  Serial.print("Orientation: ");
  Serial.print(heading);
  Serial.print(" ");
  Serial.print(roll);
  Serial.print(" ");
  Serial.println(pitch);
  Serial.print("Calibration: ");
  Serial.print((s.calib_stat >> 6) & 3);
  Serial.print(" ");
  Serial.print((s.calib_stat >> 4) & 3);
  Serial.print(" ");
  Serial.print((s.calib_stat >> 2) & 3);
  Serial.print(" ");
  Serial.println((s.calib_stat >> 0) & 3);

  static unsigned long waituntil;
  unsigned long now = millis();
  if ((unsigned long)(waituntil - now) > 2000)  // if timer is out of sync
    waituntil = now;
  delay(waituntil - now);
  waituntil += BNO_PERIOD;
}

gammaburst
 
Posts: 432
Joined: Thu Dec 31, 2015 12:06 pm

Re: BNO055s not working

by jbroesch on Sat Jun 10, 2017 5:06 pm

A concern here is that the CJMCU-055 shown on Banggood (China source) uses the BMX055 -- NOT the BMO055. These are two very different parts. The BMX has a different interface methodology, does not provide fusion data, and uses some different addresses. It has the same MEMS components as the BMO055 -- though not the same microcontroller. The BMX data sheet is at https://ae-bst.resource.bosch.com/media ... 000-02.pdf.

The same product ID, CJMCU-055, is used on Amazon (US source). That product claims to use the BMO055. It appears from the layout that it really is using the BMO055. Just a thought, but it is probably worth double checking to see which part is on your board. Good luck.

jbroesch
 
Posts: 5
Joined: Tue May 30, 2017 6:44 pm

Re: BNO055s not working

by gregfinger on Sun Jun 11, 2017 3:10 am

gammaburst wrote:Do you recall if anything changed since the last time it worked, such as a different Arduino board, new version Arduino software, new version example sketch, new version Adafrut libraries, etc?

I was using a Yun before, but i tried it with the same exact Yun and got the same results. The arduino IDE definitely has been updated since i last tried this (i've tried 1.6.7 and 1.8.3 so far, but maybe i can roll back further and try something older). Not really sure about the adafruit exaxmples or library but i'm guessing they updated too. I can try rolling back to an earlier bno055 library too.

I'm unfamiliar with the I2C scanner, but it sounds like your I2C communication may be erratic. Try touching the SDA and SCL wires, one at a time, with your finger to see if that affects the symptoms, such as speeding-up or slowing-down the error messages.

this is how i feel as well, but i know very little about i2c and why it'd be erratic, but i just played around with the wires and if I leave the SCL wire unplugged, my sketch/monitor won't hang anymore on "Scanning..." anymore and will immediately report "No I2C Devices Found". However unplugging the SDA and leaving the SCL inserted will continue to hang on "Scanning...". not sure if this has any significance.

Maybe try my experimental bit-banged I2C version of the bunny sketch. It uses no special libraries. Notice my pin numbers in the first dozen lines of code. Also, my XYZ axes may be flipped/reversed from the original bunny sketch:


tried your code and the serial monitor just spams (even when moving the sensor around):
Code: Select all | TOGGLE FULL SIZE
Calibration: 1 2 3 2
Orientation: 0.00 0.00 90.00


jbroesch wrote:A concern here is that the CJMCU-055 shown on Banggood (China source) uses the BMX055 -- NOT the BMO055. These are two very different parts. The BMX has a different interface methodology, does not provide fusion data, and uses some different addresses. It has the same MEMS components as the BMO055 -- though not the same microcontroller. The BMX data sheet is at https://ae-bst.resource.bosch.com/media ... 000-02.pdf.

The same product ID, CJMCU-055, is used on Amazon (US source). That product claims to use the BMO055. It appears from the layout that it really is using the BMO055. Just a thought, but it is probably worth double checking to see which part is on your board. Good luck.


ya i'm not so confident with my chinese sensor either, it had me solder on what looks to be a Tilt Ball Switch, by my original bno055 from adafruit still isn't working.

gregfinger
 
Posts: 11
Joined: Fri Jun 09, 2017 10:04 pm

Re: BNO055s not working

by gammaburst on Sun Jun 11, 2017 8:34 pm

The object resembling a tilt switch is probably a 32.768 kHz quartz crystal. It's optional. You can send a command to the BNO telling it to use either its lower-accuracy internal oscillator, or its higher-accuracy crystal oscillator. However, although the command does cause the crystal to begin oscillating, the BNO seems to continue using its lower-accuracy internal oscillator (has anyone else noticed this behavior?).

The included crystal is a good sign that you probably received the correct board. The incorrect board with BMX055 says CJMCU-9DOF on the bottom, according to the photos that I've seen.

gammaburst
 
Posts: 432
Joined: Thu Dec 31, 2015 12:06 pm

Please be positive and constructive with your questions and comments.