Wait till you get 2 more commas (,) the next 10 characters indicates the LONGITUDE. The next 9 characters indicate the LATITUDE. If this character is A then GPS is activated otherwise GPS is not activated. If string is matched then wait till you will get two 2 commas, next character indicates weather the GPS is activated or not.
The first received 6 characters from GPS module are compared with string $GPRMC, if matched then will go for further process otherwise repeat the same process again. We have to receive the data to the controller form GPS module serially using UART protocol and now extract the latitude and longitude values from the received messages and display them on LCD.Įxtraction of Latitude and Longitude values from NMEA Format: In this project LATITUDE and LONGITUDE values are extracted from NMEA format and displayed on LCD.
In this NMEA format, the LATITUDE and LONGITUDE values of location are available in GPRMC sentence. The GPS receiver continuously transmits the data as per the NMEA standards using RS232 protocol. Here max232 IC is used for level conversion. Controller RXD pin is connected to the 12 th pin of max232. The receiver pin of GPS module is connected to the 13 th pin of max232 IC and GND pin is connected to ground. Here pot RV1 is used to adjust the contrast of LCD. The latitude and longitude values of the location are displayed on LCD. In the above circuit, LCD (Liquid crystal display) data pins are connected to PORT2 of the controller and control pins RS, RW and EN are connected to the P1.0, P1.1 and P1.2 respectively. Circuit Diagram: Circuit Diagram of Interfacing GPS to 8051 Microcontroller Circuit Components: The received raw data is converted for the user as LATITUDE, LONGITUDE, ALTITUDE, SPEED and TIME. This information is used to calculate the position of the GPS receiver.
GPS receiver measures the distance to each satellite based on the arrival time of each message. Each satellite transmits the messages continuously which contains time was sent. GPS module calculates the position by reading the signals that are transmitted by the satellites.