Main Site Documentation

Project - BNO055 Absolute Orientation Sensor


I just posted BNO055 Absolute Orientation Sensor on Codeshare. Feel free to discuss and make suggestions here.


@ charlieHustle:
That code looks great. Thanks for posting it.
Before getting the Bosch sensor and testing it, can you relate your experiences with its stability?
I am particularly interested in the heading vector stability if the board is static. In some other systems I have tried, the heading will drift many degrees while static, particularly if there is any change in temperature.


I’m using the sensor for my autonomous rc car. So far the heading seems very stable. It doesn’t move at all when the car is still. I’m only calculating heading to within a degree. The sensor is mounted on a vibration damper. I have not used it in any temperature extremes.


@ CharlieHustle - Thanks for the info. I will check it out!


Do you have a blog or other place where you have photos/videos of your autonomous car?


+1. I just looked into this sensor and think it may be a great addition to my robot.


$35 each is just over the parts-drawer-filler line and into the because-I-need-one zone.


@ mcalsyn - Yeah, but only ~$10 @ mouser, so look for one on a IoT Labs Earth daughter board. I am sure that @ justin will add one to your offerings.


Considering I paid over double that for a similar device (CK Mongoose) back in 2011, I’d say its a great price! But definitely not something you buy just to throw in the parts bin. It’s amazing how they’ve basically taken that entire device and crammed it into a single chip. And added steroids!


The accelerometer on the BNO055 has a maximum range of ±16g

So it wouldn’t be a good fit for my rocket.


Or @ Justin’s motorcycle…


@ charliehustle:
I have your code running and it looks great.
I have gone a little farther and am using the get/set sensor offsets. The seems to work fine except the magnetometer offset not seem to have an effect. The read back correctly, as written, but the heading remains set at the power up position.
Have you had similar results? It seems that a compass needs to be useful at powerup.
In my application, I cannot pick up and wave the package around to initialize.


@ ianlee74 - Too much Titanium holding me together to continue with the crotch rockets…

@ Rocky - I can do it without waving and over BLE no less :slight_smile:


Here you go, loading and saving of the BNO calibration offsets to STM flash :slight_smile:

And lots of thanks to @ charlieHustle for his driver

using System.Threading;
using BNO055;
using Microsoft.SPOT;

namespace BioSnapper
    public class Program
        private static IngenuityMicro.Sensors.BNO055 _bno;
        private static IngenuityMicro.Sensors.BNO055.Vector _myVector;
        private static SimpleSerial _ble;
        private static string[] _dataIn;
        private static readonly string Delimiter = string.Empty;
        private static Mode _mode = Mode.Ndof;
        public static void Main()
            _bno = new IngenuityMicro.Sensors.BNO055();
            _ble = new SimpleSerial("COM2", 57600);
            _ble.DataReceived += _ble_DataReceived;
            new Thread(LoopDeLoop).Start();

        static void LoopDeLoop()
            for (;;)
                switch (_mode)
                    case Mode.Ndof:
                    case Mode.Config:
        static void SetBnoCalibration()
            ConfigData configs = SettingsHelper.ReadConfigSettings() ?? new ConfigData();
            _bno.SetMode(0x00); // config mode
            _bno.SetMode(0x0C);    // NDOF Mode
            _mode = Mode.Ndof;

        static bool SetConfigVals()
            _bno.SetMode(0x00); // config mode
            ConfigData config = new ConfigData();
            config.CalMrl = _bno.getCalvalMRL();
            config.CalMrm = _bno.getCalvalMRM();
            config.CalMoxl = _bno.getCalvalMOXL();
            config.CalMoxm = _bno.getCalvalMOXM();
            config.CalMoyl = _bno.getCalvalMOYL();
            config.CalMoym = _bno.getCalvalMOYM();
            config.CalMozl = _bno.getCalvalMOZL();
            config.CalMozm = _bno.getCalvalMOZM();
            var res = SettingsHelper.SaveConfigSettings(config);
            _bno.SetMode(0x0C);    // NDOF Mode
            _mode = Mode.Ndof;
            return res;
        private static void _ble_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
            _dataIn = Delimiter != string.Empty ? _ble.Deserialize(Delimiter) : _ble.Deserialize();
            for (int index = 0; index < _dataIn.Length; index++)
                switch (_dataIn[index])
                    case "N":
                        _mode = Mode.Ndof;
                    case "C":
                        _mode = Mode.Config;
        static void SendData()
            _myVector = _bno.getVector(IngenuityMicro.Sensors.BNO055.adafruit_vector_type_t.VECTOR_EULER);
            _ble.WriteLine("x:" + _myVector.x.ToString("F1"));


@ rockybooth - I added a method called saveSensorOffsets and uploaded revised code to Codeshare. Enjoy!


Also FYI, from my reading of the BNO manual you need to save any settings to your “host” micro non-volatile memory, and write them to the BNO at startup. The BNO does not have memory.