So in the past few years Global Positioning System, GPS, has really started to hit the consumer market in a big way, once it was a tool to find the “enemy”, then moving into the Nautical, Aeronautical and mapping industries, it’s now a tool that can save marriages.
We have had the Serial connected and Bluetooth standalone GPS devices to play with for a while now. I played with my first GPS connected Pocket PC/Windows Mobile back in 2001 (anyone else remember the Navman on the iPaq’s?)
But now we are getting treated to Windows Mobile Devices with GPS chips inside! Sweet... So what does it all mean? How are you able to get my exact position and how the hell can I build Windows Mobile app’s for them?
Well listen up and I’ll tell you J
GPS was invented by the yanks... Well the U.S. Department of Defense, who spent billions of $$$ to enable a way to pin point the exact position of the unit, and who/what was carrying it... It’s a very complex thing and to be honest I don’t think I could do a better job at explaining the details better than this site...
But the gist is that at any one time above the sky there will be at least 12 satellites that beam down a radio signal that contains a set of NMEA sentences. These are translated by the system within the device and are outputted into whatever application you have running to either tell you simply your Latitude and Longitude or with more complex systems visual display your location on rolling 3d maps.
If you have got a GPS chip inside your Windows Mobile Pocket PC or Smartphone or connected via a BT or serial connection to the Windows Mobile device, you too can use these NMEA (National Marine Electronics Association of America) sentences. With the help of a parser in .net Compact Framework we can decode these sentences to collect the information we need...
For your own (and mine too) reference I thought I’d pass you what a sentence is made up of and what they mean...
Each sentence starts with a ‘$’ and ends with a line feed. It is no more than 80 characters long (not including the $ or LF) also some sentences come with a check sum. Now to the actual data within a sentence.
The first part is a set of letters representing which sentence is about to be sent. Here is a non exhaustive list.
GGA - Fix information
GLL - Lat/Lon data
GRS - GPS Range Residuals
GSA - Overall Satellite data
GST - GPS Pseudorange Noise Statistics
GSV - Detailed Satellite data
RMC - recommended minimum data for gps
ZTG - Zulu (UTC) time and time to go (to destination)
ZDA - Date and Time
Now these all have their own uses in systems, but the one’s I have found the most useful GGA, RMC and the GSA.
GPGGA gives you the current fix data, GPRMC contains the minimum location information (Lat, Long etc) and the GPGSA which gives you the satellites information..
Let’s have a look at each of them and decode them...
$GPGGA,123456,5130.20,N,05.43,W,1,10,1.1,47,M,-4,M,,*70
Name | Example Data | Description |
Sentence Identifier | $GPGGA | Global Positioning System Fix Data |
Time | 123456 | 12:34:56 UTC |
Latitude | 5130.20, N | 51d 30.20' N or 51d 30' 20" N |
Longitude | 05.43, W | 0d 5' 43" W |
Fix Quality: - 0 = Invalid - 1 = GPS fix - 2 = DGPS fix | 1 | Data is from a GPS fix |
Number of Satellites | 10 | 5 Satellites are in view |
Horizontal Dilution of Precision (HDOP) | 1.1 | Relative accuracy of horizontal position |
Altitude | 47, M | 280.2 meters above mean sea level |
Height of geoid above WGS84 ellipsoid | -4.0, M | -4.0 meters |
Time since last DGPS update | blank | No last update |
DGPS reference station id | blank | No station id |
Checksum | *70 | Used by program to check for transmission errors |
$GPRMC,123456, A, 5130.20,N,05.43,W,5,057,100107,020,E*65
Name | Example Data | Description |
Sentence Identifier | $GPRMC | Global Positioning System Recommended minimum specific |
Time | 123456 | 12:34:56 UTC |
Navigation receiver warning | A | A = Valid, V = Warning |
Latitude | 5130.20, N | 51d 30.20' N or 51d 30' 20" N |
Longitude | 05.43, W | 0d 5' 43" W |
Speed | 5 | Speed over ground in Knots |
Course | 057 | Course Made Good, degrees true north |
UTC Date | 100107 | 10th December 2007 |
Magnetic variation | 020,E | 20 degrees East |
Checksum | *65 | Used by program to check for transmission errors |
$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39
Name | Example Data | Description |
Sentence Identifier | $GPGGA | GPS DOP and active satellites |
Mode | A | M=Manual (2D or 3D) A=Automatic (2D/3D) |
Mode | 3 | 1=Fix not available, 2=2D, 3=3D |
Satellite Vehicles | 04,05,,09,12,,,,, | Up to position 14 in the sentence can be used. |
PDOP | 2.5 | Position Dilution of Precision |
HDOP | 1.3 | Horizontal Dilution of Precision |
VDOP | 2.1 | Vertical Dilution of Precision |
Checksum | *75 | Used by program to check for transmission errors |
As you can see you can now get use this type of information to good use in your applications...
Next time I talk on this I’ll show you how to “Mash up” this information with Virtual Earth and see where you are planet earth J