BNO-085 with TCA9548A

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
IronKnight
 
Posts: 2
Joined: Wed Feb 01, 2023 4:07 pm

BNO-085 with TCA9548A

Post by IronKnight »

Hi

I have been working on a project that uses motion tracking by using the bno-055 breakout board from adafruit, and recently transitioned to using the BNO-085 for the stemma qt connections. I had been using a TCA 9548A I2C expansion board, with the bno-055, but I have been unable to get this code working with the BNO-085. Does anyone know how to solve this problem, or know of any more in-depth documentation on how to use the BNO-085 I2C line?

Thank you!

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: BNO-085 with TCA9548A

Post by dastels »

The TCA 9548A is an I2C multiplexor board, not an expansion board (e.g. https://www.adafruit.com/product/5346).

Your problem might be (can't tell without seeing your code) that the BNO055 is at address 0x28 and the BNO085 is at 0x4A.

Dave

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

Re: BNO-085 with TCA9548A

Post by gammaburst »

Was the Stemma QT connector your only reason for switching to a BNO085?
Adafruit sells a BNO055 with those connectors: https://www.adafruit.com/product/4646

Does BNO085 communication work if you temporarily remove the TCA9548A?

User avatar
IronKnight
 
Posts: 2
Joined: Wed Feb 01, 2023 4:07 pm

Re: BNO-085 with TCA9548A

Post by IronKnight »

Hi

Right now I am using this code:

Code: Select all

#include <Wire.h>
#include "SparkFun_BNO080_Arduino_Library.h"
#include <math.h>

// Create an instance of the TCA9548A multiplexer
#define TCAADDR 0x70

void tcaselect(uint8_t i) {
  if (i > 7) return;
 
  Wire.beginTransmission(TCAADDR);
  Wire.write(1 << i);
  Wire.endTransmission();  
}

// Create an instance of the BNO080 sensor
BNO080 myIMU;

void setup() {
  // Start the I2C communication
  Wire.begin();

  tcaselect(0);

  // Start the BNO085 sensor
  myIMU.begin();
}

void loop()
{

  tcaselect(0);
  //Look for reports from the IMU
  if (myIMU.dataAvailable() == true)
  {
    float roll = (myIMU.getRoll()) * 180.0 / PI; // Convert roll to degrees
    float pitch = (myIMU.getPitch()) * 180.0 / PI; // Convert pitch to degrees
    float yaw = (myIMU.getYaw()) * 180.0 / PI; // Convert yaw / heading to degrees

    Serial.print(roll, 1);
    Serial.print(F(","));
    Serial.print(pitch, 1);
    Serial.print(F(","));
    Serial.print(yaw, 1);

    Serial.println();
  }
}
I did realize that the BNO-055 had a stemma qt version, but as I am using 8 of them, I went with the slightly cheaper BNO-085. Is this chip able to be used with the TCA9548A? I know the BNO-055 works.
Last edited by dastels on Fri Mar 24, 2023 8:20 am, edited 1 time in total.
Reason: Add code tags

User avatar
dastels
 
Posts: 15656
Joined: Tue Oct 20, 2015 3:22 pm

Re: BNO-085 with TCA9548A

Post by dastels »

Check in the Sparkfun BN080 library to see what I2C address it's using since, as I said, the 055 & 085 have different addresses.

Dave

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

Re: BNO-085 with TCA9548A

Post by gammaburst »

I'm looking at your code and Sparkfun's example: https://github.com/sparkfun/SparkFun_BN ... Angles.ino
Your code is missing a critical line: myIMU.enableRotationVector(50);

Sparkfun defaults to I2C address 0x4B. Adafruit defaults to 0x4A. You need to somehow resolve that difference.

Get one BNO085 working first without the TCA9548A, then add the TCA9548A and more BNO's.

Once upon a time, I got three Adafruit BNO085s working with a TCA9548A and Sparkfun's BNO080 library.
I recall it didn't start-up reliably, although I didn't spend much time trying to fix it.

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

Return to “Other Products from Adafruit”