Calibrated Compass Display in Python and PyQt5

In this video lesson we develop a Graphical Digital Compass using python and PyQt5. The data comes from a QMC5883L magnetometer connected to an arduino. The magnetometer is on the GY-87 IMU module. The arduino sends the raw data to python. With the raw data in Python, we then calibrate the sensor, and create a graphical representation of a digital compass. The circuit schematic we are using is:

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

The simple program for collecting the raw data on Arduino is:

On the python side, this is the code we developed which both calibrates the magnetometers, and displays a Digital Compass.