Improving Digital Compass Accuracy With a Low Pass Filter

In this video lesson we add a low pass filter to our calibration and digital compass program. This allows more precise calibration, and removes the jitter from the digital compass display. We continue to use the QMC5883L 3-Axis Magnetometer, which is on our GY-87 IMU module. We are using the following schematic for our project:

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

We collect the data using the GY-87 connected to an Arduino. Below is the simple program which takes the magnetometer data and sends it to the serial port.

The code for the Python side to do the calibration and display a Digital Compass is: