GPS interfacing with Microcontroller
Introduction:
Global Positioning System is used to determine the location of a vehicle or person.It has become an efficient tool in the field of scientific use, commerce, surveillance and tracking. This Global positioning system uses 24 to 32 satellites to provide the data to the receivers. GPS has become very important for world wide navigation and it is useful for land surveying, way marking, map-making, tracking and surveillance commerce and scientific uses.
Interfacing with Microcontroller:
The GPS module continuously transmits serial data (RS232 protocol) in the form of sentences according to NMEA standards. The latitude, longitude, time, date and speed values of the receiver are contained in the GPRMC sentence as given in the following example (also refer NMEA format for other sentences).
Example:
$GPRMC,132455.970,A,2651.0145,N,07547.7051,E,0.50,342.76,301010,,,A*64
RMC
132455.970
A
2651.0145, N
07547.7051, E
0.50
342.76
301010
Empty (xxx.x,y)
*64
|
Recommended Minimum sentence C
Fix taken at 13:24:55.970 UTC
Status A=Active or V=Void.
Latitude 26 deg 51.0145' N
Longitude 075 deg 47.7051' E
Speed over the ground in knots
Track angle in degrees True
Date : 30th of October 2010
Magnetic Variation
The checksum data, always begins with *
|
Letter A in GPRMC string tells about the data, is it valid or not. When GPS module is powered up it takes some time to connect with the satellites. Therefore there is letter 'V' instead of 'A'. When GPS modules gets connected letter 'A' appears in place of 'V'. Therefore this letter can be used to monitor whether GPS module has connected or not. When module gets connected it sends the longitude,latitude, speed, time etc in a single string. Microcontroller can be programmed to extract this data from the string.
Some of GPS modules contain TTL pins so we can connect these modules directly to microcontroller without using MAX232 Ic. Tx pin of module is connected to Rx pin of Microcontroller.
Extraction of Latitude and Longitude values from NMEA Format:
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. If string is matched then wait till you will get two 2 commas, next character indicates weather the GPS is activated or not. If this character is A then GPS is activated otherwise GPS is not activated. Now again wait till you get comma (,). The next 9 characters indicate the LATITUDE. Wait till you get 2 more commas (,) the next 10 characters indicates the LONGITUDE.
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.
Comments
Post a Comment