A speedometer is a speed measuring gauge used to calculate the speed of motor vehicles. They are mainly of two types- electronics and mechanical. A digital speedometer measures the speed and mileage in vehicles. Normally both types work on the principle of electromagnetism, however, they have a disadvantage in that they cannot be used if there are no wheels on the moving object. Here I am introducing a simple digital GPS speedometer using PIC16F877A with an LCD display.
This GPS speed meter provides the location, speed, or other information of the moving objects based on GPS coordinates. The advantage of a digital speedometer with GPS is that it can be placed easily anywhere on moving objects such as vehicles, running men, flying helicopters, aircraft, boats, or ships. This system has an LCD Display which is used for monitoring the speed or any other information.
Using GPS as a speedometer, you can monitor much more information like speed, time, position, satellite in use, no of satellite, satellite ID number, and SNR (Signal to Noise ratio). The NMEA message from GPS gives the necessary information since NMEA sends a line of data based on the GPS coordinates.
Circuit Diagram for Gps Speedometer Using Pic 16f877a Microcontroller
- GPS Module
- LCD 2×16
- Crystal (20MHz)
- Capacitor (22PFx2, 10uF)
- Resistor (1K)
- POT (10K)
- 5V Supply
- 12V supply
Working of Simple Digital Speedometer Using Pic 16f877a
- As seen in the circuit diagram, our small GPS digital speedometer requires both 5 V and 12 V power supplies. This is because the GPS module needs 12 V and other components require 5 V only. We can generate both these voltages from a single power supply circuit, so 12 V is enough for doing the GPS speed meter project with PIC 16F877A.
- When power is supplied, GPS is turned ON and gets started to work.
- GPS module continuously gives NMEA sentences based on the GPS coordinates. NMEA sentences from the GPS signal include time, position, GPS receiver operating mode, active satellites used, number of GPS satellites in view, satellite ID number, SNR (signal to noise ratio) values, azimuth values, elevation, position, date, time and speed of the GPS system with speedometer.
- Every NMEA lines start with a dollar symbol ‘$’ which indicates starting of sentences. Every first sentence of GPS information will contain $GPGGA, which indicates global positioning system fixed values for the GPS system.
- The information content for each NMEA sentence is shown in the table given below.
- The given table below describes the values in the VTG sentence from the GPS system.
- In the GPS module by default, you will not get $GPVTG, you have to enable it by using SiRFDemo software. If you want to know how to enable VTG value, Insha Allah we will try to publish an article on that in the future.
- After enabling the VTG sentence, the GPS system will start giving values continuously. To get the optimum values for the GPS module we have to filter these sentence values.
- We only need the sentence starting with $GPVTG here, so I have filtered sentences starting with $GPVTG from the GPS module.
- I have used PIC 16F877A for receiving the filtered values and LCD2x16 for displaying the values.
- An infinite loop that continuously checks for receiving ‘$’ is programmed in the coding side. After receiving the data correctly, the controller then checks for the order ‘G’, ‘P’, ‘V’, ‘T’, and ‘G’ respectively.
- Each character is separated by commas in coding as shown above. A ‘for loop’ is programmed for generating 7 commas continuously (‘;’;) so the controller waits to receive it.
- After the 7 commas, an infinite loop is used to get the speed in km/hr unit. After collecting the sentences it is stored in a buffer and an LCD display is used for displaying the results.
These are the techniques I have used in designing this simple digital speedometer using PIC 16F877A.
In this article, we try to give you a brief idea about how to make a digital GPS speedometer using PIC16F877A. This is an important project especially if you are making an RC helicopter, car, or drone system to measure its real-time speed.