Tag Archives: Compass

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.

 

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.