You are on page 1of 5

2011 IEEE Control and System Graduate Research Colloquium

Implementation of GPS for Location Tracking


Ahmad Ashraff Bin Ariffin, Noor Hafizah Abdul Aziz and Kama Azura Othman
Faculty of Electrical Engineering Universiti Teknologi MARA Malaysia Shah Alam, Malaysia ayapaa01@yahoo.com.my, noor4083@salam.uitm.edu.my

Abstract- Stand alone global positioning system receivers are widely used nowadays to accurately locating ones position. By using stand alone GPS receivers the distance between two locations on earth can also be measured. This project is aim to design and implement a low cost Global Positioning System suitable to be used for hiking, climbing and sailing activities. The function of the GPS is to locate the position of user. The effects of line of sights in relation to different experimented locations are also studied. In this project, the hardware used is PIC18F4520 integrated with GPS receiver typed FV-M8. The GPS modules will generate the coordinates of latitude and longitude as well as the bearing angles between two positions. The algorithm to calculate the distance between two positions was developed by using PIC C Compiler. The written algorithm extracted the data from the GPS receiver via the RS232 communication. Microcontroller is used to parse the NMEA data sentences and execute the algorithm. Finally, the output is displayed to a LCD display unit. System testing conducted showed that for a few chosen different locations, geographical view and weather conditions, overall results give an average of 10 % different compared with ideal theoretical calculated results. Keywords: GPS, NMEA, CMOS, MCU, RISC, ASCII, FV-M8, and RS232.

ASCII character. This GPS data needs to be extracted and decoded in order to get the desired information. Besides that, GPS receiver can also provides information such as time, status, altitude, number of satellite in view to get the current latitude and longitude for a particular location. II. THEORETICAL BACKGROUND

A. GPS Arrangement (GPS Data Retrieved) The set of data or information from GPS receiver can be called a NMEA, which is stand for National Marine Electronics Association. These data strings based on ASCII are communicated at a rate of 38400 bits per second which is equivalent to the baud rate of 38400 characters per second [3]. The GPS data is normally received and transmitted in a standard NMEA-0183 format. This GPS continuously outputs a lot of NMEA sentences such as GGA, GLL, GSA, GSV, RMC, and VTG. In this case, the only concerned was the ($GPGGA) sentence, which represents the Global Positioning System Fix Data for the GPS receiver. Example of Global Positioning System Fix Data is $GPGGA,153041,6033.8963,N,10143.6383,W,1,05,1.5,101.1, M,-22.4,M,,,*70. And Table I shows the GGA data format acquired with information on the longitude with west or east, latitude with south or north, and UTC time data are display out via GGA data. This data will be extracted into a defined fixedlength package and some other useful information. Extracted data will be transmitted to PIC and stored in 18F4520 EEPROM [3].
TABLE I. Name Sentence Identifier Time Latitude Longitude Fix Quality: - 0 = Invalid - 1 = GPS fix - 2 = DGPS fix Number of Satellites Horizontal Dilution of Precision (HDOP) Altitude NMEA V3.01 $GPGGA MESSAGE [3] Example Data $GPGGA 153041 6033.8963, N 10143.6838, W Description Global Positioning System Fix Data 15:30:41 UTC 60d 33.8963 N or 60d 33' 54" N 101d 43.6838 W or 101d 43' 41" W Data is from a GPS fix 5 Satellites are in view Relative accuracy of horizontal position 100.1 meters above mean sea level

I.

INTRODUCTION

Global Positioning Satellites network is known to have offered users with many applications especially in the area of tracking. Currently, fisherman who lost their way in the sea could locate their position by using GPS receiver installed on their boat. They could acquire a coordinate and call for a rescue crew to save them with reference to the GPS coordinate. GPS is used for navigation and provides continuous and timing information position of things anywhere in the world under any weather condition [1]. GPS consist nominally of 24 operational satellites orbiting the earth at very high altitude [2]. Satellites send signals to the GPS receiver to locate the exact position. These satellites are constantly monitored to make sure that they are working properly. The GPS parts consist of three segments which are user, space and control. This project will focus on the ground segment. This segment is further divided into two parts. First is for control and command of the satellite and the second is for receiving and exploiting some set of data. The GPS receiver is used to capture the current location and data provided by the GPS which it couldnt be understand by human because of its

1 05 1.5 100.1, M

978-1-4577-0339-3/11/$26.00 2011 IEEE

77

2011 IEEE Control and System Graduate Research Colloquium


Height of geoid above WGS84 ellipsoid Time since last DGPS update DGPS reference station id Checksum -22.4, M blank blank *70 -22.0 meters No last update No station ID Used by program to check for transmission errors

B. Format of Latitudes and Longitudes From the numeric latitude or longitude, the two digits which are on the leftmost of the integer are the minutes character, the next two numbers represent the integer in minutes, and at the left is the whole minutes degrees [3]. For example 6049.15 N is 60 degrees and 49.15 minutes. Thus this will results in latitude of 60.819 N. [Latitude = 6049.15 = 60 + ( 49.15/60 ) = 60.819 N]

button switch, reset switch and selector switch. A 5V DC supply was given to this switch. The signal from GPS receiver is then sent to the PIC for data extraction and display. Secondly, a program was written in C language to drive the GPS Location Tracker hardware. A good understanding on the NMEA data received through the GPS receiver is important to ensure the written program will extract the desired data. The program was written using PIC C Compiler. The hardware used in this project are PIC 18F4520, RS232 to USB converter and GPS receiver FVM8 as illustrated in Fig. 2. The final step in the project development was integrating the software and hardware to function as one. Then to verify the functionality of the system, several testing was conducted in different geographical locations. During the testing, data collected was recorded and analyzed.
Start

Literature review

Another example 10141.055 E is 101degrees and 41.055 minutes. And thus the longitude is 101.68425 E. [Longitude = 10141.055 = 101 + ( 41.055/60 ) = 101.68425 E] C. Distance Between Two Points on the Earth If point 1 (lat1, long1) and point 2 (lat2, long2) are two given points, R is radius of the earth and its value are 6372.8, D is the distance between the points on the Earth and is the great circle distance between point 1 and point 2 [3]. cos = [ cos(latA) x cos(latB) x cos(lonB lonA) ] + [ sin(latA) x sin(latB) ]. So = in degrees. = in radians. D = R x ( in radians ). = in Kilometres. [3] D. Multipath Error Through the use of the public GPS, involving 24 global positioning satellites one is able to determine their exact location in real time. However the employment of a GPS system in this application will lead to multipath error which effect the accuracy of the range measurement performed, GPS signal can be shadowed by buildings, terrain, raining and also man made obstacles, thus there occurs the effects of reducing the visibility of the satellites. III. METHODOLOGY

Data storage

Design a tracking software using C program

File documentation

Hardware development

Test both software and hardware

Data obtain and troubleshoot No Yes End Figure 1. Flow chart of methodology.

5V DC

PIC18F4520

MAX232 RS232

Figure 2. Block diagram of the GPS system.

Fig. 1 shows the project methodology towards completing design and implementation of the GPS location tracker. Initially, communication must be first established between the PIC and GPS receiver. Thus an interface circuitry was developed to achieve this. The circuitry acted as a medium in order to receive the signal from GPS receiver and then display the data onto the LCD. This circuit is controlled by the push

A. Hardware Description The complexity of the hardware designing is to extract the GPS-NMEA sentence (hardware block diagram as shown in Fig. 3). PIC18F4520 was used because the characteristics of a low-power CMOS 8-bit MCU based on a high performance RISC architecture [4]. With two control pins and eight data pins, the PIC gives the LCD specific information to display. Pins RC6 and RC7 for PIC individually senses the signal from GPS receiver and interface via RS232 as shown in Fig. 3 [5].

78

2011 IEEE Control and System Graduate Research Colloquium


GPS receiver

IV.

RESULT AND DISCUSSION

5V power supply

PIC18F4520

MAX232

Several of NMEA data sentences obtained during actual experiment were displayed using Hyper Terminal in personal computer as shown in Fig. 5 and Fig. 6. And these readings were used to be compared with GPS data taken by GPS Location Tracker system

LCD display Figure 3. Circuit block diagram of GPS through PIC18F4520.

B. Software Description In this project, PIC C Compiler is used as the platform to write the software part of the GPS Location Tracker. The developed program sequence is shown in Fig. 4. Initially, GPS receiver status must first be checked. The program is used to extract desired GPS data such as latitude and longitude of a particular location. The flowchart in Fig. 4 described the flow of PIC18F4520 in programs and to run the devices. The coding that already programmed is to control a main task such as initializing the GPS receiver and its acquisition.
Latitude 305.4880 N Longitude 10131.2058 E

Figure 5. Sample of CGA sentences taken at Shah Alam, Section 9.

Start

Check GPS receiver status

GPS controller power up Yes Read GPS data

No

Power on GPS controller

Process GPS data and extract useful information Latitude 0308.3323 N

Longitude 10143.8669 E

Save information in formatted string

Figure 6. Hyper terminal display at UiTM, Shah Alam.

Display data at LCD display

End Figure 4. Flowchart of subroutine to read GPS data.

Fig. 7 shows GPS data collected and display by the GPS Location Tracker system developed in this project. The result showed the latitude and longitude were successfully extracted from the GGA data sentence and converted to decimal degrees. Theoretical values using Hyper Terminal are 308.323, N for latitude and 10143.8669, E for longitude. As well as experimental values using GPS Location Tracker unit are 304.4201, N for latitude and 10129.8834, E longitude.

79

2011 IEEE Control and System Graduate Research Colloquium

Figure 7. UiTMs coordinate.

A. Outdoor Data Measurement First experiment was conducted at Hutan Lipur Ampang with coordinate values at latitude 309.122 N and longitude 10147.0476 E. Second experiment was done at Klang Gate Dam with coordinate values at latitude 313.996 N and longitude 10145.041 E. The two chosen locations are famous outdoor attractions to those who want to experience nature in the Klang Valley. Measurement taken during the actual testing can be divided into two; first was to extract coordinates using GPS Location Tracker unit, second to measure the distance between two points with consideration of the natural existed obstacles such as hill, rain and cloud.
TABLE II. A SET OF LATITUDE AND LONGITUDE DATA AT HUTAN LIPUR, AMPANG

Figure 8. Data obtained at latitude of Hutan Lipur, Ampang.

Time

Respond time (min) 3.143 3.243 3.343 3.112 3.010 3.223 5.987 5.765 20.99 NIL NIL 5.677 6.778

Experiment values Latitude (N) 0308.9626 0308.9515 0308.9504 0308.9501 0308.9490 0308.9485 0309.1087 0309.1202 0308.1050 NIL NIL 0308.9510 0308.9545 Longitude (E) 10147.5059 10147.5048 10147.5042 10147.4992 10147.4984 10147.4009 10147.0012 10147.10064 10147.8085 NIL NIL 10147.4050 10147.6754

DC voltage (V) 5.01 5.02 5.015 5.09 5.01 4.96 4.55 4.61 4.58 4.57 4.76 4.98 4.99 Figure 9. Data obtained at longitude of Hutan Lipur, Ampang.

0900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100

To measure a distance between two points a set of reference point was selected as a set point to measure distance.UiTM Shah Alam have been chosen as a set point. The algorithm have been developed to measure distance but can only measure in 2 decimal points and unit symbol is in meter as display in LCD Display. As shown in Table III and Table IV, the distance was successfully measured with slight percentage error. It gives an average of 90.96% accuracy for calculating distance when compared to actual distance. The difference between measured and actual distance of the two points may be due to the fact that, distance calculated using GPS satellites may consider approximate distance of a straight lines whereas in reality this may not be true.
TABLE III. A SET OF LATITUDE AND LONGITUDE DATA FOR REFERENCE TO MEASURE DISTANCE Theoretical value Place Latitude (N) 0304.323 Longitude (E) 10129.9516 Experiment value Latitude (N) 0304.3951 Longitude (E) 10129.8789

From the experiment at Hutan Lipur Ampang (as shown in Table II), the average latitude and longitude is 308.9046 N and 10147.4458 E. Fig. 8 and Fig. 9 show that data was consistent data received from GPS receiver, however once the weather turned cloudy GPS receiver showed failure in obtaining data from the satellites. Once the sky was cleared form heavy, the GPS Location Tracker unit started to receive strong consistent data from the satellites. From this experiment, the cloud was proven to be an obstacle for the GPS Location Tracker unit to receive signal from satellites.

UITM Shah Alam IIUM Gombak Home

0315.0226 0308.3578

10143.9346 10143.8773

0315.1814 0308.3219

10143.9440 10143.8607

80

2011 IEEE Control and System Graduate Research Colloquium


Hutan Lipur Ampang Klang Gate Dam TABLE IV. 0309.122 10147.0476 0308.9626 10147.5059

0313.996

10145.0413

0314.0263

10144.9743

DISTANCE MEASUREMENT FROM ONE POINT TO OTHER POINT Theoretical distance in km 32.84 27.239 32.934 33.245 10.366 6.45 9.732 12.68 12.619 3.0156 Experiment distance in km 27.9908 27.8455 34.5983 31.9147 10.766 3.3219 10.12 12.72 13.308 2.935 Accuracy in (%) 85.23 97.97 98.98 95.99 96.14 51.503 89.31 99.68 94.539 97.327 Figure 10. Percentage of accuracy

One point to other point UiTM Shah Alam IIUM Gombak UiTM Shah Alam - Cheras UiTM Shah Alam - Hutan Lipur Ampang UiTM Shah Alam - Klang Gate Dam Cheras Klang Gate Dam Cheras Hutan Lipur Ampang Hutan Lipur Ampang Klang Gate dam IIUM Gombak Home IIUM Gombak Hutan Lipur Ampang IIUM Gombak Klang Gate Dam

To measure a distance between one point to another point, it is needed to set a reference point to measure distance. UiTM Shah Alam has been chosen as a set point. The algorithm have been developed to measure the distance but it just could measured in 2 decimal points with a unit symbol in meter as display in LCD. As shown in Table III and Table IV, this experiment was successfully measure distance but is not totally accurate. It gives an average of 90.96% accurate for experiment in calculating distance. As conclusion, it can be assumed that a distance measurement is a straight line from a set of point to another point because of the satellite view. Fig. 10 and Fig. 11 show a comparative plot of actual and measured distances. It gives an average of 10 % accuracy.

Figure 11. Distance in theoretical and experiment.

V.

CONCLUSION

This project was successfully implemented and developed the outdoor tracking location unit using GPS FV-M8. As a result, latitude and longitude of any location and distance between two points on the earth are measured with an average accuracy of 90% from actual value. It is recommended that the algorithm can be further improvised to give a better accuracy. REFERENCES
[1] [2] [3] [4] Tom Logsdon,Understanding the NAVSTAR GPS, GIS, 1st Ed, 1995. Michael Kennedy, The Global Positioning System and GIS, an Introduction: Ann Arbor Press, 2003. Gilbert Strang and Kai Boore, Linear Algebra, Geodesy and GPS, Fourth Edition: Wellesley-Cambridge Press, 2006. K. Bernstein, K.M. Carrig, Christopher M. Durham, Patrick R. Hansen, David Hogenmiller, Edward J. Nowak, Norman J.Rohrer, High Speed CMOS Design Styles, 3rd Edition: Springer, August 1998. Institute of Navigation, Product Global Positioning System GPS module FV-M8, Fourth Volumes: bible of GPS, 2007.

[5]

81

You might also like