OpenRov IMU/Compass/Depth module using Arduino


#1

I have been working only with Arduino Mega as a controller to use the OpenRov IMU/Compass/Depth sensor to be used for my vehicle. I have tried to use the Arduino interface code in the opensource that interferes with BNO055 IMU and other many libraries but I don’t get the data right (the data displayed are zeros at first for the first loops and then some unkonwn symbols display on the serial monitor) .
Is there a ready and a separate Arduino code for controlling the IMU?


#2

Try this stand-alone library to working directly on the Arduino: https://github.com/adafruit/Adafruit_BNO055. If your getting weird characters over the serial port that usually implies your baud rate in the serial monitor does not match the baud rate set in the sketch.


#3

Thanks for replying.
Yes, the baud rate was wrong and I have changed it. However, the link you put is for Adafruit BNO055 which is different from the OPENROV’s IMU/Depth sensor and it has a different address, therefore, it didn’t work as on the serial monitor it appeared “Ooops, no BNO055 detected … Check your wiring or I2C ADDR!”


#4

It looks like you can #define ARDUINO_SAMD_ZERO and it will swap the address. Or in your sample code you can change the Adafruit_BNO055(55) to Adafruit_BNO055(55,BNO055_ADDRESS_B).


#5

If you can’t get the Adafruit library to work, you can also use our standalone BNO055 library in one of our development branches under /libraries/BNO055:

https://github.com/OpenROV/openrov-software-arduino/tree/firmware-2.0

Usage:

#include <BNO055.h>

CBNO055Driver bno( BNO055_ADDRESS_A );
// or
// BNO055_ADDRESS_B

// Here you can choose which Wire interface you want to use by passing a pointer to it
if( bno.Initialize( &Wire ) )
{
    // Success
}
else
{
    // Failure, handle accordingly
}

bno.GetCalibration();

imu::Vector<3> euler;
bno.GetVector( bosch::VECTOR_EULER, euler );

float roll = -euler.y();
float pitch = euler.z();
float yaw = euler.x();    

#6

Thank you so much, my IMU finally has worked. and it is ADDRESS_A not ADDRESS_B.


#7

Thank you for your help but the Adafruit has worked for me now :smiley:


#8

A post was split to a new topic: How do you find the BNO055 based IMU