Week Seven GPS (2/June/2014 - 8/June/2014)
The Global Positioning System (GPS) is a space-based statellite navigation system that provides location and time information on all weather conditions. It maintained by the US government and is freely accessible to anyone with a GPS receiver.
In this page, we do not want to discuss its background, we want to know how to interpret the satellite positioning data.
In this page, we do not want to discuss its background, we want to know how to interpret the satellite positioning data.
- There are a lot of GPS receivers in the market. We are using 3DR GPS MTK V2.0 now, as shown below.
2. Connect GPS receiver to the Arduino Mega 2560
Next, wrie code to Arduino Mega 2560, the code very simple.
void setup()
{
Serial.begin(38400);
Serial1.begin(38400);
Serial.flush();
Serial1.flush();
}
void loop()
{
if(Serial1.available())
{
Serial.write(Serial1.read());
}
}
void setup()
{
Serial.begin(38400);
Serial1.begin(38400);
Serial.flush();
Serial1.flush();
}
void loop()
{
if(Serial1.available())
{
Serial.write(Serial1.read());
}
}
- Open the COM port used by Arduino Mega 2560, you will see the received data from the GPS.
$GPGGA,003121.200,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7E
$GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
$GPRMC,003121.200,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*6F
$GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
$GPGGA,003121.400,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*78
$GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
$GPRMC,003121.400,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*69
$GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
$GPGGA,003121.600,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7A
$GPGSA,A,3,22,31,25,14,,,,,,,,,2.81,2.63,0.99*0E
$GPGSV,3,1,11,22,73,029,14,18,51,120,18,31,48,306,39,50,42,091,*7C
$GPGSV,3,2,11,25,33,050,28,14,24,011,29,21,22,164,,16,14,205,*7D
$GPGSV,3,3,11,29,11,117,,27,04,224,,193,,,*4B
$GPRMC,003121.600,A,0120.4690,N,10341.9579,E,0.00,151.76,080614,,,A*6B
$GPVTG,151.76,T,,M,0.00,N,0.00,K,A*39
This is a part of GPS data, it looks terrible. Starting, you may feel very afraid, confused, don't know how to read it. But in fact, you can refer to the following web site, it explains the meaning of each of the data represented in detail.
http://aprs.gids.nl/nmea/
These data have been repeat and repeat, but what I need is the location, we want to know where we are, so we need to read $GPGGA this sentence.
$GPGGA,003121.200,0120.4690,N,10341.9579,E,1,4,2.63,-45.2,M,3.2,M,,*7E
- From the above table, we can know that we are at 01° 20' 28" 140 North and 103° 41' 57" 474 East.
Next, you can enter the location return by GPS receiver into the Google map: 1°20'28.140'' 103°41'57.474'' and it will show where we are.