LCD-LED Display

Interfacing GPS with 8051 Microcontroller

An Interfacing GPS module is a device designed to utilize the Global Positioning System (GPS) for tracking the location of a vehicle or individual. These GPS receivers offer precise navigation, positioning, and timing information, accessible from any location on Earth at any time. The data is transmitted to these receivers by a network of 24 to 32 satellites comprising the global positioning system. GPS technology has gained immense significance in global navigation, as well as applications like land surveying, route marking, map creation, tracking and monitoring, commercial use, and various scientific applications. However, before delving into the details of this project, it’s advisable to first learn about connecting an LCD to an 8051 microcontroller.


  • Circuit Principle:
  • Circuit Diagram:
  • Circuit Components:
  • Circuit Design:
  • Circuit Simulation Video:
  • How to Operate?
  • Project Output Video:
  • Circuit Applications:
  • Download Project Code

Circuit Principle:

The GPS module determines its location by interpreting signals transmitted by the satellites. These satellites consistently broadcast messages that include the precise transmission time. By evaluating the time at which each transmission is received, the GPS receiver computes the distance to each satellite. From this data, the GPS receiver calculates its own position. This raw data is then transformed into user-friendly information such as LATITUDE, LONGITUDE, ALTITUDE, SPEED, and TIME.

Circuit Diagram:

Interfacing GPS

Circuit Diagram of Interfacing GPS to 8051 Microcontroller


  • at89c51 controller
  • Programming board
  • programming cable
  • 12V DC battery or adaptor
  • max232 IC
  • 16*2 LCD
  • GPS module
  • Pot 10k
  • 12 MHz crystal
  • Electrolytic capacitors – 1uF (4), 10u
  • Ceramic capacitors – 33pF (2)
  • Resistor – 10k

Circuit Design:

The LCD’s data pins are connected to PORT2 of the controller, while the control pins RS, RW, and EN are linked to P1.0, P1.1, and P1.2, respectively. The LCD displays latitude and longitude information about the location. The LCD’s contrast can be adjusted using the RV1 potentiometer. The GPS module’s receive pin is connected to the 13th pin of the max232 IC, while the ground (GND) pin is grounded. The controller’s RXD pin is connected to the 12th pin of the max232 for level conversion.

The GPS receiver employs the RS232 protocol to continuously transmit data following NMEA specifications. In this NMEA format, LATITUDE and LONGITUDE values for the location are available within GPRMC sentences. This project involves the serial reception of data from the GPS module to the controller using the UART protocol, followed by the extraction of latitude and longitude values from the received messages, which are then displayed on the LCD.

Extraction of Latitude and Longitude values from NMEA Format:

The initial step involves comparing the first six characters received from the GPS module with the string “$GPRMC.” If there is a match, the process proceeds; otherwise, it repeats. Upon matching, the program waits until it encounters two consecutive commas (‘,’). The subsequent character indicates whether the GPS is active or not, with ‘A’ signifying GPS is enabled, while any other character indicates it’s disabled. Following this, the program waits for the next comma (‘,’). The following nine characters represent the LATITUDE, and another pair of consecutive commas (‘,’) must be observed before proceeding. Subsequently, the next 10 characters represent the LONGITUDE.

For those who prefer a more user-friendly approach, Trimble Studio software provides a convenient solution. This software allows for the examination of latitude and longitude values for a location without requiring any coding. When a GPS module is connected to this software, it automatically provides latitude, longitude, altitude, speed, time, and date information. Additionally, it displays your location on Google Maps.

To extract LATITUDE and LONGITUDE data from the NMEA format, the following function can be employed:

void gps ()


unsigned int LAT[9], LON[10];

unsigned char Temp, i;

if (rx_data() == ‘$’)


if( rx_data() == ‘G’)


if (rx_data() == ‘P’)


if (rx_data() == ‘R’)


if (rx_data() == ‘M’)


if (rx_data() == ‘C’)


while (rx_data() != ‘,’);

while (rx_data() != ‘,’);

/*checking for “A” condition*/

Temp = rx_data();

if (Temp == ‘A’||Temp == ‘V’)


while (rx_data() != ‘,’);

/*latitude values*/

LCDCmd (0x80);

for (i=0; i<9; i++)


LAT[i] = rx_data();

LCDData (LAT[i]);


while (rx_data() != ‘,’);

while (rx_data() != ‘,’);

/*longitude values*/

LCDCmd (0xc0);

for (i=0; i<10; i++)


LON[i] = rx_data();

LCDData (LON[i]);





Circuit Simulation Video:

How to Operate?

  1. Burn the software to the 8051 microcontroller first.
  2. Make the connections as shown in the circuit diagram.
  3. Using an adaptor, provide power to the GPS module.
  4. Connect the GPS module to the computer and use the hyper terminal to check the messages you’ve received.
  5. Check to see if the GPS is on or not.
  6. When you connect the GPS to the circuit, the LCD will display the latitude and longitude readings.
  7. Turn off the circuit and the GPS module’s power.

Project Output Video:

Circuit Applications:

  • This system is used in marine navigation, car navigation and fleet management
  • Used in tracking devices and mapping devices
  • Used in personal positioning
  • This project is used in embedded system applications to find out the location.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button