If I were to hazard a guess, I’d assume that you are here because you hooked up a Global Navigation Satellite System (GNSS) module to a microcontroller and now you are confused about which data to use. The most commonly used GNSS worldwide is the Global Positioning System (GPS). As a result, the term “GPS” is frequently used to refer to the entire set of tools and procedures involved in estimating a user’s location using a GNSS. The National Marine Electronics Association (NMEA) has a standard for the formatting of GPS information. Nearly all GNSS receivers output NMEA data. In this article, we shall go into great detail on GGA, RMC, and GLL NMEA sentences.
NMEA standard sentence structure
The NMEA 0183 is a messaging protocol standard. These messages consist of sentences with data transmitted from a single talker to one or more listeners. Each sentence contains various bits of data that are separated by commas.
All NMEA sentences start with the “$” sign and end with Carriage Return (CR) and Line Feed (LF). The data within the sentence is separated by commas to make it easier to read and parse by microcontrollers. Each NMEA message has a checksum before the CR. For the data in the NMEA sentence, printable ASCII format is used.
NMEA sentences include a Talker Identifier (ID) after the “$” sign. The talker ID is a two-character prefix that identifies the type of the transmitting unit. NMEA 0183 talker identifier mnemonics of navigation satellite system receivers are provided in Table 1.
Table 1. NMEA 0183 talker identifier mnemonics: navigation satellite system receivers.
ID | NAVIGATION SATELLITE SYSTEM RECEIVERS | REGION/COUNTRY |
GA | European Global Navigation System (Galileo) | Europe |
GB | BeiDou Navigation Satellite System (BDS) | China |
GI | Navigation Indian Constellatiozn (NavIC) | India |
GL | Globalnaya Navigazionnaya Sputnikovaya Sistema (GLONASS) | Russia |
GN | Global Navigation Satellite System (GNSS) | *multiple |
GP | Global Positioning System (GPS) | US |
GQ | Quasi-Zenith Satellite System (QZSS) | Japan |
*Note: The “GN” Talker Identifier shall be used when the data in the sentence is produced from a combination of multiple satellite systems.
The next three letters after talker ID are the protocol header, which defines the message content. We will discuss messages containing GGA, RMC, and GLL protocol headers.
GGA – Global Positioning System Fix Data
Time, position, and fix related data for a GNSS receiver.
Format:
$<TalkerID>GGA,<Timestamp>,<Lat>,<N/S>,<Long>,<E/W>,<GPSQual>,<Sats>,<HDOP>,<Alt>,<AltVal>,<GeoSep>,<GeoVal>,<DGPSAge>,<DGPSRef>*<checksum><CR><LF>
Table 2 contains the values for the following example:
$GNGGA,062735.00,3150.788156,N,11711.922383,E,1,12,2.0,90.0,M,,M,,*55
Table 2. GGA Data Format
Field | Char | Example | Description |
$ | Char | $ | Each NMEA message starts with “$“ |
TalkerID | String, 2 character | GN | The talker ID.GP: For GPSGL: For GLONASSGA: For GalileoGB: For BeiDouGI: For NAVIC (IRNSS)GQ: For QZSSGN: For multi-constellation mode |
Timestamp | hhmmss.sss | 062735.00 | UTC time of GNSS sample:hh: hours (Fixed two digits)mm: minutes (Fixed two digits)ss: seconds (Fixed two digits).ss: decimal fraction of seconds |
Lat | DDMM.MMMMM | 3150.788156 | Latitude as degrees:DD: Degrees (Fixed two digits)MM: Minutes (Fixed two digits).MMMMMM: Decimal fraction of minutes |
N/S | N or S | N | Latitude direction:N = NorthS = South |
Long | DDDMM.MMMMM | 11711.922383 | Longitude as degrees:DDD: Degree (Fixed three digits)MM: Minutes (Fixed two digits).MMMMMM: Decimal fraction of minutes |
E/W | E or W | E | Longitude direction:E = EastW = West |
GPSQual | Decimal, 1 digit | 1 | 0 = Fix not available or invalid1 = GPS, SPS Mode, fix valid2 = Differential GPS, SPS Mode, fix valid6 = Estimated (dead reckoning) mo |
Sats | Decimal, 2 digits | 12 | Number of satellites in use. |
HDOP | x.x | 2.0 | Horizontal dilution of precision. |
Alt | x.x | 90.0 | Height above mean sea level. |
AltVal | M | M | Reference unit for altitude:M = meter |
GeoSep | x.x | Null | Geoidal separation measures in meters. |
Geoval | M | M | Reference unit for geoidal separation:M = meters |
DGPSAge | x.x | Null | Age of differential corrections, sec |
DGPSRef | xxxx | Null | Differential reference station ID |
* | * | End character of data field | |
Checksum | 55 | Hexadecimal checksum |
RMC – Recommended minimum specific GPS/Transit data
Time, date, position, course, and speed data provided by a GNSS receiver.
Format:
$<TalkerID>RMC,<Timestamp>,<Status>,<Lat>,<N/S>,<Long>,<E/W>,<SOG>,<COG>,<Date>,<MagVar>,<MagVarDir>,<mode>,<NavStatus>*<checksum><CR><LF>
Table 3 contains the values for the following example:
$GNRMC,060512.00,A,3150.788156,N,11711.922383,E,0.0,,311019,,,A,V*1B
Table 3. RMC Data Format
Field | Char | Example | Description |
$ | Char | $ | Each NMEA message starts with “$“ |
TalkerID | String, 2 character | GN | The talker ID.GP: For GPSGL: For GLONASSGA: For GalileoGB: For BeiDouGI: For NAVIC (IRNSS)GQ: For QZSSGN: For multi-constellation mode |
Timestamp | hhmmss.sss | 060512.00 | UTC time of GNSS sample:hh: hours (Fixed two digits)mm: minutes (Fixed two digits)ss: seconds (Fixed two digits).ss: decimal fraction of seconds |
Status | A or V | A | Validity of data:A = validV = invalid |
Lat | DDMM.MMMMM | 3150.788156 | Latitude as degrees:DD: Degrees (Fixed two digits)MM: Minutes (Fixed two digits).MMMMMM: Decimal fraction of minutes |
N/S | N or S | N | Latitude direction:N = NorthS = South |
Long | DDDMM.MMMMM | 11711.922383 | Longitude as degrees:DDD: Degree (Fixed three digits)MM: Minutes (Fixed two digits).MMMMMM: Decimal fraction of minutes |
E/W | E or W | E | Longitude direction:E = EastW = West |
SOG | x.x | 0.0 | Speed over ground in knots. |
COG | x.x | null | Course over ground. |
Date | ddmmyy | 311019 | Date in format ddmmy |
MagVar | x.x | null | Magnetic Variation, degrees |
MagVarDir | E or W | null | Magnetic Variation direction:E = EastW = West |
Mode | D, A, N or E | A | Positioning system mode indicator. |
NavStatus | S, C, U or V | V | Navigational status.S = SafeC = CautionU = UnsafeV = Navigational status not valid. |
* | * | End character of data field | |
Checksum | 1B | Hexadecimal checksum |
GLL – Geographic position – latitude and longitude
Latitude and longitude of vessel position, time of position fix and status.
Format:
$<TalkerID>GLL,<Lat>,<N/S>,<Long>,<E/W>,<Timestamp>,<Status>,<ModeInd>*<checksum><CR><LF>
Table 4 contains the values for the following example:
$GNGLL,3150.788156,N,11711.922383,E,062735.00,A,A*76
Table 4. GLL Data Format
Field | Char | Example | Description |
$ | Char | $ | Each NMEA message starts with “$“ |
TalkerID | String, 2 character | GN | The talker ID.GP: For GPSGL: For GLONASSGA: For GalileoGB: For BeiDouGI: For NAVIC (IRNSS)GQ: For QZSSGN: For multi-constellation mode |
Lat | DDMM.MMMMM | 3150.788156 | Latitude as degrees:DD: Degrees (Fixed two digits)MM: Minutes (Fixed two digits).MMMMMM: Decimal fraction of minutes |
N/S | N or S | N | Latitude direction:N = NorthS = South |
Long | DDDMM.MMMMM | 11711.922383 | Longitude as degrees:DDD: Degree (Fixed three digits)MM: Minutes (Fixed two digits).MMMMMM: Decimal fraction of minutes |
E/W | E or W | E | Longitude direction:E = EastW = West |
Timestamp | hhmmss.sss | 062735.00 | UTC time of GNSS sample:hh: hours (Fixed two digits)mm: minutes (Fixed two digits)ss: seconds (Fixed two digits).ss: decimal fraction of seconds |
Status | A or V | A | Validity of data:A = validV = invalid |
ModeInd | A or V | A | Positioning system mode indicator:A = Autonomous modeN = Data not valid |
* | * | End character of data field | |
Checksum | 76 | Hexadecimal checksum |
Summary
As can be seen from tables 2–4, each NMEA sentence that we discussed has a different structure and might have additional information compared to other sentences. If you just need “GPS” coordinates, any of the GGA, RMC, or GLL sentences will do the job. However, if you need specific information, like an object’s altitude, you will need to use GGA sentences. Similar to this, if you need information about the object’s speed, you will have to use RMC sentences. That said, NMEA sentences should be chosen according to the additional information that you need.