All posts by admin

Create a KML File to Display your GPS Data on Google Earth

Below we show you an example KML file that allows you too display your logged GPS data on Google Earth. For simplicity, we have included two GPS points. First, notice that the ordered pairs are Longitude,Latitude. Notice this is reversed of what we would normally expect, but it is important to note the order . . . Longitude must be put as the first term in the ordered pair. Also notice that the ordered pair of data show up two times in the file. The first is to create the dot, or placemark on the map, and the second list creates the line over your logged path. Now, the challenge for you is to write a python program that takes your log.txt file, which contains simple comma delimited data, lat,lon, and use that to generate a .kml file as shown below.

 

Plotting X-Y-Z Magnetometer Data for Accurate Calibration

In this video lesson we create a PyQt5 Widget in Python to help calibrate the QMC5883L 3-Axis Magnetometer on the GY-87 module. The Widget plots the data coming from the Magnetometer in real time to allow more accurate calibration.

This is the circuit schematic for our project:

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

This is the simple code for the arduino to generate the raw data;

This is the code we run on the Python side to plot the raw data:

 

Logging GPS Data on Your Raspberry Pi Pico W GPS Tracker Project

In this lesson I show you how to log GPS data to the flash memory on your Raspberry Pi Pico W. This allows you to not only know where you are, but to also know where you have been. In this lesson, this is the schematic of your project circuit.

GPS Tracker
Schematic for Controlling GPS Tracker from the Breadvolt

For your convenience, here is the code we developed in the the video:

 

Transfer Data Log Files from the Raspberry Pi Pico W to Your Desktop PC

Many Raspberry Pi Pico W project in microPython require the logging of sensor data. With these log files, we need a convenient way to transfer the data from the Pi Pico to a desktop PC. In earlier lessons, we showed how to log data to the Pi Pico flash memory. In today’s lesson we show how to transfer those log files to your PC. This is the code we developed in the video lesson.

 

Calibrating a 3-Axis Magnetometer

In this video lesson we show you how to calibrate the QMC5883L 3-axis magnetometer. The lesson is geared toward this specific magnetometer, but the procedure will be the same for any 3-axis magnetometer. We then use the calibrated reading to measure and calculate the magnetic heading of the device. With this, we have created a calibrated digital compass. In this lesson we are using the GY-87 module, which contains the QMC5883L magnetometer. We are connecting the module to the arduino using the following schematic:

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

In the video we develop two programs. The first program determines your sensor’s calibration constants. Then the second program uses those calibration constants to calculate heading, or yaw. The second program uses the offsets and scale parameters for MY PARTICULAR SENSOR. These values were determined using the first program. You must determine these values for your sensor, and then edit the second program to use your particular calibration parameters.

Program to determine your calibration parameters:

Once you get your calibration parameters, then put them into this program. This program will then calculate your compass heading: