Microcontroller Based City Locator using GPS and LCD in EMBEDDED


The GPS receiver is used to get accurate geographical location by receiving information from satellites. It receives information from satellites and gives location information in terms of latitude and longitude. It gives latitude and longitudes with accuracy of degree-minute-second. Using this latitude and longitude co-ordinates one can easily trace out the location on entire globe. The GPS receivers have enormous applications. Some of are listed here.
GPS receivers are used in
·    All aircrafts, ships, see vessels, vehicles etc for navigation purpose
·    In smart phones with maps (like Google map) to find a way to the destination or to spot any                                                        landmark/restaurant/hospital/hotel
·   Autonomous vehicles to find proper path to destination
·   In missile or bomb to locate and hit the target
The GPS receiver gives output serially in form of strings with NMEA (National Marine Electronics Association) 0183 protocol. These strings are received serially by host computer or host processor/controller for display or to take any decision or action. The following figure shows the output of GPS receiver on hyper terminal of desktop computer.

The NEMA protocol gives standard and messages given by GPS receiver. Some of the standard messages output from NMEA are GGA, ZDA, VTC, RMC, GSA, GSV etc. There are 50 messages from NMEA but only some are applied to GPS receiver. The maximum length of every message is limited to 79 characters. The format of NMEA is given and explained as under
  1. $ - indicates start of each message
  2. ID – indicates source of navigation information. In this case it will be GP because of GPS
  3. MSG – describes message contents like GGA, GSV, GSA etc
  4. , - it’s a separation between data
  5. D1 – Dn – they are data fields separated by comma
  6. *- it is used to separate checksum
  7. CS – its checksum value in HEX
  8. (CR)(LF) – Its carriage returns + line feed that indicates end of message
From the start tag notation it can be identified that what kind of information will be available in following string. Like
·    The string starts with $GPGGA tag gives time, latitude, longitude, altitude, GPS quality and some other information
·    The string starts with $GPZDA tag gives date and time information
The given project demonstrates how to get location (latitude and longitude) information from GPS receiver and if that received co-ordinates corresponds to any Indian city then it also displays name of the city. It uses 8 bit micro controller AT89C51 to get data from GPS receiver and display it on LCD.   The latitude and longitude co-ordinates are given in two different strings that start with $GPRMC tag or $GPGGA tag. This strings are highlighted in above figure and also in the string where is latitude-longitude co-ordinates that is also highlighted. One can extract these co-ordinates from any of the string. I have extracted it from GPRMC string. RMC stands for recommended minimum GNSS data. GPRMC string is explained in more detail below.
GPRMC string format:

The complete string is of 65 to 70 characters including start tag. The string starts with $ and start tag GPRMC. After the start tag next is time in GMT. Then there is location information that includes latitude with direction and longitude with direction. There are 9 characters in latitude. First two represents degree (33o in this case) second represents minute (54’ here) and after decimal point last 4 represents seconds (1133” here). Latitude direction follows latitude and can be ‘N’ or ‘S’. Longitude is represented by next 10 characters. It is similar to latitude but there are three digits (characters) in degree (151o in this case). The micro controller extracts this string from GPS output, extracts location information details and display them on LCD in proper format. Then it matches the co-ordinates with co-ordinates of different Indian cites. If it found any match then the name of city is displayed as “its a Ahmedabad” or “its a Delhi”.
System block diagram:
There are only four major building blocks of the system.
GPS receiver – it collects information from satellite and generates output in form of different strings. It gives these strings as output to micro controller
MAX232 – it is a level converter chip. It converts RS232 level signals given by GPS receiver into TTL level signals that can be given to micro controller.
AT89C51 micro controller – it receives all the strings from GPS receiver but extracts only one string. It extracts location information from string and displays them on LCD in proper format
LCD panel – it is used to display location information and name of city

Next Post »