Category Archives: Arduino 9-Axis IMU Totorials

9-Axis IMU LESSON 11: Install Python

This is a quick lesson where we show you how to install Python on a Windows 10 machine. We have gone about as far as we can go on our 9-axis IMU project using only the arduino. What we want to do now is to pass the data we are taking from arduino to Python, and then use python to do animations and 3D renderings. So, to move forward, we will need to install Python, which is explained in the video.

9-Axis IMU LESSON 10: Making a Tilt Compensated Compass with Arduino

In this lesson we show you how to build a demo tilt compensated compass using the BNO055 9-axis sensor.  We go through some trigonometry to help you understand conceptually how the device works.

To play along at home, you will need an Arduino Nano, and an Adafruit BNO055 Inertial Measurement Sensor.

The code below is provided for your convenience. It is intended only for bench top demos, and should not be used in real applications. Just for fun, not for drones, or other actual control applications.

 

9-Axis IMU LESSON 9: Accurate and Stable Tilt Using Accelerometers, Gyros and a Complimentary Filter

In this lesson we show how a complimentary filter can be used to create the best of both worlds in approximating tilt from data coming from the accelerometers and gyros. The goal of our complimentary filter is to weight our overall result to take advantage the short term accuracy of the gyro measurement, and combine it with the long term stability of the accelerometer. In effect the combination is applying a high pass filter to the gyro and a low pass filter to the accelerometer. Remember that the angles are approximate, and were developed assuming roll and pitch stay under 45 degrees. The trigonometry becomes more difficult when considering higher tilt angles.

To play along at home, you will need an Arduino Nano, and an Adafruit BNO055 Inertial Measurement Sensor.

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how a complimentary filter works. Of course, any real systems need to go into much more depth than the simple demo project below.

 

9-Axis IMU LESSON 8: Using Gyros for Measuring Rotational Velocity and Angle

In this lesson we explore approximating the roll and pitch of our sensor using only the gyros. The advantage of gyros is that they are not susceptible to vibration as much as the acceleromters. In the video we show you how you can simply approximate roll and pitch from the data coming from the gyroscopes. Note that while the gyros do not have the noise problem seen in the accelerometers, we now have a new problem that the gyros are susceptible to long term drift. As you play with these devices what you end up seeing is you will need to combine the data from the accelerometers and the gyros in a clever way to take advantage of the long term stability of the accelerometers and the noise immunity of they gyros. In effect, you will want to apply a high pass filter to the gyro data, and a low pass filter to the acceleromters.

To follow along at home, you will need an Arduino Nano, and an Adafruit BNO055 Inertial Measurement Sensor. We suggest using identical hardware if you want to follow along as different sensors have very different characteristics, and things will work much better for you if we are using the same sensor

This is the code which we developed in the video to demonstrate these concepts.

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.

 

9-Axis IMU LESSON 7: Understanding Low Pass Filters


In this project, we have shown how accelerometers can be used to approximate tilt. We showed in Lesson 6 how vibration can cause a problem with such a strategy, as the system will interpret vibration to be changes in tilt. A partial solution to this problem can be to program a low pass filter into the project. The video above introduces you to the concept of a low pass filter, and shows some simple examples of programming and using a low pass filter to reduce noise.

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.