Page 1 of 1

Qwiic VR IMU Breakout - BNO080 code examples not working

Posted: Tue Jul 09, 2019 12:00 pm
by drakob
I'm trying to test this IMU for a project I'm helping with, and I've gone through the hookup guide and set everything up, but the examples aren't working for some reason.

None of the Arduino examples from the library seem to be actually reading or outputting any of the information from the IMU, but it is on and connected like the hookup guide shows it should be. This is also a brand new board so none of the parts should be broken or anything.

With the first example listed (RotationVector) every time I run the code I get "BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing..." in the serial monitor, despite everything being plugged in as shown in the guide.

Also, here's the code for the first example in case no one wants to download/find it themselves
Code: Select all
/*
  Using the BNO080 IMU
  By: Nathan Seidle
  SparkFun Electronics
  Date: December 21st, 2017
  License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

  Feel like supporting our work? Buy a board from SparkFun!
  https://www.sparkfun.com/products/14586

  This example shows how to output the i/j/k/real parts of the rotation vector.
  https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

  It takes about 1ms at 400kHz I2C to read a record from the sensor, but we are polling the sensor continually
  between updates from the sensor. Use the interrupt pin on the BNO080 breakout to avoid polling.

  Hardware Connections:
  Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other
  Plug the sensor onto the shield
  Serial.print it out at 9600 baud to serial monitor.
*/

#include <Wire.h>

#include "SparkFun_BNO080_Arduino_Library.h"
BNO080 myIMU;

void setup()
{
  Serial.begin(9600);
  Serial.println();
  Serial.println("BNO080 Read Example");

  Wire.begin();

  if (myIMU.begin() == false)
  {
    Serial.println("BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing...");
    while (1);
  }

  Wire.setClock(400000); //Increase I2C data rate to 400kHz

  myIMU.enableRotationVector(50); //Send data update every 50ms

  Serial.println(F("Rotation vector enabled"));
  Serial.println(F("Output in form i, j, k, real, accuracy"));
}

void loop()
{
  //Look for reports from the IMU
  if (myIMU.dataAvailable() == true)
  {
    float quatI = myIMU.getQuatI();
    float quatJ = myIMU.getQuatJ();
    float quatK = myIMU.getQuatK();
    float quatReal = myIMU.getQuatReal();
    float quatRadianAccuracy = myIMU.getQuatRadianAccuracy();

    Serial.print(quatI, 2);
    Serial.print(F(","));
    Serial.print(quatJ, 2);
    Serial.print(F(","));
    Serial.print(quatK, 2);
    Serial.print(F(","));
    Serial.print(quatReal, 2);
    Serial.print(F(","));
    Serial.print(quatRadianAccuracy, 2);
    Serial.print(F(","));

    Serial.println();
  }
}

I also apologize if this is something super simple that I'm not getting or I'm not providing enough info. I'm still new to both coding and arduino/circuitry and I'm kinda stupid.

Re: Qwiic VR IMU Breakout - BNO080 code examples not working

Posted: Wed Jul 10, 2019 10:42 am
by TS-Mark
Hi drakrob,

The "BNO080 not detected at default I2C address" error usually points to a connection problem. How are you connecting the BNO080 breakout to your Arduino? Are you using a Qwiic Shield? If so, have you soldered headers into place to plug it into your Arduino? If not, what connection type are you using? In order to identify any potential hardware issues, please take a few photos of your board and circuit and any soldering you have done and attach them to your response. If you have a Qwiic Shield, please take photos of the top and bottom of it.

Re: Qwiic VR IMU Breakout - BNO080 code examples not working

Posted: Wed Jul 10, 2019 11:10 am
by drakob
Hi Mark,

Here's a few pictures of what I have. I took pics of the front and back of both the shield and the IMU, plus a picture of how it's connected to the arduino. I haven't soldered anything onto the boards, I've just been using the pins that came with the shield to connect the two. I'd also prefer to avoid soldering anything if possible since this is for a test and not a permanent thing yet.

I apologize for the bad quality, my phone isn't great with pictures but it's all I have for them. If you need closer shots or different angles or anything just let me know.

Thank you,
Drake
Qwiick Shield Front.jpg
Qwiick Shield Back.jpg
Arduino Connected Side.jpg

Re: Qwiic VR IMU Breakout - BNO080 code examples not working

Posted: Wed Jul 10, 2019 12:01 pm
by n1ist
You need to solder the header pins to the shield; otherwise they will not make a reliable contact with the pads on the shield.
/mike

Re: Qwiic VR IMU Breakout - BNO080 code examples not working

Posted: Wed Jul 10, 2019 12:58 pm
by TS-Mark
Mike is 100% correct here. Without soldering, the pins will not make good contact with the headers and you will not be able to use the shield. Our Arduino Shields tutorial will go over assembling shields.

If you want to avoid soldering and use the Qwiic connector, I would recommend using this Qwiic Breadboard Jumper Cable that breaks out the 4 pins on the Qwiic connector to your standard jumper wires. From there, you can plug the jumper wires into the header pins on your Arduino for 3.3V, Ground, SDA and SCL. The FAQ section of the Qwiic Landing Page has the color codes listed but I'll list them here as well:
  • Black = GND
  • Red = 3.3V
  • Blue = SDA
  • Yellow = SCL