Practical ARDUINO #3 – GPS - Part 1 GPS basicsThere several potential uses of a GPS unit in a model boat. I will cover some of the practical uses over the next few months.
Here is a introduction to using a GPS sensor.
Most GPS units start supplying data to a serial interface shortly after they have been powered up even if there is no lock (lock = minimum number of satellites being received for accurate data)
GPS data is normally in the form of
NEMA sentences -
National
Marine
Electronics
Association.
Each NEMA sentence contains various bits of data organized in comma delimited format (i.e. data separated by commas).
Here’s example NMEA sentences from a GPS receiver:
- $GPRMC,235316.000,A,4003.9040,N,10512.5792,W,0.09,144.75,141112,,*19
- $GPGGA,235317.000,4003.9039,N,10512.5793,W,1,08,1.6,1577.9,M,-20.7,M,,0000*5F
- $GPGSA,A,3,22,18,21,06,03,09,24,15,,,,,2.5,1.6,1.9*3E
In the example below the
NEMA GPGGA sentence contains:
$GPGGA,235317.000,4003.9039,N,10512.5793,W,1,08,1.6,1577.9,M,-20.7,M,,0000*5F
- Time: 235317.000 is 23:53 and 17.000 seconds in Greenwich mean time
- Longitude: 4003.9040,N is latitude in degrees.decimal minutes, north
- Latitude: 10512.5792,W is longitude in degrees.decimal minutes, west
- Number of satellites seen: 08
The GPS unit updates the sentences at an interval called the update rate. Most receivers update this information once per second (1Hz)
To make use of the data contained in the NEMA sentence we need to be able to read it and then split it down into the parts we are interested in – for example time or altitude.
This sentence “splitting” process is known as parsing
The Arduino very capable at reading the GPS sensor and parsing the NEMA sentences.
Part 2 – This will follow shortly – it will cover measuring speed using a GPS sensor connected to an Arduino