Teensy 4.1 + BNO055 does not store heading value on startup

Status
Not open for further replies.

RobSparrow

New member
I bought the BNO055 absolute orientation board from Adafruit. I use it with Teensy 4.1 via I2C. the example I use is the standard code to get the orientation:

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>

Adafruit_BNO055 bno = Adafruit_BNO055(55);

void setup(void)
{
Serial.begin(9600);
Serial.println("Orientation Sensor Test"); Serial.println("");

/* Initialise the sensor */
if(!bno.begin())
{
/* There was a problem detecting the BNO055 ... check your connections */
Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
while(1);
}

delay(1000);

bno.setExtCrystalUse(true);
}

void loop(void)
{
/* Get a new sensor event */
sensors_event_t event;
bno.getEvent(&event);

/* Display the floating point data */
Serial.print("X: ");
Serial.print(event.orientation.x, 4);
Serial.print("\tY: ");
Serial.print(event.orientation.y, 4);
Serial.print("\tZ: ");
Serial.print(event.orientation.z, 4);
Serial.println("");

delay(100);
}

the X, Y, Z shows valid and noise free values on the screen according to the movement of the board.
There is no drift, when the board stands still, the values are constant.
The problem is, the heading is losing its value upon resetting the power/ board. For example, on powering on the board and Teensy, I see X=358.5, Y=-20, Z= 5.3. I move the board a little and then I see for example, X=30.4, Y= -41.3, Z=5.5. I keep the board at this position, then I power off the devices and turn them on again. I see: X= 358.7 , Y=-41.3, Z=5.5. The heading value (X) is "0" again. The board does not retain its value. I tried to use the "restore offsets" example, and calibrate the board. The result is the same. The board was calibrated (mag=3), everything shows fine except the X axis behaves the same.

What could be the problem?
 
@RobSparrow

I've been using the BNO055 for awhile but I tend to check and restore offsets as part of the BNO055 initialization. Pretty much a dup of what's in the restore-offset sketch except just print a warning that that no calibration found. But I did find that the T4.1 does store the calibration data. At least it says it found the data :)
 
@RobSparrow

I've been using the BNO055 for awhile but I tend to check and restore offsets as part of the BNO055 initialization. Pretty much a dup of what's in the restore-offset sketch except just print a warning that that no calibration found. But I did find that the T4.1 does store the calibration data. At least it says it found the data :)

As I said, the calibrations were done, I checked the calibration status. I also stored them in the EEPROM, and loaded them on startup. The problem is different, the value of "X" axis is erased on startup, no matter the orientation before the power went down.
 
Status
Not open for further replies.
Back
Top