Ultimate 9-axis Program for Easily and Accurately Calibrating a 9-axis IMU on Arduino

In this video lesson we show how to easily calibrate a 9-axis IMU. We are using the GY-87 IMU module which contains a MPU6050 for measuring acceleration and rotational velocity, and the QMC5883L magnetometer. In this work, we have three programs. The first is simple arduino program for measuring and printing the data from the 9 sensors. Then, the second program is a python program on your PC which will allow you to simply and accurately calibrate the 9 sensors, from the data coming from the first program. Then the third program is a program on the arduino that reads the data from the sensors, and then uses the calibration data that was generated to create accurate, calibrated sensor data.

This is the schematic of the circuit we are working with:

MPU6050
Schematic for connecting the GY-87 module to the Arduino

Then this is the arduino code we use to calibrate the sensors:

This next program is to be run on your PC. It is a python program that will read the data coming from the arduino, and will then help you calibrate your sensors.

Then finally we take the calibration parameters from the python program, and incorporate them on the Arduino side to allow reading the data from the sensors, and reporting calibrated numbers. Remember, in the program below, you should use your calibration parameters instead of mine. That is, edit the program below for your specific calibration numbers.