BNO055 Orientation Sensor Library for Proteus Simulation: an Arduino UNO V4.0, the BNO055 module, an OLED artificial horizon and two LEDs

BNO055 Orientation Sensor Library for Proteus Simulation

40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new BNO055 Orientation Sensor Library for Proteus Simulation. Most motion sensors hand you raw numbers - an acceleration here, a rotation rate there - and leave the hard part to you: turning them into an angle that does not drift. The BNO055 does that part itself. An accelerometer, a gyroscope, a magnetometer and a small processor share one package, and the processor runs the fusion, so you simply read the heading, the roll and the pitch. With this library you can run a full Proteus simulation of the module, register by register, so that the code you test here works with the real board.

BNO055 Proteus simulation demo: the Arduino UNO V4.0 reading the orientation over I2C, the artificial horizon and heading on the OLED, the LEVEL and TILT LEDs
Figure: The BNO055 simulation running: the board turns, rolls, pitches and gets shaken; the horizon on the OLED follows.
Updates

BNO055 Orientation Sensor Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Helping Tools

The module comes alive at run time: its PWR LED lights with the supply, a FUSION LED shows when the fusion is running, and a small compass needle on the board turns with the heading. The demo is an artificial horizon: an Arduino reads the orientation as the board turns, rolls, pitches and gets shaken, draws the horizon and the heading on an OLED, and lights a LEVEL or a TILT LED.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the IMU board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the BNO055 Orientation Sensor Library for Proteus Simulation:

BNO055 Orientation Sensor Library for Proteus Simulation: an Arduino UNO V4.0, the BNO055 module, an OLED artificial horizon and two LEDs
Figure: The BNO055 Orientation Sensor Library for Proteus Simulation.

What is the BNO055, and Why is it Different?

Every orientation sensor has the same problem. An accelerometer knows where down is, but it also feels every bump and every turn, so its angle jitters. A gyroscope measures how fast the board rotates, and adding that up gives a smooth angle - which slowly drifts away, because every small error is added too. A magnetometer knows where north is, but steel and motors nearby pull it off. Sensor fusion combines the three, each one correcting the weaknesses of the others. Writing a good fusion filter takes time and some mathematics; the BNO055 has one built in, running on a Cortex-M0 next to the sensors, and it gives you the result 100 times a second.

The BNO055 module at a glance
BNO055 module
Sensorsa 3-axis accelerometer, a 3-axis gyroscope and a 3-axis magnetometer
Fusion outputsEuler angles (heading, roll, pitch), a quaternion, linear acceleration, gravity
Data rate100 Hz in the fusion modes
InterfaceI2C at 0x28 (ADR low) or 0x29; the chip also has a UART mode
Units1 degree = 16 LSB, 1 m/s² = 100 LSB, 1 uT = 16 LSB, 1 dps = 16 LSB, quaternion 1 = 16384
Start-upabout 650 ms after power-up or a reset, no answer until then
Board27 x 20 mm: a 3.3 V regulator, a level shifter, a 32.768 kHz crystal, a 9-pin header

Euler Angles and Quaternions

The easiest output to use is the set of Euler angles. The heading runs from 0 to 360 degrees clockwise from magnetic north, like a ship's compass. The roll is the tilt to the side, from -90 to +90 degrees, and the pitch is the nose going up or down, from -180 to +180. Each is a signed 16-bit number, low byte first, with 16 counts per degree. Euler angles have one weakness: near a pitch of 90 degrees the heading and the roll mix together. For aircraft, robot arms and 3D graphics the BNO055 also gives a quaternion - four numbers, w, x, y and z, scaled by 2^14 - which describes any orientation without that problem.

The Operating Modes

The BNO055 operating modes
OPR_MODEModeWhat runs
0x00CONFIGnothing - the only mode in which settings can change
0x01 - 0x07ACCONLY ... AMGthe sensors alone, no fusion
0x08IMUaccel + gyro: a relative heading, no magnetometer
0x09, 0x0ACOMPASS, M4Gaccel + mag: a tilt-compensated compass
0x0BNDOF_FMC_OFFall nine axes, without the fast magnetometer calibration
0x0CNDOFall nine axes: an absolute orientation

Switching from CONFIG to a fusion mode takes 7 ms and back to CONFIG 19 ms. The chip starts in CONFIG mode, so every program has to select a mode before the data registers fill.

Calibration

The fusion trusts each sensor only once it knows it. CALIB_STAT (0x35) holds four numbers from 0 to 3: the system, the gyroscope, the accelerometer and the magnetometer. The gyroscope calibrates when the board sits still for a moment, the magnetometer when it turns through a good part of a circle, and the accelerometer when it rests at a few different angles. The system value reaches 3 when the fusion is confident. Until the magnetometer is calibrated, the heading can be several degrees off - which our model shows too.

The Registers

The BNO055 registers the demo uses
AddressRegisterWhat it holds
0x00 - 0x03CHIP_ID, ACC_ID, MAG_ID, GYR_ID0xA0, 0xFB, 0x32, 0x0F
0x08 - 0x19ACC, MAG, GYR DATAX, Y, Z of each sensor, low byte first
0x1A - 0x1FEUL DATAheading, roll, pitch
0x20 - 0x27QUA DATAw, x, y, z
0x28 - 0x33LIA, GRV DATAlinear acceleration, gravity
0x34, 0x35TEMP, CALIB_STATthe temperature, the four calibration values
0x39SYS_STATUS0 idle, 5 fusion running, 6 running without fusion
0x3B, 0x3D, 0x3FUNIT_SEL, OPR_MODE, SYS_TRIGGERthe units, the mode, the reset

Features of the BNO055 Orientation Sensor Library for Proteus Simulation

  • A real-looking module: the purple board at its real size, 27 x 20 mm, with the BNO055 in its LGA package, the crystal, the regulator, the level shifter, the axis marks, the header and our small TEP mark.
  • Animated: a PWR LED and a FUSION LED (our addition), and a compass needle on the board that turns with the heading.
  • The real registers: the IDs, the page switch, the 13 operating modes with their switching times, the start-up delay, UNIT_SEL, SYS_TRIGGER and the RST pin.
  • Real fusion outputs: Euler angles, the quaternion, accel, gyro, magnetometer, linear acceleration and gravity, all from the same orientation, at 100 Hz.
  • Calibration: CALIB_STAT climbs as the board stays still, turns and tilts, and the heading wanders until the magnetometer is calibrated.
  • A scene: the board turns to east, rolls, pitches, gets shaken and levels again, plus chips to level, turn, roll, pitch or shake it at any time.
  • A pop-up: an attitude indicator and a compass rose, the angles over the run, eight live tiles, graphs, an event log and a check page.
  • A complete package: about 2.3 MB with the library, our OLED, 5 mm LED and resistor libraries, our Arduino UNO V4.0 and the demo, without the source code of the model.

The BNO055 in Proteus

The device is ORIENTBNO055TEP in TEPBNO055.LIB, under Sensors > Motion, with the prefix U and the model TEPBNO055.DLL. Search BNO055 or orientation in Pick Devices. Six pins along the bottom: VIN, GND, SCL, SDA, INT and RST (ADR, PS0 and PS1 are drawn only). Its properties: PROFILE (DEMO or STEADY), HEADING, ROLL and PITCH (for STEADY) and ADDRESS (0x28 or 0x29).

BNO055 orientation sensor module from the BNO055 Library for Proteus Simulation
Figure: The BNO055 module.

Download BNO055 Orientation Sensor Library for Proteus Simulation

Click the button below to download BNO055-Orientation-Sensor-Library-for-Proteus-v1.0.zip (about 2.3 MB, without the source code of the models):

BNO055 Orientation Sensor Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPBNO055.LIB, TEPOLED12864.LIB, TEPLED5MM.LIB, TEPRESISTOR.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPBNO055.DLL, TEPOLED.DLL, TEPLED5MM.DLL, TEPRESISTOR.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (no extra library).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install BNO055 Orientation Sensor Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPBNO055.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for BNO055.

Proteus Simulation of an Artificial Horizon

Our demo is the instrument every pilot knows. U1 is the BNO055 with PROFILE DEMO: it sits still and level, turns slowly to east from 2 seconds, rolls 30 degrees to the right at 6.5 seconds, pitches its nose up 20 degrees at 8.5 seconds, levels out again at 11 seconds, gets shaken at 13 seconds and finally turns to 45 degrees from 15.5 seconds. Its SCL and SDA go to A5 and A4 of our Arduino UNO Library for Proteus V4.0, and our OLED SSD1306 Library for Proteus shares the same two wires at its own address, 0x3C. Two LEDs from our 5mm LED Library for Proteus sit beside the OLED: LEVEL (green, D5) and TILT (red, D6), each through 220 ohm. The Arduino's built-in monitor is the same window as our TEP Serial Monitor Advance for Proteus. Open BNO055-Orientation-ArduinoUnoV4.pdsprj.

BNO055 simulation in Proteus: Arduino UNO V4.0, the BNO055 module, an OLED and two LEDs on an A4 sheet
Figure: The whole simulation on an A4 sheet.

The Sketch

The sketch uses plain Wire calls, no library. The chip does not answer for about 650 ms after power-up, so the first thing it does is ask for CHIP_ID until the answer is 0xA0:

  for (byte i = 0; i < 20 && id != 0xA0; i++) { if (!rd(0x00, &id, 1)) id = 0; if (id != 0xA0) delay(100); }   // up to 2 s

Then it goes to CONFIG mode, sets UNIT_SEL to 0x00 - m/s², degrees per second, degrees and Celsius - and selects the full fusion:

  wr(0x3D, 0x0C); delay(20);                                // NDOF: all three sensors, fused

Every 100 ms it reads six bytes from 0x1A. Each angle is a signed 16-bit number with the low byte first:

int16_t s16(const byte* b) { return (int16_t)((uint16_t)b[1] << 8 | b[0]); }   // LSB first

Dividing by 16 gives degrees:

  heading = s16(e) / 16.0; roll = s16(e + 2) / 16.0; pitch = s16(e + 4) / 16.0;

It also reads the linear acceleration - the movement with gravity taken out, which the fusion works out by itself - to notice a shake, and CALIB_STAT for the calibration. The OLED is drawn column by column without a frame buffer. In the left half each column finds the height of the horizon from the pitch and the slope from the roll, and lights the ground below it:

          const int yh = 40 + (int)(pitch * 0.8) - (int)(t * ((int)c - 31));

A small aircraft symbol is drawn on top by inverting the pixels, so it shows over the sky and the ground alike. The yellow band shows the heading in big digits with its compass point, and the right half the roll, the pitch and the calibration. LEVEL lights within 3 degrees of level; TILT past 25 degrees, or when the linear acceleration goes over 1.5 m/s² - and a shake holds it for a second, so a vibration that passes through zero does not make it flicker.

BNO055 Simulation Results

Open the project and press Run. The demo runs 18.3 simulated seconds and took 239 seconds on our PC with the pop-up open and the pictures being taken. Click the module for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.

The Start

The chip says nothing for its first 650 ms. The sketch's first six tries at CHIP_ID go unanswered - the Check page counts them - and at 651 ms the chip is up in CONFIG mode with CHIP_ID 0xA0. The sketch sets the units and writes OPR_MODE = 0x0C at 697 ms; 7 ms later the fusion runs and SYS_STATUS reads 5. The board lies flat and points due north, and roll and pitch are right from the first reading - gravity is easy to find - so the green LEVEL LED comes on. The heading is a different story: at 1.5 seconds it reads 10.2 degrees instead of 0. The gyroscope is calibrated already, but the magnetometer is not, and the fusion does not trust its north yet. The monitor prints "H 11.9 R 0.1 P -0.1 CAL 0/3/1/0" - exactly the kind of wandering a real BNO055 shows in its first seconds after power-up.

The Turn to East

At 2 seconds the board starts a slow turn to the east. The turn is what the magnetometer needed: CALIB_STAT moves to system 1 with the magnetometer at 1 at 2.8 seconds, then 2 and 3 as the turn goes on. At 4 seconds the board points at 44.5 degrees and the fusion says 47.3 - the last of the error - and the monitor shows "CAL 1/3/1/2". By 6 seconds the board points east, the heading reads 90.0 and stays there within a tenth of a degree. On the sheet the compass needle on the module has turned too: its red end now points at the board's left side, which is where north is when the board faces east.

Roll and Pitch

At 6.5 seconds the board rolls 30 degrees to the right. On the OLED the horizon tilts - its right end rises, as on a real aircraft instrument - the TILT LED comes on as the roll passes 25 degrees, and the monitor prints "ALARM: tilted past 25 degrees". The tilt also teaches the accelerometer, and the system calibration moves to 2 at 7.6 seconds. At 8.2 seconds the pop-up shows heading 89.9, roll 29.9, pitch 0.2 and the quaternion 0.683, 0.183, 0.183, -0.683 - the same orientation written the other way. At 8.5 seconds the nose comes up 20 degrees and the horizon drops on the OLED. With that second tilt the accelerometer reaches 3, and at 9.5 seconds the system does too: CALIB_STAT reads 0xFF. At 10.4 seconds the readings are 90.1, 29.9 and 20.0, against the board's true 90, 30 and 20.

BNO055 Proteus simulation pop-up: the attitude indicator with the board rolled 30 degrees to the right, heading east
Figure: Rolled 30 degrees.
BNO055 Proteus simulation: the OLED with the artificial horizon, the heading and the TILT LED lit
Figure: The OLED: the horizon and the heading.
The BNO055 artificial horizon simulation running in the Proteus workspace with the Arduino UNO V4.0
Figure: The simulation in the workspace.
BNO055 Proteus simulation pop-up: rolled 30 and pitched 20 degrees, the calibration complete
Figure: Rolled and pitched.

Level Again, a Shake and a Last Turn

At 11 seconds the board levels out again; the monitor prints "Back to normal" and LEVEL lights. At 13 seconds it is shaken for two seconds - a hand's tremble at 7 and 11 Hz. The angles hardly move, a few tenths of a degree, but the linear acceleration - the movement with gravity taken out, which the fusion works out by itself - jumps past 1.5 m/s². The sketch prints "ALARM: shaken", TILT lights and stays on for a second after the last strong reading, so it does not flicker with the vibration. From 15.5 seconds the board turns to 45 degrees, north-east. At 18.3 seconds the fusion reads 45.1 degrees, roll -0.2 and pitch -0.1, the calibration is still 3, 3, 3, 3, and the needle on the module points up and to the left.

BNO055 Proteus simulation pop-up: level again at a heading of 45 degrees, fully calibrated
Figure: Level again.

The Graphs, the Event Log and the Check Page

The Graphs page plots the heading, the roll, the pitch and the system calibration. The Event log keeps the start, the mode switch, the scene and every change of CALIB_STAT. The Check page sums up the run: VIN 5.00 V and about 12.3 mA; 573 reads, 5 writes and 6 not acknowledged (while starting); NDOF with SYS_STATUS 5 and 1750 data updates at 100 Hz; heading 45.1, roll -0.2 and pitch -0.1 with the board at 45.0, 0.0 and 0.0; the calibration 3, 3, 3, 3 (CALIB_STAT 0xFF).

BNO055 Proteus simulation graphs: the heading, the roll, the pitch and the calibration
Figure: The Graphs page.
BNO055 Proteus simulation Event log: the start, NDOF, the scene and CALIB_STAT
Figure: The Event log.
BNO055 Proteus simulation Check page after the demo run
Figure: The Check page.

The monitor shows the sketch's side: the chip found, the mode, the alarms and a line every second.

Arduino UNO V4.0 serial monitor in the BNO055 Proteus simulation: the set-up, the angles and the calibration
Figure: The monitor.

BNO055, MPU9250, ADXL345 or a Compass?

Each motion sensor has its place. An accelerometer alone - our ADXL345 Accelerometer Library for Proteus - measures tilt well when the board is still and is great for a tap or a free fall, but it cannot tell a turn on a flat table. A compass - our HMC5883L / QMC5883L Compass Library for Proteus - gives a heading only while it is held level, unless you correct it with an accelerometer. A 9-axis sensor like the one in our MPU9250 Library for Proteus has everything, but the fusion is your job: a Madgwick or Mahony filter in your sketch, tuned by you. The BNO055 costs more and has fewer settings, but it hands you a finished, calibrated orientation - the quickest way from a box of parts to a working balancing robot or a head tracker.

Try It Yourself

  • Click Turn 90: the heading climbs by 90 degrees over 3 seconds, and the needle on the board follows.
  • Click Roll 30 and then Pitch 20: the horizon on the OLED tilts and drops, and TILT stays dark until 25 degrees.
  • Click Shake: the linear acceleration jumps, the roll shivers and the TILT LED lights.
  • Write OPR_MODE = 0x08 (IMU) in the sketch: the heading starts from 0 wherever the board points - no magnetometer, no north.
  • Set PROFILE to STEADY with ROLL 45: the board starts tilted, and the sketch reads 45 degrees from the first line.

Ideas to Extend the Demo

  • Balance a two-wheeled robot on the pitch angle with a PID loop and a motor driver.
  • Point a camera on two servos so it keeps looking at the same spot as the board turns.
  • Save the calibration offsets (0x55 - 0x6A) to the EEPROM and write them back at start.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real BNO055

  • The start-up: wait 650 ms after power-up and read CHIP_ID until it is 0xA0.
  • CONFIG mode: UNIT_SEL, the axis mapping and the offsets change only in CONFIG; switch back to a fusion mode afterwards.
  • Calibration: keep it still, move it in a figure eight and hold it at a few angles after each power-up - or save and restore the offsets.
  • Magnetic fields: mount it away from steel, motors and speakers; the heading follows any field near it.
  • Clock stretching: the BNO055 holds the I2C clock while it prepares data; an UNO handles it, some boards need a slower bus.

Troubleshooting

  • No answer at 0x28: the chip is still starting, or ADDRESS is 0x29 - check VIN and the SDA and SCL wires.
  • The angles stay at zero: the chip is in CONFIG mode - write OPR_MODE = 0x0C.
  • A setting is ignored: it can only be written in CONFIG mode; the event log says so.
  • The heading wanders: the magnetometer is not calibrated yet - turn the board through a good part of a circle.
  • The part is not simulated: TEPBNO055.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The registers, the modes and their timing, the start-up, the data formats and units follow the maker's datasheet; the module is our own drawing of a BNO055 board.
  • Our own choices: the motion scene and the chips, the calibration climbing with the movement, the heading error before the magnetometer is calibrated, the noise, the earth's field (48 uT, 60 degrees down) and 26 C.
  • Not modelled: the interrupts (INT stays low), the axis remapping, the effect of the offsets, the low-power modes, the clock stretching and the self-test timing.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or Bosch Sensortec.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the BNO055 Orientation Sensor Library for Proteus Simulation. I hope it helps you build your balancing robot, your drone's attitude display or your head tracker before the real board arrives - and shows that orientation does not have to be hard: three sensors, one fusion, and the answer in six bytes. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation