NMEA0183 protocol for GPS module programming

Source: Internet
Author: User

 NMEA0183 protocol for GPS module programming
By drizzle QQ: 253786989

NMEA 0183 is a standard format developed by National Marine Electronics Association for Marine electronic devices. Now it has become the standard RTCM (Radio Technical Commission for Maritime services) protocol for GPS navigation devices.

I used the GPS chip for debugging. It was produced by a Shenzhen Company. Basically connect to the antenna. If the voltage of the power supply pin is normal, you can read the GPS data through the serial port. Therefore, the most important part of GPS programming is data parsing. to parse data, you must understand the Protocol format.

The following set of data is the data obtained by a serial port when I am indoors and the chip is not connected to an antenna (the GPS chip will continuously output data ). This set of data does not read information such as latitude and longitude (all 0), but we can see the six output protocols of NMEA0183: $ GPGGA, $ GPGLL, $ GPGSA, $ GPGSV, $ uplmc, and $ GPVTG.

$GPGGA,235949.042,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*45$GPGLL,0000.0000,N,00000.0000,E,235949.042,V,N*47$GPGSA,A,1,,,,,,,,,,,,,,,*1E$GPGSV,1,1,00*79$GPRMC,235949.042,V,0000.0000,N,00000.0000,E,,,140209,,,N*7E$GPVTG,,T,,M,,N,,K,N*2C

The following describes the data formats of these six different output protocols in detail.

(1) $ GPGGA (GPS Positioning Information)

Protocol format:

$GPGGA,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>,<12>,<13>,<14>*hh<CR><LF>

Sample Data:

$GPGGA,161229.487,3723.2475,N,12158.3416,W,1,07,1.0,9.0,M, , ,,0000*18

Detailed analysis of protocol formats:

(2) $ GPGLL (geographic location information)

Protocol format:

$GPGLL,<1>,<2>,<3>,<4>,<5>,<6>*hh<CR><LF>

Sample Data:

$GPGLL,3723.2475,N,12158.3416,W,161229.487,A*2C

Detailed analysis of protocol formats:

(3) $ GPGSA (current satellite information)

Protocol format:

$GPGSA,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>,<12>,<13>,<14>,<15>,<16>,<17>*hh<CR><LF>

Sample Data:

$GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33

Detailed analysis of protocol formats:

(4) $ GPGSV (Visible satellite information)

Protocol format:

$GPGSV, <1>,<2>,<3>,<4>,<5>,<6>,<7>,...,<4>,<5>,<6>,<7>*hh<CR><LF>

Sample Data:

$GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71$GPGSV,2,2,07,09,23,313,42,04,19,159,41,15,12,041,42*41

Note that there are two pieces of sample data here, because currently there are a total of seven visible satellites, but each statement can contain up to four satellites, therefore, it is divided into two statements. Each satellite has four data items: <4> (Satellite Number), <5> (satellite elevation), and <6> (satellite Azimuth), <7> (signal-to-noise ratio ).

Analyze the Protocol format in detail (analyze only 1st sample data statements ):

(5) $ uplmc (simplest positioning information)

Protocol format:

$GPRMC,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>*hh<CR><LF>

Sample Data:

$GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,,*10

Detailed analysis of protocol formats:

(6) $ GPVTG (ground speed information)

Protocol format:

$GPVTG,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>*hh<CR><LF>

Sample Data:

$GPVTG,309.62,T, ,M,0.13,N,0.2,K*6E

Detailed analysis of protocol formats:

With the detailed learning on the NMEA0183 protocol, the rest is serial programming. Whether using a single-chip microcomputer or a Windows/WinCE/Linux system, it is easy to write a serial program to read the data. The rest is to use c ++ to find Algorithm functions, or the function related to the MFC CString can be parsed.

NMEA0183 protocol for GPS module programming
By drizzle QQ: 253786989

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.