Category Archives: Tutorial

Tilt Compensated Digital Compass

In this video lesson we show how to create a tilt compensated digital compass. Calculating heading based simply on the measured magnetometer values  in the X and Y directions only works accurately when the compass is sitting flat, or horizontal with the earth’s surface. If we introduce a tilt, either by applying pitch or roll to the system, calculated heading, or yaw will no longer be accurate. In the video above, we show you how to mathematically ‘un-tilt’ the sensor to get accurate heading  readings when the device is not perfectly flat.

We are working with a GY-87 9-axis IMU, and an Arduino Uno R4 WiFi. Below is the schematic we are using in this project:

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

For your convenience, the code developed in this video lesson is included below. Please notice that the calibration constants in the code below are for my GY-87 module. You need to calibrate your own module, as my numbers below would likely be different from your numbers. We showed how to do the calibration in THIS LESSON.

 

Using Arduino and MPU6050 to Measure Rotational Velocity with the Gyros

In this video lesson I show you how you can measure rotational velocity using the gyroscopes on the MPU6050 IMU module on the GY-87 board.

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

Below is the code which we develop in this lesson.

 

Getting Altitude Data from the GPS NMEA Sentences

In this video lesson we show you how you can parse NMEA sentence from your Adafruit Ultimate GPS to get the Altitude of your GPS tracker. At this point, our project has grown to  the point that all our data will not fit on the small OLED screen, so we have also added pushbuttons to allow us to toggle between display screens. For this project we are using the following circuit schematic:

GPS Tracker
This is the schematic we are using as we move forward in the class.

For your convenience, the code developed in the video is below:

 

Getting UTC Atomic Clock Time and Date from GPS and Raspberry Pi Pico W

In this video lesson we show how you can get extremely accurate time reference from your Adafruit Ultimate GPS V3. We show that atomic clock time is encoded in the NMEA sentences, and is in UTC. We show how to retrieve the data, and convert to your local time. In this video I compensated for the clock rolling from one day to the next, for positive UTC correction time, but did not account for clock rollover for negative UTC correction times. Also, several pointed out that you have to also compensate for calendar rollover at the end of the month, and the end of the year. The video shows how we are approaching the problem, and then the code below includes the compensations we did not do in the video. The code is heavily commented so hopefully you will be able to follow it.

Pi Pico GPS
Schematic for our GPS Tracker with OLED Display

For your convenience, the code developed in the lesson is presented below:

 

Raspberry Pi Pico GPS Tracker with OLED Display

In this video tutorial we develop a GPS tracker based on the Raspberry Pi Pico W and the Adafruit Ultimate GPS V3. We include a SSD1305 OLED display. The project will use the schematic below:

Pi Pico GPS
Schematic for our GPS Tracker with OLED Display

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