Basic intro to how GPS works:
A GPS module receives data from different satellites(24 satellites are orbiting the earth for this purpose). GPS calculates the distance between the receiver and the position of three or more satellites to zero in on the position of the receiver. This is a simple way of explaining how a GPS module works.
The location of the GPS satellite is monitored by the United States Department Of Defence(DOD). The DOD can predict the paths of the satellites vs. time with great accuracy. Furthermore, the satellites can be periodically adjusted by huge land-based radar systems. Therefore, the orbits, and thus the locations of the satellites, are known in advance.
The GPS satellites sends to the receiver data in the form of some codes. Which start with a $ symbol followed by a 5 letter code. Here are all the short descriptions with their interpretations:
$GPBOD - Bearing, origin to destination $GPBWC -Bearing and distance to waypoint, great circle $GPGGA- Global Positioning System Fix Data $GPGLL - Geographic position, latitude / longitude $GPGSA - GPS DOP and active satellites $GPGSV - GPS Satellites in view $GPHDT - Heading, True $GPR00 - List of waypoints in currently active route $GPRMA - Recommended minimum specific Loran-C data $GPRMB - Recommended minimum navigation info $GPRMC - Recommended minimum specific GPS/Transit data $GPRTE - Routes $GPTRF - Transit Fix Data $GPSTN - Multiple Data ID $GPVBW - Dual Ground / Water Speed $GPVTG - Track made good and ground speed $GPWPL - Waypoint location $GPXTE - Cross track error, Measured $GPZDA - Date & Time
Let’s try using an example to understand this better:
Here is a GPRMC code received on a GPS device and the interpretation of all the codes are also given below.
1. $GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68
- 225446 – Time of fix 22:54:46 UTC
- A – Navigation receiver warning A = Valid position, V = Warning
- 4916.45,N – Latitude 49 deg. 16.45 min. North
- 12311.12,W – Longitude 123 deg. 11.12 min. West
- 000.5 – Speed over ground, Knots
- 054.7 – Course Made Good, degrees true
- 191194 – UTC Date of fix, 19 November 1994
- 020.3,E – Magnetic variation, 20.3 deg. East
- *68 – mandatory checksum
I used an Arduino to decode these info and display it on my PC. Here is how it works:
I connected the GPS module, which has got an RS232 output just like the serial port you can see on the rear end of your CPU, to a converter, that converts the output to UART (Universal Asynchronous Receiver Transmitter) so that Arduino can read it. Connecting it to the Rx (Receiver) – Tx (transmitter) ports in the arduino and wrote a code to extract the information hidden in the GPS data.
I’ll write about it in my next post.
Here is the GPS module that I used and you can see the RS232 output going to the converter (At the back of the image), from there to the Rx- Tx of the Arduino.