11_4_Implementation of GPS for Location Tracking

download 11_4_Implementation of GPS for Location Tracking

of 5

Transcript of 11_4_Implementation of GPS for Location Tracking

  • 8/3/2019 11_4_Implementation of GPS for Location Tracking

    1/5

    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 MalaysiaShah Alam, Malaysia

    [email protected], [email protected]

    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 moduleswill 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.

    I. INTRODUCTION

    Global Positioning Satellites network is known to haveoffered users with many applications especially in the area oftracking. Currently, fisherman who lost their way in the seacould locate their position by using GPS receiver installed ontheir boat. They could acquire a coordinate and call for arescue crew to save them with reference to the GPScoordinate. GPS is used for navigation and providescontinuous and timing information position of thingsanywhere in the world under any weather condition [1]. GPSconsist nominally of 24 operational satellites orbiting the earthat very high altitude [2].

    Satellites send signals to the GPS receiver to locate theexact position. These satellites are constantly monitored tomake sure that they are working properly. The GPS partsconsist of three segments which are user, space and control.

    This project will focus on the ground segment. Thissegment is further divided into two parts. First is for controland command of the satellite and the second is for receivingand exploiting some set of data. The GPS receiver is used tocapture the current location and data provided by the GPSwhich it couldnt be understand by human because of its

    ASCII character. This GPS data needs to be extracted anddecoded 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 currentlatitude and longitude for a particular location.

    II. THEORETICALBACKGROUND

    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 MarineElectronics Association. These data strings based on ASCIIare communicated at a rate of 38400 bits per second which isequivalent to the baud rate of 38400 characters per second [3].

    The GPS data is normally received and transmitted in astandard NMEA-0183 format. This GPS continuously outputsa 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 PositioningSystem 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 formatacquired with information on the longitude with west or east,latitude with south or north, and UTC time data are display outvia GGA data. This data will be extracted into a defined fixed-length package and some other useful information. Extracteddata will be transmitted to PIC and stored in 18F4520EEPROM [3].

    TABLE I. NMEAV3.01$GPGGAMESSAGE[3]

    Name Example Data Description

    Sentence Identifier $GPGGAGlobal PositioningSystem Fix Data

    Time 153041 15:30:41 UTC

    Latitude 6033.8963, N 60d 33.8963 N or 60d33' 54" N

    Longitude 10143.6838, W101d 43.6838 W or

    101d 43' 41" W

    Fix Quality:- 0 = Invalid- 1 = GPS fix

    - 2 = DGPS fix

    1 Data is from a GPS fix

    Number of Satellites 05 5 Satellites are in view

    Horizontal Dilutionof Precision (HDOP)

    1.5Relative accuracy ofhorizontal position

    Altitude 100.1, M100.1 meters above

    mean sea level

    2011 IEEE Control and System Graduate Research Colloquium

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

  • 8/3/2019 11_4_Implementation of GPS for Location Tracking

    2/5

    Height of geoidabove WGS84

    ellipsoid-22.4, M -22.0 meters

    Time since lastDGPS update

    blank No last update

    DGPS referencestation id

    blank No station ID

    Checksum *70Used by program to

    check for transmissionerrors

    B. Format of Latitudes and LongitudesFrom the numeric latitude or longitude, the two digits

    which are on the leftmost of the integer are the minutescharacter, the next two numbers represent the integer inminutes, 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]

    Another example 10141.055 E is 101degrees and 41.055minutes. 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 EarthIf 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 ErrorThrough the use of the public GPS, involving 24 global

    positioning satellites one is able to determine their exactlocation in real time. However the employment of a GPSsystem in this application will lead to multipath error whicheffect the accuracy of the range measurement performed, GPSsignal can be shadowed by buildings, terrain, raining and also

    man made obstacles, thus there occurs the effects of reducingthe visibility of the satellites.

    III. METHODOLOGY

    Fig. 1 shows the project methodology towards completingdesign and implementation of the GPS location tracker.Initially, communication must be first established between thePIC and GPS receiver. Thus an interface circuitry wasdeveloped to achieve this. The circuitry acted as a medium inorder to receive the signal from GPS receiver and then displaythe data onto the LCD. This circuit is controlled by the push

    button switch, reset switch and selector switch. A 5V DCsupply was given to this switch. The signal from GPS receiveris then sent to the PIC for data extraction and display.Secondly, a program was written in C language to drive theGPS Location Tracker hardware. A good understanding on the

    NMEA data received through the GPS receiver is important toensure 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 converterand GPS receiver FVM8 as illustrated in Fig. 2.

    The final step in the project development was integratingthe software and hardware to function as one. Then to verifythe functionality of the system, several testing was conductedin different geographical locations. During the testing, datacollected was recorded and analyzed.

    Figure 1. Flow chart of methodology.

    Figure 2. Block diagram of the GPS system.

    A. Hardware DescriptionThe complexity of the hardware designing is to extract the

    GPS-NMEA sentence (hardware block diagram as shown inFig. 3). PIC18F4520 was used because the characteristics of alow-power CMOS 8-bit MCU based on a high performanceRISC 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 fromGPS receiver and interface via RS232 as shown in Fig. 3 [5].

    Start

    End

    Design a tracking softwareusing C program

    Test both software and hardware

    Literature review

    Hardware development

    Filedocumentation

    Datastorage

    Data obtain andtroubleshoot

    Yes

    No

    RS232

    5V DC PIC18F4520 MAX232

    2011 IEEE Control and System Graduate Research Colloquium

    78

  • 8/3/2019 11_4_Implementation of GPS for Location Tracking

    3/5

    Figure 3. Circuit block diagram of GPS through PIC18F4520.

    B. Software DescriptionIn this project, PIC C Compiler is used as the platform to

    write the software part of the GPS Location Tracker. Thedeveloped program sequence is shown in Fig. 4. Initially, GPSreceiver status must first be checked. The program is used toextract 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 alreadyprogrammed is to control a main task such as initializing theGPS receiver and its acquisition.

    Figure 4. Flowchart of subroutine to read GPS data.

    IV. RESULT AND DISCUSSION

    Several of NMEA data sentences obtained during actualexperiment were displayed using Hyper Terminal in personalcomputer as shown in Fig. 5 and Fig. 6. And these readingswere used to be compared with GPS data taken by GPSLocation Tracker system

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

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

    Fig. 7 shows GPS data collected and display by the GPSLocation Tracker system developed in this project. The resultshowed the latitude and longitude were successfully extractedfrom the GGA data sentence and converted to decimaldegrees. Theoretical values using Hyper Terminal are 308.323,

    N for latitude and 10143.8669, E for longitude. As well asexperimental values using GPS Location Tracker unit are304.4201, N for latitude and 10129.8834, E longitude.

    Latitude 305.4880 N Longitude 10131.2058 E

    Latitude

    0308.3323 N

    Longitude

    10143.8669 E

    5V powersupply

    PIC18F4520 MAX232

    GPSreceiver

    LCDdisplay

    Start

    Yes

    No

    Check GPSreceiver status

    GPS controller

    power up

    Read GPS data

    Process GPS data andextract useful information

    Save information informatted strin

    Power on GPS controller

    End

    Display data atLCD display

    2011 IEEE Control and System Graduate Research Colloquium

    79

  • 8/3/2019 11_4_Implementation of GPS for Location Tracking

    4/5

    Figure 7. UiTMs coordinate.

    A. Outdoor Data MeasurementFirst experiment was conducted at Hutan Lipur Ampang

    with coordinate values at latitude 309.122 N and longitude10147.0476 E. Second experiment was done at Klang GateDam with coordinate values at latitude 313.996 N andlongitude 10145.041 E. The two chosen locations are famousoutdoor attractions to those who want to experience nature inthe Klang Valley. Measurement taken during the actual testingcan be divided into two; first was to extract coordinates usingGPS Location Tracker unit, second to measure the distance

    between two points with consideration of the natural existedobstacles such as hill, rain and cloud.

    TABLE II. ASET OF LATITUDE AND LONGITUDE DATA AT HUTANLIPUR,AMPANG

    From the experiment at Hutan Lipur Ampang (as shown inTable II), the average latitude and longitude is 308.9046 N and10147.4458 E. Fig. 8 and Fig. 9 show that data was consistentdata received from GPS receiver, however once the weatherturned cloudy GPS receiver showed failure in obtaining datafrom the satellites. Once the sky was cleared form heavy, theGPS Location Tracker unit started to receive strong consistentdata from the satellites. From this experiment, the cloud was

    proven to be an obstacle for the GPS Location Tracker unit toreceive signal from satellites.

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

    Figure 9. Data obtained at longitude of Hutan Lipur, Ampang.

    To measure a distance between two points a set ofreference 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 butcan only measure in 2 decimal points and unit symbol is inmeter as display in LCD Display. As shown in Table III andTable IV, the distance was successfully measured with slight

    percentage error. It gives an average of 90.96% accuracy forcalculating distance when compared to actual distance. Thedifference between measured and actual distance of the two

    points may be due to the fact that, distance calculated usingGPS satellites may consider approximate distance of a straightlines whereas in reality this may not be true.

    TABLE III. ASET OF LATITUDE AND LONGITUDE DATA FORREFERENCETO MEASURE DISTANCE

    Place

    Theoretical value Experiment value

    Latitude( N )

    Longitude( E )

    Latitude( N )

    Longitude( E )

    UITMShahAlam

    0304.323 10129.9516 0304.3951 10129.8789

    IIUMGombak

    0315.0226 10143.9346 0315.1814 10143.9440

    Home 0308.3578 10143.8773 0308.3219 10143.8607

    TimeRespond

    time(min)

    Experiment values DCvoltage

    (V)Latitude(N)

    Longitude(E)

    0900 3.143 0308.9626 10147.5059 5.01

    1000 3.243 0308.9515 10147.5048 5.02

    1100 3.343 0308.9504 10147.5042 5.015

    1200 3.112 0308.9501 10147.4992 5.09

    1300 3.010 0308.9490 10147.4984 5.01

    1400 3.223 0308.9485 10147.4009 4.96

    1500 5.987 0309.1087 10147.0012 4.55

    1600 5.765 0309.1202 10147.10064 4.61

    1700 20.99 0308.1050 10147.8085 4.58

    1800 NIL NIL NIL 4.57

    1900 NIL NIL NIL 4.76

    2000 5.677 0308.9510 10147.4050 4.98

    2100 6.778 0308.9545 10147.6754 4.99

    2011 IEEE Control and System Graduate Research Colloquium

    80

  • 8/3/2019 11_4_Implementation of GPS for Location Tracking

    5/5

    HutanLipur

    Ampang0309.122 10147.0476 0308.9626 10147.5059

    KlangGateDam

    0313.996 10145.0413 0314.0263 10144.9743

    TABLE IV. DISTANCE MEASUREMENT FROM ONE POINT TO OTHERPOINT

    One point to

    other point

    Theoreticaldistance

    in km

    Experimentdistance in

    km

    Accuracy in

    (%)

    UiTM Shah Alam -IIUM Gombak

    32.84 27.9908 85.23

    UiTM Shah Alam- Cheras

    27.239 27.8455 97.97

    UiTM Shah Alam- Hutan Lipur

    Ampang32.934 34.5983 98.98

    UiTM Shah Alam- Klang Gate Dam

    33.245 31.9147 95.99

    Cheras KlangGate Dam

    10.366 10.766 96.14

    Cheras HutanLipur Ampang 6.45 3.3219 51.503

    Hutan LipurAmpang Klang

    Gate dam9.732 10.12 89.31

    IIUM Gombak -Home

    12.68 12.72 99.68

    IIUM Gombak -Hutan Lipur

    Ampang12.619 13.308 94.539

    IIUM Gombak -Klang Gate Dam

    3.0156 2.935 97.327

    To measure a distance between one point to another point,it is needed to set a reference point to measure distance. UiTMShah Alam has been chosen as a set point. The algorithm have

    been developed to measure the distance but it just couldmeasured in 2 decimal points with a unit symbol in meter asdisplay in LCD. As shown in Table III and Table IV, thisexperiment was successfully measure distance but is nottotally accurate. It gives an average of 90.96% accurate forexperiment in calculating distance. As conclusion, it can beassumed that a distance measurement is a straight line from aset of point to another point because of the satellite view.

    Fig. 10 and Fig. 11 show a comparative plot of actual andmeasured distances. It gives an average of 10 % accuracy.

    Figure 10. Percentage of accuracy

    Figure 11. Distance in theoretical and experiment.

    V. CONCLUSION

    This project was successfully implemented and developedthe outdoor tracking location unit using GPS FV-M8. As aresult, latitude and longitude of any location and distance

    between two points on the earth are measured with an averageaccuracy of 90% from actual value. It is recommended that thealgorithm can be further improvised to give a better accuracy.

    REFERENCES

    [1] Tom Logsdon,Understanding the NAVSTAR GPS, GIS, 1st Ed, 1995.

    [2] Michael Kennedy, The Global Positioning System and GIS, anIntroduction: Ann Arbor Press, 2003.

    [3] Gilbert Strang and Kai Boore, Linear Algebra, Geodesy and GPS,Fourth Edition: Wellesley-Cambridge Press, 2006.

    [4] K. Bernstein, K.M. Carrig, Christopher M. Durham, Patrick R. Hansen,David Hogenmiller, Edward J. Nowak, Norman J.Rohrer, High SpeedCMOS Design Styles, 3rd Edition: Springer, August 1998.

    [5] Institute of Navigation, Product Global Positioning System GPSmodule FV-M8, Fourth Volumes: bible of GPS, 2007.

    2011 IEEE Control and System Graduate Research Colloquium

    81