How to Interface Gps with 8051 Microcontroller

Only available on StudyMode
  • Download(s) : 1479
  • Published : May 13, 2011
Open Document
Text Preview
How to interface GPS with 8051 Microcontroller (AT89C51)
Project Code: MC082
* Summary
* Description
* Circuit Diagram
* Video
* Code
* Components
Summary

GPS has become an efficient tool in the field of scientific use, commerce, surveillance and tracking. This project presents a small application based on Global Positioning System. It depicts the use of GPS module/receiver to find latitude and longitude of its location. The data obtained from GPS receiver (GPGGA sentence) is processed by the microcontroller to extract its latitude and longitude values.

The GPS Module has been interfaced with AT89C51 and the location values are displayed on a 16x2 LCD interface.

Description

How to interface GPS with 8051 Microcontroller (AT89C51)
Project Code: MC082
* Summary
* Description
* Circuit Diagram
* Video
* Code
* Components
Summary

GPS has become an efficient tool in the field of scientific use, commerce, surveillance and tracking. This project presents a small application based on Global Positioning System. It depicts the use of GPS module/receiver to find latitude and longitude of its location. The data obtained from GPS receiver (GPGGA sentence) is processed by the microcontroller to extract its latitude and longitude values.

The GPS Module has been interfaced with AT89C51 and the location values are displayed on a 16x2 LCD interface.

Description

The GPS module continuously transmits serial data (RS232 protocol) in the form of sentences according to NMEA standards. The latitude and longitude values of the location are contained in the GPGGA sentence (refer NMEA format). In this program, these values are extracted from the GPGGA sentence and are displayed on LCD.

The serial data is taken from the GPS module through MAX232 into the SBUF register of 8051 controller (refer serial interfacing with 8051). The serial data from the GPS receiver is taken by using the Serial Interrupt of the controller. This data consists of a sequence of NMEA sentences from which GPGGA sentence is identified and processed.

The extraction of location values is done as follows. The first six bytes of the data received are compared with the pre-stored ($GPGGA) string and if matched then only data is further accounted for; otherwise the process is repeated again. From the comma delimited GPGGA sentence, latitude and longitude positions are extracted by finding the respective comma positions and extracting the data. The latitude and longitude positions extracted are displayed on the LCD interfaced with AT89C51.

To obtain more details (other than latitude and longitude) from the GPS receiver, GPRMS sentence can be used. Refer next article.

The circuit connections are as follows:
Receiver1 (R1) of MAX232 has been used for the serial communication. The receiver pin of GPS module is connected to R1IN (pin13) of MAX232. R1OUT (pin 12) of MAX232 is connected to RxD (P3.0) of AT89C51.

Pins 1-3 of port P1 (P1.0, P1.1 & P1.2 respectively) of AT89C51 are connected to the control pins (RS, R/W& EN) of LCD. The data pins of LCD are connected to Port P2 of the controller. The latitude and longitude positions are displayed on the LCD. 

Ckt dgrm

CODE

/* Basic program to show latitude and longitude on LCD extracted from GPGGA statement */  
#include<reg51.h>
#define port2 P2
sbit rs = P1^0;
sbit rw = P1^1;
sbit e = P1^2;
char info[70];
char test[6]={"$GPGGA"};
char comma_position[15];
unsigned int check=0,i;
unsigned char a;
void receive_data();
void lcd_latitude();
void lcd_longitude();
 
//DELAY FUNCTION
void delay(unsigned int msec)
{...
tracking img