Tag Archives: Inclinometer

9-Axis IMU LESSON 6: Determine Tilt From 3-axis Accelerometer

Adafruit BNO055 9-axis Sensor Connected to an Arduino Nano

This lesson shows you some of the simple math, that will allow you to approximate tilt angle from a three axis accelerometer. In this entire series of lessons, we are using the BNO055 9-axis sensor connected to an Arduino Nano. It is possible to approximate tilt along the x-axis and tilt along the y-axis. These could roughly be considered to be like the Euler Angles of Pitch and Roll. It should be noted that the approximations are reasonable for tilt angles less than 45 degrees. Also note, that in this simple demonstration, real acceleration will be interpreted as tilt, hence the system will incorrectly interpret motion as tilt. Because of this, this approach should not be used on things like drones or other moving systems. It is just for simple demonstration purposes.

The code developed in the video above is included below for your convenience.

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how to work with this sensor in benchtop presentations.