Bosch BNO055 9 Axis sensor heading data

Hello,

I am still not a genius in programming. I have trouble getting the Bosch BNO055 handled.

I need simply to get out the heading data when connected through I2C (50, 0x29) but somehow I don`t get that handled..

Of course, this is part of a bigger thing and I need this to come further.

I could calibrate the sensor and I tried also to restore the calibration data to avoid a recalibration each time the sensor gets powerless. This I already dropped for now because it just does not find any documentation I do understand yet. This, of course, does not mean that there is no...

Is there anybody so kind and shows me the lines I need to get the heading in degrees out of the sensor?

THX!

there is a good tutorial (and library description) from Adafruit - have you explored that? (and for heading more comment in the forum )

what about trying the examples in the library found here?

Yes, I do experiment with the library from Adafruit and there I do get the data out.
But as soon as I try to integrate this or just reduce the sketch down to heading data nothing happens.

I do put the stuff from header section, the setup (what I think is necessary) and from the loop section into the reduced heading sketch but... like mentioned I don`t get it handled.

post code... (using code tags)

J-M-L:
post code... (using code tags)

For what????

How ever i got it handled. Case closed!Here for may other persons which are lost in BNO055 coding. Actually very simple..

This is without calibration data, so the heading will start at zero in the position the sensor is at that moment. At least it looks like that.

When if have figured out how to restore the calibration in a short way I`ll complete and post it here as well.

Now, WITH code tags (because here comes now code :wink: ):

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

/* Set the delay between fresh samples */
#define BNO055_SAMPLERATE_DELAY_MS (100)

Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x29);

void setup(void)
{
  Serial.begin(115200);

  /* Initialise the sensor */
  if (!bno.begin());
}

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

  /* Display the floating point data */
  Serial.print("heading:  ");
  Serial.print(-event.orientation.x, 4);
  Serial.print("   roll: ");
  Serial.print(event.orientation.y, 4);
  Serial.print("   pitch: ");
  Serial.print(event.orientation.z, 4);
  Serial.println(" ");
  /* Wait the specified delay before requesting new data */
  delay(BNO055_SAMPLERATE_DELAY_MS);
}

When if have figured out how to restore the calibration

Follow the proper calibration procedure, described in the BNO055 manual and on line.

Calibration continues in the background, so you need to periodically read the calibration status register, and ignore readings when the value is not satisfactory.

jremington:
Follow the proper calibration procedure, described in the BNO055 manual and on line.

Calibration continues in the background, so you need to periodically read the calibration status register, and ignore readings when the value is not satisfactory.

I thought so. The thing is that the device I want to build does not have power when it is not used and there is no chance to calibrate it before each use. Several people have been in this situation how I could read. So to avoid the calibration each time the best solution I found was to do a lot of calibrations, average the values and restore them each time the calibration is lost when the BNO055 lost the power to long.

I could use a coin cell for backup right and in suspend the BNO uses just a couple of microA but the environment where the whole thing should be installed let me be skeptical about the Coin cell.

Do you know a better solution?

Restoring the 11 integer calibration data works fine, but you cannot turn off the background calibration.

So, you still need to read the calibration status register to decide whether to use the data.