Go Down

Topic: Connecting three BNO055 sensors to an Arduino Mega 2560 (Read 104 times) previous topic - next topic

MR01

Jun 13, 2016, 08:04 pm Last Edit: Jun 13, 2016, 08:11 pm by MR01 Reason: New Idea
I am working on a project that uses data taken from 3 separate BNO055 sensors and transmits it to an Arduino Mega 2560. I only have a basic knowledge of the code, and am having trouble figuring out how to use all 3 of them with the Arduino. I have tested out the Arduino with one of the IMUs and it works correctly. I connected the Vin of the BNO055 to the 3.3v of the Arduino, the ground to the ground, the SDA to the SDA 20 pin, and the SCL to the SCL 21. I have successfully connected two of the sensors to the Mega by setting the second sensor ADR pin to low. However, nothing I have tried for the third sensor is working. I have been reading online and it seems that I have a couple options. Ether a) Program the software to run one sensor at a time (by changing the address) b)Use a multiplexer c) use two Arduinos. However, I am not sure how to alternate the addresses of the sensors, nor how to relay the data from the second Arduino (tried using an Uno as slave) to the Master. Any suggestions on how to best go about this?
Thanks in advance!

BNO055 Data Sheet: https://cdn-shop.adafruit.com/product-files/2472/BST_BNO055_DS000_13.pdf

EDIT: Another idea. Would I be able to gather the information from the third sensor using the Arduino Uno, and send it to the Mega using ether the TX/RX connections or another digital pin?

CrossRoads

See page 90 of the spec:

"The default I²C address of the BNO055 device is 0101001b (0x29). The alternative address 0101000b (0x28), in I2C mode the input pin COM3 can be used to select between the primary and alternative I2C address as shown in Table 4-7."

Control COM3 of all three devices individually. Pull one low at a time and use slave address 0x28. The other two will be expecting 0x29 and will not respond.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

MR01

Would this work even if I need the data from all three sensors in real time? If not how can I decrease the time in between? Thanks!

CrossRoads

"real time"? With I2C you can only talk to 1 part at a time via a serial data stream, which gets converted to parallel bytes for processing.
Internally, you only have an 8-bit bus. Which device will you be pulling data from/making a decision about at any one time?
If you need faster then 400 KHz clock that I2C offers, find a part with SPI where the clock rate can be up to 20x faster, 8 MHz.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

MR01

By "real time" I meant that I am displaying the orientation of all three sensors at the same time. When I have two of the sensors connected - one at 5v and the other w/ ADR connected to 3.3v - I can get them to display the orientation of each sensor with updates every one second. I am having trouble programming the arduino to pull one low at a time. Would I need the ADR of all three pins connected to 3.3v? I have been trying this with only two of the sensors connected to 3.3v, while the original sensor stays connected to 5v. Can I go about this by simply using the digitalwrite() command? I do not know how clear I am being as some of my technical language may be off.

CrossRoads

Yes, digitalWrite to control the 3 pins connected to the address selection pins.
Use simple voltage divider if you need 3.3V max.
Arduino - 3.3K - 6.6K - Gnd, 3.3V from junction of the resistors
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy