Applying a Low Pass Filter to Roll and Pitch Calculations on the MPU6050

In today’s video lesson we show how you can remove the vibration noise from your roll and pitch values using a low pass filter. The filter removes the high frequency noise resulting from vibrations.

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

Below is the code we developed 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:

 

Using Arduino to Calculate Roll and Pitch from MPU6050 3-axis Accelerometers

In this video lesson we show you how to take the calibrated accelerometer data from the MPU6050 and use it to calculate the tilt of the board. We can calculate tilt in two axis, or the roll and the pitch. This is the schematic for the project:

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

This is the code we developed in the video to calculate the roll and pitch from the three axis accelerometer data.

 

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:

 

Using Arduino to Calibrate the MPU6050 Accelerometers

In this video lesson we show you how to calibrate the accelerometers on the MPU6050. You will have to find the min and max accelerometer numbers for your particular board, but I show you how in the video. Below, we show the schematic of how our circuit is connected.

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

In the lesson we developed the following code. Measure your min and max values of the three accelerometers according to the instructions in the video. Then enter those numbers in the code below, and un-comment out the commented lines. If you run the code as-is below, it should work, but the results will be uncalibrated and not as accurate as possible.

 

Making The World a Better Place One High Tech Project at a Time. Enjoy!