Escolar Documentos
Profissional Documentos
Cultura Documentos
\
|
+
|
.
|
\
|
+
3600 60
Second Minute
Degree
If there is West or South, we need to multiply the answer by -1.
Example:
If we got 103 46 33.31E for the Longitude, we will deduce the equation as follow:
77591945 . 103
3600
31 . 33
60
46
103 =
|
.
|
\
|
+
|
.
|
\
|
+
Since it is East at the back of the second, we get position value without multiplying by -1.
Eventually, the converted data in Decimal Degrees format will return as string data.
Table 6.1: Format of Latitude and Longitude in Degrees Minutes Seconds
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
46
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure 6.14: Flowchart of ConvertFromDMS2DD(string strData) function
Start
Is the data
length = 3?
Split the
latitude or
longitude data
based on space
in -between
Yes
No
Exit the function
Convert the latitude or
longitude value from
Degrees Minutes Seconds
format to Decimal
Degrees format
End
Return the converted
data in Decimal Degrees
format as string
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
47
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
6.3.13 Mid(string strData, int iPos1, int iPos2) Function
First, the function will check if the strData passed in is blank. If it is blank, it will exit the
function. Else it will trim the total length of the string of data passed in. Eventually, the
trimmed data will be return to other functions which contains the variable.
No
Start
Is strData
passed in
blank?
Trim the total length of
the data
End
Return the trimmed data to
other functions containing
strTmp variable
Yes
Exit the function
Figure 6.15: Flowchart of Mid(string strData, int iPos1, int iPos2) Function
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
48
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
6.3.14 KillProcess() Function
This function is simply used to close the process in the task manager and reopen the Mobile
Partner software. The purpose of this function is to restart Mobile Partner software after reset
button is being selected. If not, there will be error in Mobile Partner like the SMS is not
stored in the folder.
Figure 6.16: Flowchart of KillProcess() function
Start
Get process list
running in the Task
Manager
Find Mobile
Partner.exe
and kill the
process
End
Yes
No
Prompt
*Exception
Error* error
message
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
49
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
6.4 Mapping Module
Last but not least, the mapping module which is used to plot and display the route travelled
by the vehicle uses Google Maps API. It can be easily retrieved by registration on the
website: http://code.google.com/apis/maps/signup.html to get an API key. The Google Maps
API allows us to embed the Google Maps in own webpage. Essentially, Google Maps API
runs on JavaScript. Therefore, JavaScript needs to be installed and enabled in the browser.
Once the Internet Explorer browser is launched with the Google Maps API, it will check the
compatibility of the browser and availability of JavaScript. If the browser is not compatible
such as Mozilla Firefox, it will show the browser as a blank screen. Therefore Internet
Explorer is a must for the Google Maps API. Internet connection is essential for the html file
to retrieve the map images from the internet. If protected mode is enabled, allowed block
content is needed to show the Google map. After being successfully launched, it will show
Google map with zooming and panning control at the top left and 3 map viewing mode of
Map, Satellite and Terrain.
The Google map will be plotted with the information from GPS_LiveLog.txt or
GPS_HisLog.txt. In addition, information like time stamp, Latitude, Longitude, Speed and
Address will be retrieved. Data in the log file is split up by commas to string of array using
parts = lines[i].split(",") command. var marker = createMarker(point,time,lat,lng,speed)
Command is used to create the marker on the Google map. geocoder.getLocations(point,
function(response) Command helps to get the actual address based on the decimal degrees
format of Latitude and Longitude. realaddress = place.address command will show only the
address name. By clicking on the marker plotted on the map, it will reveal the time stamp,
Latitude, Longitude, Speed and Address.
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
50
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
End
Is the
internet
browser
compatible?
No
Is the
Protected
Mode
enabled?
Prompt warning
message
Yes
Yes
No
Allow Blocked
Content
Load Google
Map with control
Retrieve data from
GPS_LiveLog.txt and
GPS_LiveLog.txt
Create markers
on the map based
on the
coordination
information
Is the
maker
clicked by
the user?
Yes
Display time stamp,
Latitude, Longitude,
Speed and get actual
address
Start
Figure 6.17: Flowchart of Mapping Module
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
51
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
The source code for the mapping module can be found from Appendix D. As mentioned
earlier, there are 3 different modes: Map, Satellite and Terrain. Figure 6.4.1 shows the
markers plotted on Google map with Time Stamp, Latitude, Longitude, Speed and Address
when clicked in Satellite mode.
Actual address with
information like Time
Stamp, Latitude,
Longitude and Speed
when the user clicks on the
marker
Markers
Figure 6.18: Google Map with Location Markers
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
52
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7 TESTING AND EVALUATION
This chapter mainly will touch on the actual implementation and field testing results on the
functionality of the GPS Tracking System in a vehicle. The equipments which will be used
for the field testing is shown in Figure 7.1. The GPS tracker will be placed on the cars
dashboard and Mobile Adaptor will be attached to the laptop for receiving SMS.
Laptop with Mobile Adaptor
GPS Tracker
Figure 7.1: Actual Field Testing Equipments
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
53
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7.1 Troubleshooting and Debugging
A common issue which the software faces is the software bugs which cause errors. Therefore
a functional testing and troubleshooting of the program needs to be performed. In order to be
more efficiency in the testing, a methodology is required. The methodology conducted is
further elaborated in process flow as shown in Figure 7.2.
Start
Evaluate from the results if it
meet the requirements
Conduct Testing
Results and
outcome
Any error
occurred
on the
software?
Improvement and
enhancement of software
End
Yes
No
Debug on the errors
Figure 7.2: Process Flow Chart of Troubleshooting
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
54
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7.1.1 Test Condition 1: GPS Tracking System
This test condition is conducted to ensure the accuracy of the GPS tracking in line with the
positioning plotted on the Google map. The process flow of the testing is illustrated in Figure
7.3.
Yes
No
No
End
Start the vehicle
Is the log file
created in C:
drive for the
history log?
Is the SMS
received read and
trim correctly from
the SMS.DTC file?
Is the latitude
and longitude
value converted
correctly?
Start
Comparison
of the actual
coordination
with the data
Debugging of errors
Yes
Yes
No
No
Figure 7.3: Process Flow chart of GPS Tracking System Debugging
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
55
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
The GPS tracking system testing will start once the user turns on the GPS tracker and plug
the mobile adaptor to a powered on laptop with Mobile Partner opened. As long as there is
SMS coming in to the computer, the SMS data will be saved as SMS.DTC file in the C:
drive. As there is too much other information in the SMS.DTC file. Trimming the string of
data from the file is performed. After trimming, comparison to ensure the coordination and
the conversion of format was done successfully.
Figure 7.4: Screenshot of GPS Tracking System GUI with data from SMS.DTC
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
56
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7.1.2 Test Condition 2: Security Features
For security testing, this is to test the validation of security feature which is required for the
project. There are 2 types of security features: Movement alarm and Geo-fence. As
mentioned in Chapter 4.1, Movement alarm is used for alert to send out to user if the vehicle
moved out of predefined range from 30 meters to 2000 meters square scope. Geo-fence is
used for vehicle moving in/out of the predefined latitudes and longitudes in square scope set
by the user.
Type 1: Movement alarm testing
Vehicle
moved out of
30 meters
Verification
from GPS
Tracker
SMS sent to GPS
Tracker with 30
meter preset
square scope
Figure 7.5: Movement Alarm setting and Alert
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
57
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Type 2: Geo-Fence
Sent SMS to
GPS Tracker
Verification from
GPS Tracker
GPS Tracker will send the
current location of tracker in
every 1 minute interval when
tracker move out of preset
square scope
Figure 7.6: Illustration of Geo-Fence setting and Alert
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
58
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7.1.3 Test Condition 3: Track Vehicle position using SMS
For the locate vehicle position using SMS, there are 2 ways: track by SMS and track on
demand.
Track by SMS will get the current location of the GPS tracker and report its longitude and
latitude by SMS. By sending the message 0000T to the GPS tracker, it returned the
Latitude and Longitude with additional information of Speed, Date and time as shown in
Figure 7.7.
Track on Demand will received an SMS with http link. When click on the link, the location
can be shown directly on the Google Map. This is provided that it is a Smartphone which is
loaded with Google Map application. Figure 7.8 illustrates that sending 0000H will receive
a link to Google Map. The location will be plotted on the Google Map via clicking on the
link.
Figure 7.7: Track by SMS
Sent SMS
to GPS
Tracker
Received SMS
from GPS Tracker
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
59
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure 7.8: Track on Demand
Received SMS
from GPS
Tracker
Sent SMS
from GPS
Tracker
Location
plotted on
Google
Map on
IPhone
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
60
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7.1.4 Test Condition 4: Mapping Feature
Mapping feature is one of the most essential parts of the project as it assists the user to
visualize the map on the exact location or travelled route by the vehicle. The process flow of
testing is illustrated in Figure 7.10.
On the GPS Tracking GUI, user will click on the Read Data button to compute the SMS
data and Show on Map button to display the travelled route markers on the Google Map.
Each of the markers is clicked to display the information like Time Stamp, Latitude,
Longitude and Speed. And each of the markers is examined to ensure that all information is
correct and accurate. Verification of the information will be referring to the log file which is
created in C: drive. Conversion of the Degrees Minutes Seconds Format to Decimal Degrees
Yes
Yes
Start
User click on the Read data
to get the coordination and
click on View on Map to
display travelled route
Click on each of the markers
to check the information
display on the map
Does the
Google Map
displays
correctly with
all markers?
Is all the
information
displays
correctly and
accurately?
End
Debugging of errors
No
No
Figure 7.9: Process Flow Chart of Google Map Debugging
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
61
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
format is checked to ensure the value is correct. Figure 7.11 shows that markers information
on Google Map is tallied with the log file information.
Information from Log file:
2010-10-24 13:03,1.33015,103.776366666667,13.0KM/H
Figure 7.10: Confirmation of markers information with log file
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
62
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
7.2 Functional Test GPS Tracking System
Functional testing is needed to confirm that the GPS Tracking System is functioning well
after a few rounds of field testing. This will ensure that the user will not have any issue after
using the GPS Tracking System after some time. Figure 7.12 illustrated that the GPS
Tracking System passed the functional testing with markers plotted on the Google Map with
all the information. GPS log files for a few rounds of functional testing can be found in
Appendix E.
Figure 7.11: Functional Testing of the GPS Tracking
System
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
63
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
8 PROBLEMS AND DISCUSSION
There are certain issues which needs to be resolve in order to meet the project due date.
Therefore it is crucial to ensure that the problem is solved as soon as possible as this might
hold back the project development time.
8.1 GPS Tracker Connection Issue
The first issue identified was an error regarding the connection between the USB with the
GPS tracker. After consultation with the GPS trackers supplier, it found that the problem
occurred due to the USB-to-Serial adaptor not being included in the package. After obtaining
the missing adaptor from the supplier, the GPS tracker was able to function as planned.
Figure 8.1: USB-to-Serial Adaptor
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
64
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
8.2 GPS Tracker SMS Interval Issue
There was an issue with setting the GPS Tracker to return SMS with GPS data in 1 minute
interval, using MT80 Parameter Editor Software. MT80 Parameter Editor Software only
allows the GPS tracker to be set at a minimum of 10 minutes interval. After a thorough
research of the user manual, it was found that SMS method can be used to set the interval
timing. By sending a 0000A1 message to the GPS tracker, the tracker is set to 1 minute
interval and the system responds by a reply of Interval Set to the mobile phone. After
setting the configuration, the GPS tracker is able to send out location information in 1 minute
interval.
Sent SMS to
GPS Tracker
Received
SMS from
GPS Tracker
Figure 8.2: Illustration of Sending SMS to GPS Tracker to set 1 minute
interval
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
65
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
8.3 GPS Tracker Timing Issue
Timing send by the GPS tracker is incorrect. This issue was due to Singapore being in
GMT+08:00 time zone. Therefore configuration of the GPS tracker is necessary in order to
receive the correct timing. The GPS tracker was set with +8 hours, with minute conversion
of 480 minutes by sending the message 0000Z480. The GPS tracker will reply with the
message TimeZone Set to show that the new setting is in effect. Figure 8.3 illustrated the
SMS send to the GPS tracker and the systems reply to the new command.
Figure 8.3: Illustration of GPS Tracker Time Zone Set
Received SMS
from GPS Tracker
with Time Zone Set
Sent SMS to set
GPS tracker with
480 minutes
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
66
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
8.4 Computer Administrator Access Right Issue
GPS Tracking software is denied access to C: drive when attempting to run the application.
This is a known problem faced by Microsoft Vista and later operating system. The cause of
this problem was due to the software being required to run as an administrator. For easy
usage by the user, the program was set to Run this program as an administrator in
properties as show in Figure 8.4. Every time the program is loaded, it will prompt the user to
allow the program to run as an administrator.
Another issue faced by the program being unable to delete the file. Administrator access right
is required to delete the file from "C:\Program Files\Mobile Partner\userdata\SMS.DTC".
After online research, it was discovered that the problem was caused by Mobile Partner
application using this attribute to update the SMS data. In order to access and delete the file,
administrator accesses to the file was required in order to set the file attributes to allow for
deletion. After setting the file to the following example, the GPS Tracking System works as
planned with the deletion of file functioning via the Reset Button function.
Example:
string strDTSFile = @"C:\Program Files\Mobile Partner\userdata\SMS.DTC";
try
{
File.SetAttributes(strDTSFile, System.IO.FileAttributes.Normal);
File.Delete(strDTSFile);
}
Figure 8.4: Properties setting of GPS tracking software on Compatibility tab
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
67
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
8.5 Google Map Display Issue
Google Maps API is unable to function on Mozilla Firefox browser when the browser is in its
default setting. It appeared as a blank page when Google Map API is loaded as shown below
in Figure 8.5. Testing conducted on different browsers resulted in the discovery that Google
Maps API only functions properly with Microsoft Internet Explorer. After changing to
Microsoft Internet Explorer, the browser is able to load Google Map API without any
problems as shown in Figure 8.6.
Figure 8.6: Google Map API loaded on Microsoft Internet Explorer
Figure 8.5: Google Map API loaded on Mozilla Firefox Browser
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
68
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
9 CONCLUSIONS AND RECOMMENDATIONS
9.1 CONCLUSIONS
There are many costly GPS tracking systems available in the market. However, this project
has proved that low cost GPS tracking system can be as effective. Total cost for the GPS
tracking system is S$141.37. The GPS tracking system is able to track the vehicle location
and plot the travelled route on a map which fulfils all objectives of this project.
Remote monitoring of the GPS tracking system is also functional so that the vehicle can be
monitored from the office. Security feature like Geo-fencing can be activated via SMS send
from the mobile phone. It should however be noted that the public only has limited access to
the security feature of the software as the development kit for the mobile adaptor is not
released to the public. This results in the user being unable to active the security feature via
the computer. However, this should not be an issue to the user as GPS tracker security can be
done remotely with their mobile phone when needed.
With extensively field testing after debugging and evaluation, the GPS tracking system has
fulfil all accuracy requirements of the location being plotted on Google map. However, there
exists room for improvements on the project, which could be further enhance by the next
student taking over the project.
9.2 RECOMMENDATION
Currently, all SMS data send by the GPS is limits to only one user. The GPS tracker is able to
connect to the 3G network which transmits GPS data at high speed for storage in the server.
As such, additional expense can be saved by using this network over the above mentioned
method of SMSing as the conduct for information. At the same time, a greater number of
users are able to access the GPS information using mobile broadband or mobile
communication device.
In this project, it is limited to one GPS tracker sending GPS information to one laptop.
Multiple GPS trackers can be used to concurrently send GPS information to the same laptop.
This would allow a single user to see different vehicles on the road by filtering the phone
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
69
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
numbers used for different GPS trackers. The Google map location markers can be plotted
with different colours to differentiate between different vehicles.
Further improvements can be done for the enhancement of auto updating location markers on
Google map. Currently the user is required to click on the Read button to retrieve
information such as Latitudes, Longitude, Time, Date and Speed. This is followed by clicking
on View on Map button in order to plot the location onto the map.
10 CRITICAL REVIEWS AND REFLECTIONS
At the beginning of the project implementation, there were a lot of failures. The initial plan
was to use the mobile smart phone as a GPS tracker. Due to the complication of the Symbian
C++ programming for smart phone, there were continuous struggles and frustration as the
deadline drew near. A swift decision was made to change the project plan, in order to meet
the schedule. This has taught me to be more flexible and decisive even when the plan does
not progress as expected. Eventually, all objectives set out at the start are met within the time
frame. Encouragement and guidance from project supervisor, Dr. Tan Bee Koon was greatly
appreciated.
C# is chosen for the project as this was the programming language that the student is most
competent in. Having a basic understanding of C++ programming logic has aided the student
using C# such as for the declaring of variables and the defining functions. The internet has
proven to be a good source of research by providing multiple examples which helped provide
a better understanding in C#. This similarly applies to Google Maps API which uses
programming language like Java, where examples and tutorial can be found online. In
addition, there were numerous programming books which can be found in the
neighbourhoods library that can be loaned without any additional costs.
The completion of this project, after months of hard works has provided me with valuable
knowledge on C# and Google Maps API. Due to the student having to juggle between work
and studies, time management was one of the factors which contribute to the success of the
project. The multiple obstacles faced along the way have contributed to the strengthening of
the student time management skills, which as explained above has proven to be the crucial
factor in the success of this project.
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
70
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
References [Books]
[1] Robert I. Egbert and Joseph E. King, The GPS handbook: an outdoorsmans guide.
Canada: Burford Books Inc, 2003.
[2] Natalie M. Rosinsky, Satellites and the GPS. United States of America: Compass Point
Books, 2004.
[3] Jeanne Sturm, GPS: Global Positioning System. United States of America: Rourke
Publishing , 2009.
[4] Ahmed El-Rabbany, Introduction to GPS: The Global Positioning System, Second
Edition. United States of America: Artech House, Inc, 2006.
[5] Gwenael Le Bodic, Mobile Messaging Technologies and Services: SMS, EMS and
MMS. England: John Wiley & Sons Ltd, 2003.
[6] Bowditch, N., The America Practical Navigator, Bicentennial Edition, NIMA, Pub.
No. 9, 2002. CD-ROM
[7] Parkinson, B. W., A History of Satellite Navigation, Navigation: Journal of The
Institute of Navigation, Vol. 42, No. 1, Special Issue, 1995, pp.109-164
[8] Wright, Peter 2006, 'Beginning Visual C# 2005 Express Edition From Novice to
Professional', Apress, United States of America.
[9] Foxall, James, 'Teach Yourself C# in 24 Hours', Sams Publishing, United States of
America, 2002
[10] Nash, Trey, 'Accelerated C# 2008', Apress, United States of America, 2007
[11] Drayton Peter, Albahari Ben, Neward Ted, 'C# In A Nutshell', O Reilly & Associates
Inc., United States of America, 2002
[12] FRP, U.S. Federal Radionavigation Plan, 2001
[13] Langley, R. B., Why is the GPS Signal so Complex? GPS World, Vol. 1 No. 3,
May/June 1990, pp. 56-59.
[14] Wells, D. E., et al., Guide to GPS Positioning, Fredericton, New Brunswick: Canadian
GPS Associates, 1987
[15] Seeber, G., Satellite Geodesy, 2
nd
revision edition, Berlin, Germany: Walter de Gruyter,
2003
[16] Friedhelm Hillebrand (editor); Finn Trosby, Kevin Holley, Ian Harris, Short message
service (SMS): the creation of personal global text messaging, Wiley & Sons, New
Jersey, 2010
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
71
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
[17] Wells D.E., et al., Guide to GPS Positioning, Fredericton, New Brunwick: Canadian
GPS Associates 1987
[18] Linyuan X., Multipath in GPS Navigation and Positioning, GPS solutions, Vol. 8, 2004,
pp.49-50
[19] Weill, L. R., Conquering Multipath: The GPS Accuracy Battle, GPS world, Vol. 8, No.
4, April 1997, pp. 59-66
[20] Langley, R. B., Time, Clocks and GPS, GPS World, Vol. 2, No. 10,
November/December 1991, pp.38-42
[21] El-Rabbany, A., The Effect of Physical Correlations on the Ambiguity Resolution and
Accuracy Estimation in GPS Different Positioning, Technical Report No. 170,
Department of Geodesy and Geomatics Engineering, University of New Brunswick:
Canadian GPS Associates, 1987
References [Websites]
[1] Aerospace Corporation (2007) GPS Primer, Elements of GPS
http://www.aero.org/education/primers/gps/elements.html
[2] Appleseed, Johnny (1999-2009) The Theory and Practice of GPS
http://www.ja-gps.com.au/whatisgps.html#anchor5186443
[3] Article by Darren Griffin, How does the Global Positioning System works?
http://www.pocketgpsworld.com/howgpsworks.php
[4] Garmin, What is GPS?
http://www8.garmin.com/aboutGPS/
[5] First U.S. Publication in June, 1996 by: Corvallis Microtechnology, Inc, Introduction
to the Global Positioning System for GIS and TRAVERSE
http://www.cmtinc.com/gpsbook/
[6] LiveViewGPS (2009) GPS Asset Tracker
http://www.liveviewgps.com/gps+asset+tracker.html
[7] Maps-GPS-Info.com, GPS History, How it all started
http://www.maps-gps-info.com/gps-history.html
[8] Maps-gps-info.com, GPS Cell Phone Tracking - I Know Where You Are
http://www.maps-gps-info.com/gps-cell-phone-tracking.html
[9] National Space-Based Positioning, Navigation, and Timing Coordination Office, The
Global Positioning System
http://www.gps.gov/systems/gps/index.html
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
72
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
[10] Nelson, Robert A. (1999), The Global Positioning System
http://www.aticourses.com/global_positioning_system.htm
[11] Rey, Jorge R. (2006), An introduction to GPS
http://edis.ifas.ufl.edu/IN653
[12] Rocky Mountain Tracking (2001-2007), Smart Track GPS Tracking System
http://www.rmtracking.com/gpsproducts/smarttrack.html
[13] Smithsonian Institution, How Does GPS Works
http://www.nasm.si.edu/gps/work.html
[14] Starcom Systems (2004-2009) Fleet Management
http://www.starcomsystems.com/services_fleeta.asp
[15] SunSat Statellite Solution Co., GSM mobile phone tracking system via the GPS-
TRACK satellite network
http://www.themobiletracker.com/english/index.html
[16] The Aerospace Corporation, How GPS Works
http://www.aero.org/education/primers/gps/howgpsworks.html
[17] Topbits, How GPS Tracking Works
http://www.topbits.com/how-gps-tracking-works.html
[18] Wikipedia, the free encyclopedia, Global Positioning Systems
http://en.wikipedia.org/wiki/Global_Positioning_System
[19] Wikipedia, the free encyclopedia, GPS Satellite
http://en.wikipedia.org/wiki/GPS_satellite
[20] Wikipedia, the free encyclopedia, Compass
http://en.wikipedia.org/wiki/Compass
[21] Wikipedia, the free encyclopedia, Sextant
http://en.wikipedia.org/wiki/Sextant
[22] Wikipedia, the free encyclopedia, GPS Tracking Device
http://en.wikipedia.org/wiki/GPS_tracking_unit
[23] Wikipedia, the free encyclopedia, Trilateration
http://en.wikipedia.org/wiki/Trilateration
[24] Wikipedia, the free encyclopedia, GPS tracking unit
http://en.wikipedia.org/wiki/GPS_tracking_unit
[25] Wikipedia, the free encyclopedia, Trilateration
http://en.wikipedia.org/wiki/Trilateration
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
73
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
[26] Wikipedia, the free encyclopedia, Doppler Effect
http://en.wikipedia.org/wiki/Doppler_effect
[27] Wikipedia, the free encyclopedia, Beidou Navigation System
http://zh.wikipedia.org/wiki/%E5%8C%97%E6%96%97%E5%AF%BC%E8%88%A
A%E7%B3%BB%E7%BB%9F
[28] Wikipedia, the free encyclopedia, Galileo Positioning System
http://zh.wikipedia.org/w/index.php?title=%E4%BC%BD%E5%88%A9%E7%95%A
5%E5%8D%AB%E6%98%9F%E5%AE%9A%E4%BD%8D%E7%B3%BB%E7%B
B%9F&variant=zh-cn
[29] Wikipedia, the free encyclopedia, SMS
http://en.wikipedia.org/wiki/SMS
[30] Developers home, Basic Concepts of SMS Technology
http://www.developershome.com/sms/sms_tutorial.asp?page=basicConcepts
[31] Geneq inc., GPS The Error Budget
http://www.sxbluegps.com/gps-error-Budget.html#gpsworks
[32] IGS (International GNSS Service, IGS Product Table
http://igscb.jpl.nasa.gov/components/prods.html
[33] U.S Observatory, USNO GPS Time Transfer
http://tycho.usno.navy.mil/gpstt.html
[32] George Birbilis @zoomicon, Start/kill process with VB.net
http://zoomicon.wordpress.com/2007/04/15/startkill-processes-with-vb-net
[33] ASCII Control Characters Definition
http://www.lammertbies.nl/comm/info/ascii-characters.html#endt
[34] ASCII Table
http://www.asciitable.com/
[35] Koobmeei blogspot, Convert Degrees, Minutes, and Second to Decimal Degrees
http://koobmeej.blogspot.com/2008/08/convert-degrees-minutes-and-seconds-to.html
[36] Sparky Spider's Discoveries blogspot, Javascript: Convert DMS to DD
http://sparkyspider.blogspot.com/2006/12/javascript-object-convert-from-dms-to.html
[37] Delphi Programming Neil Moffatt 2002, Setting and Getting File Attributes
http://www.delphibasics.co.uk/Method.asp?NameSpace=System.IO&Class=File&Ty
pe=Class&Method=SetAttributes
[38] Mike Williams (2006 2010), Google Maps API Tutorial
http://econym.org.uk/gmap/
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
74
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix A
Specification of GPS Tracker Device, MT80
Items Specification
Device
Charging Voltage DC 4.2-5.5V/400mA (Mini USB port)
Battery Rechargeable and removable 700 mAh battery (3.7V)
Dimension 61x42x15mm
Weight 50g (with battery)
Operating
temperature
-20 to 55 C
Humidity 5% to 95% Non-condensing
Work time 96 hours in standby mode and 10 hours in continuous working mode
LED 2 LEDs showing GPS, GSM status
Button One SOS panic button and one power On/Off button
Microphone Built-in microphone for wiretapping
Memory 4MB
GSM
GSM module Quad-band GSM 850/900/1800/1900MHz
SIM Card Interface Support SIM card: 1.8V, 3V
GPS
GPS Chipset Latest SiRF Star III high sensitivity single-chip GPS receiver
GPS Sensitivity -159dB
GPS Frequency L1, 1575.42 MHz
C/A Code 1.023 MHz chip rate
Channels 20 channel all-in-view tracking
Position Accuracy 10 meters, 2D RMS
Velocity Accuracy 0.1 m/s
Time Accuracy 1 us synchronized to GPS time
Default datum WGS-84
Reacquisition 0.1 sec., average
Hot start <2 sec., average
Warm start 38 sec., average
Cold start 42 sec., average
Altitude Limit 18,000 meters (60,000 feet) max.
Velocity Limit 515 meters/second (1000 knots) max.
Acceleration Limit Less than 4g
Jerk Limit 20 m/sec
Certification
Module Approvals CE, GCF, FCC, RoHS, PTCRB, IC
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
75
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Specification of Huawei E1550 Mobile Adaptor
Specifications
Weight 30g
Size
11.5mm x 87.5mm x 26.0mm
(H x L x W)
Colours White
Advance Features
3.5G Yes
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
76
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix B-1: Gantt chart
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
77
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix B-2: Activities Breakdown Chart
S/N Tasks for Capstone Project Duration Start End
Project Initial Phase
1
Initial meeting up with Tutor for discussion on objective of the
project. 1 Day 30-Jan-09 30-Jan-09
2 Meeting up with Tutor on discussion of TMA 01 1 Day 6-Mar-09 6-Mar-09
3 Literature research on GPS and SMS technology 20 Days 5-Feb-09 24-Feb-09
4 Preparation of Initial Proposal Report (TMA 01) 15 Days 16-Feb-09 2-Mar-09
5 Review and submit TMA 01 4 Days 8-Mar-09 8-Mar-09
Project 2
nd
Phase
6 Research and learning of C# programming language 20 Days 15-Mar-09 3-Apr-09
7 Perform market survey on commercial GPS tracking system 3 Days 15-Mar-09 17-Mar-09
8 Source for GPS Tracker to use for the project 4 Days 18-Mar-09 21-Mar-09
9 Source for mobile adaptor to receive SMS 4 Days 21-Mar-09 24-Mar-09
Project 3
rd
Phase
10 Design the system architecture framework 5 days 3-Apr-09 7-Apr-09
11 Research on the areas of considerations for system design 20 Days 8-Apr-09 27-Apr-09
12 Research on sending and receiving of SMS using computer 10 Days 27-Apr-09 6-May-09
Project 4
th
Phase
13 Design and implement the application GUI 10 Days 7-May-09 16-May-09
14 Design and implement the tracking feature 10 Days
18-May-
09 27-May-09
15
Design and implement the coordinates conversion and data logger
modules 7 Days
28-May-
09 3-Jun-09
16 Demonstration of basic tracking function to Tutor 1 Day 6-Jun-09 6-Jun-09
17 Design and implement the security features 30 Days 7-Jun-09 6-Jul-09
18 Perform field trial on basic tracking function 1 Day 4-Jul-09 4-Jul-09
19 Design and implement the mapping feature 30 Days 6-Jul-09 4-Aug-09
20
Design and implement the SMS functions for remote access and
location query 40 Days 5-Aug-09 13-Sep-09
21 Perform testing on security and mapping features 1 Day 22-Aug-09 22-Aug-09
22 Perform testing on all SMS functions 1 Day 14-Sep-09 14-Sep-09
Project 5
th
Phase
23 Design of use case functional test plans 5 Days 15-Sep-09 19-Sep-09
24 Perform all functional tests 8 Days 20-Sep-09 27-Sep-09
25 Perform full scale field trial with all features 1 Day 18-Oct-09 18-Oct-09
Project Final Phase
26 Preparation of Final Report 30 Days 30-Sep-09 29-Oct-09
27 Discuss with Tutor on Final Report 5 Days 25-Oct-09 29-Oct-09
28 Review and Submit Final Report 12 Days 29-Oct-09 9-Nov-09
29 Prepare poster for presentation 17 Days 12-Nov-09 27-Nov-09
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
78
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix B-3: Bill of Material (BOM)
Component Description Quantity Cost Per Unit
GPS Tracker, MT80 1 S$100
SIM Card (Mobile Line) 1 S$25.68 (Monthly Fee)
Mobile Adaptor (1Mbps) 1 S$15.69 (Monthly Fee)
Total S$141.37
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
79
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
APPENDIX C
GPS Tracker Software Source Code
Appendix C-1 Main GPSTrackingSystem Class
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace GPSTrackingSystem
{
public partial class frmGPSTrackingSystem : Form
{
#region [variable]
string strFN=""; //Store file name as string
#endregion;
#region [form method]
public frmGPSTrackingSystem() //Use form method
{
InitializeComponent();
}
#endregion
Appendix C-2 rdGPSLive_CheckedChanged() Function
#region [Radio Button Control]
private void rdGPSLive_CheckedChanged(object sender, EventArgs e)
{
txtFileName.Text = "";
gv.Rows.Clear();
lblTotalRec.Text = "";
panDis.Enabled = false;
}
Appendix C-3 rdGPSHis_CheckedChanged() Function
private void rdGPSHis_CheckedChanged(object sender, EventArgs e)
{
panDis.Enabled = true;
txtFileName.Text = "";
gv.Rows.Clear();
lblTotalRec.Text = "";
}
#endregion
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
80
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix C-4 btnBrowse_Click () Function
#region [Control Button]
private void btnBrowse_Click(object sender, EventArgs e)
{
OFD.FileName = "";
txtFileName.Text = "";
OFD.Filter = "Comma Separated File (*.csv)|*.csv"; // Set filter for
History Data.
OFD.ShowDialog();
if (OFD.FileName.ToString().Trim() != "") // If file name is
not empty.
{
txtFileName.Text = OFD.FileName.ToString().Trim();
strFN = txtFileName.Text.Trim(); // Get the file
name.
}
else
return; // IF empty, exit the function and do nothing.
}
Appendix C-5 btnRead_Click () Function
private void btnRead_Click(object sender, EventArgs e)
{
gv.Rows.Clear();
lblTotalRec.Text = "";
if (rdGPSLive.Checked)
{
// Fix File name.
string strPath = @"C:\Program Files\Mobile Partner\userdata\SMS.DTC";
ReadLiveGPSData(strPath);
}
else
{
ReadHistoryData();
}
}
Appendix C-6 btnView_Click () Function
private void btnView_Click(object sender, EventArgs e)
{
if (gv.Rows.Count <= 0)
return;
if (rdGPSLive.Checked)
{
// If Live Data is checked, Load the Live data Web for Google Map API.
Process.Start("C:\\GPSTrackerLive.html");
}
else
{
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
81
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
// If History Data is checked, Load the History data Web for Google
Map API.
Process.Start("C:\\GPSTrackerHis.html");
}
}
Appendix C-7 btnClear_Click () Function
private void btnClear_Click(object sender, EventArgs e)
{
gv.Rows.Clear();
txtFileName.Text = "";
rdGPSLive.Checked = true;
strFN = "";
lblTotalRec.Text = "";
}
Appendix C-8 btnReset_Click () Function
private void btnReset_Click(object sender, EventArgs e)
{
// Kill Process and Restart Process Idea got from this link.
// http://zoomicon.wordpress.com/2007/04/15/startkill-processes-with-vb-
net
// First Kill the process.
if (KillProcess())
{
// If Successfully kill the Mobile Partner.exe, delete master and data
file.
// Now start deleting the file.
string strDTSFile = @"C:\Program Files\Mobile
Partner\userdata\SMS.DTC";
string strBAFile = @"C:\Program Files\Mobile Partner\userdata\SMS";
// First, delete DTC master file.
if (File.Exists(strDTSFile) == true)
{
try
{
File.SetAttributes(strDTSFile,
System.IO.FileAttributes.Normal);
File.Delete(strDTSFile);
}
catch (Exception ex)
{
MessageBox.Show("System failed to process SMS Master
file.\n\r" +
"Error Detail: " + ex.Message, "GPS Tracker",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
return;
}
// If master file process finished, go to each individual BA* file.
for (int i = 1; i < 4; i++)
{
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
82
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
try
{
string strFile = Path.Combine(strBAFile, "SMS.BA" + i);
if (File.Exists(strFile) == true)
{
File.Delete(strFile);
}
}
catch (Exception ex)
{
MessageBox.Show("System failed to process SMS details
file.\n\r" +
"Error Detail: " + ex.Message, "GPS Tracker",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
return;
} // End of Try Catch for Data file.
} // End of For Loop for Data File.
try
{
// After all finish, restart Mobile Partner.exe process.
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program files\Mobile Partner\Mobile
Partner.exe ";
Process.Start(proc);
}
catch (Exception ex)
{
MessageBox.Show("System failed to start Mobile Partner
Process.\n\r" +
"Error Detail: " + ex.Message, "GPS Tracker",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
return;
}
} // End of DTC file exist If else.
} // End of KillProcess Success If else.
}
Appendix C-9 btnExit_Click () Function
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
#endregion
Appendix C-10 ReadLiveGPSData(string strPath) Function
#region [User Defined Functions]
private void ReadLiveGPSData(string strPath)
{
try
{
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
83
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
// First check whether the output log file is exist or not.
if (File.Exists(@"C:\GPS_LiveLog.txt"))
File.Delete(@"C:\GPS_LiveLog.txt"); // If exist, delete it.
strFN = strPath;
// File browser must pass a file name to carry on. If empty or file
not exist, exit this method.
if (strFN == "")
return;
string str = "";
if (File.Exists(strFN) == false)
return;
// Read the file contents.
StreamReader sr = new StreamReader(strFN);
str = sr.ReadToEnd(); // Read all data from Master file.
sr.Close(); // After successfully read, must close StreamReader
object.
sr = null; // Set to nothing(Null) in order to avoid unnecessary error
like 'file is in use'.
// If content is empty, exit the method.
if (str.Trim() == "")
return;
//
*********************************************************************************
// 1. ASCII Control Characters Definition.
// http://www.lammertbies.nl/comm/info/ascii-characters.html#endt
// 2. ASCII Table.
// http://www.asciitable.com/
//
*********************************************************************************
// \0 means NUL in ASCII.
str = str.Replace("\0", ""); // Clear unnecessary data.
string[] stringSeparators = new string[] { "jL", "L+" }; // Declare
a string array which contains Delimeters.
// Split master data with delimeters.
// After splitting with the delimeters, strC will contains data in line by line format.
// In Array, line by line means each record/line will be 1 row in array.
// Array row are in position of 0,1,2,3,4,5, etc. We call it 'Index' (array index).
string[] strC = str.Split(stringSeparators, StringSplitOptions.None);
// Split master data with delimeters.
if (strC.Length <= 0) // If empty,
return; // Exit function.
string strTmp = "";
// For loop. Loop through each line in strC array string object until strC.Length.
// strC.Length is the array size (records/line number we got from above after trimming
in master data file).
for (int i = 0; i < strC.Length; i++)
{
if (strC[i].ToUpper().Contains("LATITUDE") == false &&
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
84
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
strC[i].ToUpper().Contains("LONGITUDE") == false &&
strC[i].ToUpper().Contains("SPEED") == false)
continue;
string[] strB = strC[i].Split((char)1);
if (strB.Length > 0)
strTmp = strB[0];
else
strTmp = strC[i];
string[] strD = strTmp.Split(',');
if (strD.Length != 4) // If length is not 4.
continue; // Continue for next loop.
// 1. Latitude, Longitude.
// 2. Speed.
// 3. Date.
// 4. Time.
int iStart = strD[0].IndexOf("Lati");
int iStop = strD[0].IndexOf("Longi");
string strMobile = Mid(strD[0], 0,
iStart).ToUpper().Replace("LAST:", "");
string strLati = Mid(strD[0], iStart, iStop).Replace("Latitude =",
"").Trim();
string strLongi = Mid(strD[0], iStop,
strD[0].Length).Replace("Longitude =", "").Trim();
string strSpeed = strD[1].Replace(" ", "").Replace("=",
"").ToUpper().Replace("SPEED", "").Trim();
string strDate = strD[2].Trim();
string strTime = strD[3].Substring(0, 5).Trim();
// Add to DataGridView.
gv.Rows.Add(strDate + " " + strTime, strLati, strLongi, strSpeed);
lblTotalRec.Text = gv.RowCount.ToString();
// Write current line to Text file.
StreamWriter sw = new StreamWriter(@"C:\GPS_LiveLog.txt", true);
string strValue = strDate + " " + strTime + "," +
ConvertFromDMS2DD(strLati) +
"," + ConvertFromDMS2DD(strLongi) + "," + strSpeed;
sw.WriteLine(strValue);
sw.Close();
} // End of For Loop.
} // End of Try.
catch (Exception e)
{
MessageBox.Show("*Exception Error*\n\r" + e.Message, "GPS Tracker",
MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1);
}
}
Appendix C-11 ReadHistoryData() Function
private void ReadHistoryData()
{
try
{
// First check whether the output log file is exist or not.
if (File.Exists(@"C:\GPS_HisLog.txt"))
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
85
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
File.Delete(@"C:\GPS_HisLog.txt"); // If exist, delete it.
strFN = txtFileName.Text.Trim();
// File browser must pass a file name to carry on. If empty or file
not exist, exit this method.
if (strFN == "")
return;
string str = "";
if (File.Exists(strFN) == false)
return;
// Read the file contents.
StreamReader sr = new StreamReader(strFN);
str = sr.ReadToEnd(); // Read all the contents from the file.
sr.Close(); // Clos ethe StreamReader object.
sr = null;
// If file is empty.
if (str.Trim() == "")
return; // Exit.
string[] strSeparator = new string[] { "," }; // Delimeter.
str = str.Replace("\"", ""); // Clear unnecessary data from Read
Data.
str = str.Replace("Name/Number,Content,Time,", ""); // Replace or
clear Title.
string[] strData = str.Split('\n'); // Split the Read
Data line by line.
for (int i = 0; i < strData.Length; i++)
{
if (strData[i].Trim() == "") // If this is an empty line.
continue; // Continue or Go to Next 'i'
number.
// Trim out white space, remove \r at line end if has any.
// Replace 'Last' data with empty.
string strTmp = strData[i].Trim().Replace("\r",
"").Replace("Last:", "").Replace("LAST:", "");
string[] strD = strTmp.Split(','); // Split again with ','
(Comma).
if (strD.Length != 6) // If Count is not 6,
return; // Exit function
(Somewhere wrong in Read Data).
// 0. GPS Ph number.
// 1. Latitude, Longitude.
// 2. Speed.
// 3. Date.
// 4. Time.
// 5. Extra data.
int iStart = strD[1].IndexOf("Lati");
int iStop = strD[1].IndexOf("Longi");
string strMobile = strD[0].Trim();
string strLati = Mid(strD[1], iStart, iStop).Replace("Latitude =",
"").Trim();
string strLongi = Mid(strD[1], iStop,
strD[1].Length).Replace("Longitude =", "").Trim();
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
86
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
string strSpeed = strD[2].Replace(" ", "").Replace("=",
"").ToUpper().Replace("SPEED", "").Trim();
string strDate = strD[3].Trim();
string strTime = strD[4].Trim();
gv.Rows.Add(strDate + " " + strTime, strLati, strLongi, strSpeed);
lblTotalRec.Text = gv.RowCount.ToString();
// After processing finish for current line, Write the data to
file.
StreamWriter sw = new StreamWriter(@"C:\GPS_HisLog.txt", true);
string strValue = strDate + " " + strTime + "," +
ConvertFromDMS2DD(strLati) +
"," + ConvertFromDMS2DD(strLongi) + "," + strSpeed;
sw.WriteLine(strValue);
sw.Close();
} // For Loop.
}
catch (Exception e)
{
MessageBox.Show("*Exception Error*\n\r" + e.Message, "GPS Tracker",
MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1);
}
}
Appendix C-12 ConvertFromDMS2DD(string strData) Function
// Convert from DMS to DD value.
private string ConvertFromDMS2DD(string strData)
{
string[] strD = strData.Split(' ');
if (strD.Length != 3)
return "";
string str3 = strD[2];
strD[2] = strD[2].ToUpper().Replace("N", "").Replace("E", "").Replace("S",
"").Replace("W", "");
// Formula to convert DMS to DD.
// Degree + (Minute / 60 ) + (Seconds / 3600)
// If West or South, multiply by -1
double dD = Convert.ToDouble(strD[0]) + (Convert.ToDouble(strD[1]) / 60) +
(Convert.ToDouble(strD[2]) / 3600);
if (str3.ToUpper() == "S" || str3.ToUpper() == "W")
dD *= -1;
//dD = Math.Round(dD, 3, MidpointRounding.AwayFromZero);
return dD.ToString();
}
Appendix C-12 Mid(string strData, int iPos1, int iPos2) Function
// Mid function which return the string from Start and End Position.
public static string Mid(string strData, int iPos1, int iPos2)
{
// If Empty, return empty.
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
87
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
if (strData.Trim() == "")
return "";
string strTmp = strData.Substring(iPos1, iPos2 - iPos1).Trim();
return strTmp;
}
Appendix C-12 KillProcess() Function
private bool KillProcess()
{
try
{
// First get all the process list running in Task Manager.
Process[] plist = Process.GetProcesses();
// Follow by loop through the list and find Mobile Partner softwar
process name.
foreach (Process p in plist)
{
try
{
// If found, Kill it. (Stop the process/End task the process.)
if (p.MainModule.ModuleName.ToUpper() == "MOBILE PARTNER.EXE")
{
p.Kill();
return true; // Return from the function.
}
}
catch (Exception e)
{
Console.WriteLine(e);
// seems listing modules for some processes fails, so better
ignore any exceptions here.
}
}
return true;
}
catch (Exception e)
{
MessageBox.Show("Exception Error*\n\r" + e.Message, "GPS Tracker",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
return false;
}
}
#endregion
}
}
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
88
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix D
Mapping Source Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>GPS Live Data on Google Map</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAwL0hBKXKlI2xKObyfhKE9BSpJbTgDT
5ZInO2WrTXInp1vxnZqRQFvtE0ku7XDAx1QfD7juyFQwCC1g"
type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<!-- you can use tables or divs for the overall layout -->
<table border=1>
<tr>
<td>
<div id="map" style="width: 1200px; height: 650px"></div>
</td>
<td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
</td>
</tr>
</table>
<noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
However, it seems JavaScript is either disabled or not supported by your browser.
To view Google Maps, enable JavaScript by changing your browser options, and then
try again.
</noscript>
<script type="text/javascript">
//<![CDATA[
// Example Got from here --> http: //www.codeproject.com/KB/scripting/GetURLParameters.aspx
function getURLParameters()
{
var sURL = document.URL.toString();
if (sURL.indexOf("?") > 0)
{
var arrParams = sURL.split("?");
var arrURLParams = arrParams[1].split("&");
var arrParamNames = new Array(arrURLParams.length);
var arrParamValues = new Array(arrURLParams.length);
var i = 0;
for (i = 0; i < arrURLParams.length; i++) {
var sParam = arrURLParams[i].split("=");
arrParamNames[i] = sParam[0];
if (sParam[1] != "")
arrParamValues[i] = unescape(sParam[1]);
else
arrParamValues[i] = "";
}
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
89
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
return arrParamValues[0];
} else {
return "";
}
}
if (GBrowserIsCompatible())
{
var gmarkers = [];
var markers = [];
var realaddress;
// Right now this function is not used. Just for future extension.
// User can pass the parameter in URL and below javascript will grab the parameter
// based on that parameter, it will load related text file (Live or History GPS Data).
// A function to create the marker and set up the event window
function createMarker(point,time,lat,lng,speed)
{
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
map.panTo(point);
var geocoder = new GClientGeocoder();
geocoder.getLocations(point, function(response){
var place = response.Placemark[0];
realaddress = place.address;})
window.setTimeout(function() {
marker.openInfoWindowHtml('<b>Time Stamp: </b>' + time + '<br>' +
'<b>Latitude: </b>' + lat + '<br>' + '<b>Longtitude: </b>' + lng + '<br>' +
'<b>Speed: </b>' + speed + '<br>' +
'<b>Address: </b>' + realaddress);}, 1000);
});
return marker;
}
// create the map
var map = new GMap2(document.getElementById("map"));
var mgr = new GMarkerManager(map);
var customUI = map.getDefaultUI();
customUI.maptypes.hybrid = true;
map.setUI(customUI);
map.setCenter(new GLatLng(1.31401,103.795221), 12);
// === Define the function thats going to process the text file ===
process_GPS_logfile = function(doc)
{
// === split the document into lines ===
lines = doc.split("\n");
for (var i=0; i<lines.length; i++)
{
if (lines[i].length > 1)
{
// === split each line into parts separated by "," and use the contents ===
parts = lines[i].split(",");
var time = parts[0];
var lat = parseFloat(parts[1]);
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
90
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
var lng = parseFloat(parts[2]);
var speed = parts[3];
var point = new GLatLng(lat,lng);
// create the marker
var marker = createMarker(point,time,lat,lng,speed);
markers.push(marker);
}
}
mgr.addMarkers(markers,0,17);
mgr.refresh();
}
GDownloadUrl("GPS_LiveLog.txt", process_GPS_logfile);
}
else
{
alert("Sorry, the Google Maps API is not compatible with this browser");
}
//]]>
</script>
</body>
</html>
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
91
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix E
Field Testing Results
Listed below are parts of the field testing from Alexandra Road to Ang Mo Kio. These log
files was exported from Mobile Partner for the justification of few successful field testing.
Some pictures were taken during the field testing can be located in Appendix E-2.
Appendix E-1: Journey from Alexandra to Ang Mo Kio
Name/Number Content Time
6591541895 Latitude = 01 17 14.15N Longitude = 103 48 15.28E,Speed = 0.6Km/h,2010-09-21,16:28 2010 921162845
6591541895 Latitude = 01 17 11.31N Longitude = 103 48 21.63E,Speed = 15.4Km/h,2010-09-21,16:27 2010 921162832
6591541895 Latitude = 01 17 09.36N Longitude = 103 48 37.60E,Speed = 17.0Km/h,2010-09-21,16:26 2010 921162825
6591541895 Latitude = 01 17 05.55N Longitude = 103 48 52.82E,Speed = 1.0Km/h,2010-09-21,16:25 2010 921162544
6591541895 Latitude = 01 17 01.95N Longitude = 103 49 07.33E,Speed = 23.1Km/h,2010-09-21,16:24 2010 921162446
6591541895 Latitude = 01 16 58.86N Longitude = 103 49 15.59E,Speed = 0.4Km/h,2010-09-21,16:23 2010 921162345
6591541895 Latitude = 01 16 56.99N Longitude = 103 49 19.80E,Speed = 42.8Km/h,2010-09-21,16:22 2010 921162246
6591541895 Latitude = 01 16 54.21N Longitude = 103 49 26.51E,Speed = 0.4Km/h,2010-09-21,16:21 2010 921162145
6591541895 Latitude = 01 16 54.60N Longitude = 103 49 27.48E,Speed = 7.5Km/h,2010-09-21,16:20 2010 921162043
6591541895 Latitude = 01 16 50.92N Longitude = 103 49 33.01E,Speed = 0.5Km/h,2010-09-21,16:19 2010 921161945
6591541895 Latitude = 01 16 50.72N Longitude = 103 49 33.68E,Speed = 5.5Km/h,2010-09-21,16:18 2010 921161846
6591541895 Latitude = 01 16 47.20N Longitude = 103 49 39.86E,Speed = 23.7Km/h,2010-09-21,16:17 2010 921161743
6591541895 Latitude = 01 16 52.52N Longitude = 103 49 52.87E,Speed = 63.0Km/h,2010-09-21,16:16 2010 921161645
6591541895 Last: Latitude = 01 17 59.84N Longitude = 103 50 40.62E,Speed = 0.0Km/h,2010-09-21,16:14 2010 921161547
6591541895 Latitude = 01 18 01.42N Longitude = 103 50 38.79E,Speed = 89.1Km/h,2010-09-21,16:14 2010 921161444
6591541895 Latitude = 01 18 36.98N Longitude = 103 50 39.29E,Speed = 88.5Km/h,2010-09-21,16:13 2010 921161343
6591541895 Latitude = 01 19 07.06N Longitude = 103 51 06.36E,Speed = 79.4Km/h,2010-09-21,16:12 2010 921161249
6591541895 Latitude = 01 19 34.24N Longitude = 103 51 39.29E,Speed = 74.3Km/h,2010-09-21,16:11 2010 921161142
6591541895 Latitude = 01 20 11.27N Longitude = 103 51 44.01E,Speed = 41.7Km/h,2010-09-21,16:10 2010 921161042
6591541895 Latitude = 01 20 38.80N Longitude = 103 51 36.68E,Speed = 68.9Km/h,2010-09-21,16:09 2010 92116 944
6591541895 Latitude = 01 21 15.89N Longitude = 103 51 24.78E,Speed = 76.2Km/h,2010-09-21,16:08 2010 92116 843
6591541895 Last: Latitude = 01 21 08.74N Longitude = 103 50 24.56E,Speed = 0.0Km/h,2010-09-21,14:57 2010 92116 741
6591541895 Last: Latitude = 01 21 08.74N Longitude = 103 50 24.56E,Speed = 0.0Km/h,2010-09-21,14:57 2010 92116 642
6591541895 Latitude = 01 20 58.73N Longitude = 103 50 22.30E,Speed = 64.2Km/h,2010-09-21,14:56 2010 921145652
6591541895 Latitude = 01 20 53.02N Longitude = 103 50 16.64E,Speed = 0.0Km/h,2010-09-21,14:55 2010 921145552
6591541895 Latitude = 01 20 51.94N Longitude = 103 50 17.37E,Speed = 32.7Km/h,2010-09-21,14:54 2010 921145450
6591541895 Latitude = 01 20 25.93N Longitude = 103 49 54.32E,Speed = 67.1Km/h,2010-09-21,14:53 2010 921145350
6591541895 Latitude = 01 20 24.81N Longitude = 103 49 17.86E,Speed = 72.7Km/h,2010-09-21,14:52 2010 921145253
6591541895 Latitude = 01 19 49.43N Longitude = 103 48 54.41E,Speed = 75.8Km/h,2010-09-21,14:51 2010 921145151
6591541895 Latitude = 01 19 10.13N Longitude = 103 48 37.04E,Speed = 85.3Km/h,2010-09-21,14:50 2010 921145052
6591541895 Latitude = 01 18 59.49N Longitude = 103 48 23.63E,Speed = 0.7Km/h,2010-09-21,14:49 2010 921144953
6591541895 Latitude = 01 18 36.61N Longitude = 103 48 12.16E,Speed = 99.2Km/h,2010-09-21,14:48 2010 921144851
6591541895 Latitude = 01 17 51.23N Longitude = 103 48 01.26E,Speed = 80.9Km/h,2010-09-21,14:47 2010 921144752
6591541895 Last: Latitude = 01 16 36.32N Longitude = 103 47 58.29E,Speed = 0.0Km/h,2010-09-02,16:44 2010 921144655
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
92
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure E-1: Journey of field testing from Alexandra Road to Ang Mo Kio
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
93
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Appendix E-2: Journey from SIM University to Singapore Polytechnic and
back to SIM University
Name/Number Content Time
6591541895 Last: Latitude = 01 19 47.71N Longitude = 103 46 33.31E,Speed = 0.0Km/h,2010-10-24,13:33 20101024133433
6591541895 Last: Latitude = 01 19 47.71N Longitude = 103 46 33.31E,Speed = 0.0Km/h,2010-10-24,13:33 20101024133332
6591541895 Latitude = 01 19 46.92N Longitude = 103 46 38.30E,Speed = 22.7Km/h,2010-10-24,13:32 20101024133233
6591541895 Latitude = 01 19 30.13N Longitude = 103 46 25.49E,Speed = 50.7Km/h,2010-10-24,13:31 20101024133135
6591541895 Latitude = 01 19 05.36N Longitude = 103 46 16.63E,Speed = 52.8Km/h,2010-10-24,13:30 20101024133034
6591541895 Latitude = 01 18 48.30N Longitude = 103 46 19.27E,Speed = 54.7Km/h,2010-10-24,13:29 20101024132933
6591541895 Latitude = 01 18 43.41N Longitude = 103 46 20.67E,Speed = 0.1Km/h,2010-10-24,13:28 20101024132833
6591541895 Latitude = 01 18 44.84N Longitude = 103 46 32.65E,Speed = 53.2Km/h,2010-10-24,13:27 20101024132732
6591541895 Latitude = 01 18 31.40N Longitude = 103 46 57.86E,Speed = 42.3Km/h,2010-10-24,13:26 20101024132632
6591541895 Latitude = 01 18 27.39N Longitude = 103 47 06.77E,Speed = 45.7Km/h,2010-10-24,13:25 20101024132534
6591541895 Latitude = 01 18 29.55N Longitude = 103 47 22.90E,Speed = 0.2Km/h,2010-10-24,13:24 20101024132433
6591541895 Latitude = 01 18 18.03N Longitude = 103 47 21.10E,Speed = 49.5Km/h,2010-10-24,13:23 20101024132332
6591541895 Latitude = 01 17 53.93N Longitude = 103 47 07.14E,Speed = 53.4Km/h,2010-10-24,13:22 20101024132232
6591541895 Latitude = 01 17 39.97N Longitude = 103 47 08.82E,Speed = 46.4Km/h,2010-10-24,13:21 20101024132130
6591541895 Latitude = 01 17 36.83N Longitude = 103 47 06.48E,Speed = 9.0Km/h,2010-10-24,13:20 20101024132033
6591541895 Latitude = 01 17 49.08N Longitude = 103 46 56.17E,Speed = 27.0Km/h,2010-10-24,13:19 20101024131931
6591541895 Latitude = 01 17 50.71N Longitude = 103 46 41.48E,Speed = 38.0Km/h,2010-10-24,13:18 20101024131830
6591541895 Latitude = 01 17 59.16N Longitude = 103 46 28.70E,Speed = 22.1Km/h,2010-10-24,13:17 20101024131732
6591541895 Latitude = 01 18 04.56N Longitude = 103 46 17.45E,Speed = 38.2Km/h,2010-10-24,13:16 20101024131631
6591541895 Latitude = 01 18 21.76N Longitude = 103 46 16.78E,Speed = 10.0Km/h,2010-10-24,13:15 20101024131531
6591541895 Latitude = 01 18 31.82N Longitude = 103 46 25.91E,Speed = 53.3Km/h,2010-10-24,13:14 20101024131433
6591541895 Latitude = 01 18 21.11N Longitude = 103 46 49.10E,Speed = 34.8Km/h,2010-10-24,13:13 20101024131332
6591541895 Latitude = 01 18 20.64N Longitude = 103 46 50.54E,Speed = 5.2Km/h,2010-10-24,13:12 20101024131231
6591541895 Latitude = 01 18 35.39N Longitude = 103 46 53.02E,Speed = 46.5Km/h,2010-10-24,13:11 20101024131130
6591541895 Latitude = 01 18 45.19N Longitude = 103 46 28.79E,Speed = 47.7Km/h,2010-10-24,13:10 20101024131033
6591541895 Latitude = 01 19 00.26N Longitude = 103 46 18.32E,Speed = 51.5Km/h,2010-10-24,13:09 2010102413 930
6591541895 Latitude = 01 19 25.25N Longitude = 103 46 20.55E,Speed = 54.8Km/h,2010-10-24,13:08 2010102413 829
6591541895 Latitude = 01 19 44.56N Longitude = 103 46 38.55E,Speed = 51.1Km/h,2010-10-24,13:07 2010102413 731
6591541895 Latitude = 01 20 13.02N Longitude = 103 46 43.54E,Speed = 39.0Km/h,2010-10-24,13:06 2010102413 630
6591541895 Latitude = 01 20 10.60N Longitude = 103 46 42.01E,Speed = 36.4Km/h,2010-10-24,13:05 2010102413 529
6591541895 Latitude = 01 19 48.64N Longitude = 103 46 39.57E,Speed = 39.8Km/h,2010-10-24,13:04 2010102413 429
6591541895 Latitude = 01 19 48.54N Longitude = 103 46 34.92E,Speed = 13.0Km/h,2010-10-24,13:03 2010102413 328
6591541895 Latitude = 01 19 51.40N Longitude = 103 46 31.85E,Speed = 0.0Km/h,2010-10-24,13:02 2010102413 231
6591541895 Latitude = 01 19 51.37N Longitude = 103 46 31.89E,Speed = 0.0Km/h,2010-10-24,13:01 2010102413 130
6591541895 Last: Latitude = 01 17 46.86N Longitude = 103 46 59.27E,Speed = 0.0Km/h,2010-10-09,13:47 2010102413 1 2
6591541895 Last: Latitude = 01 17 46.86N Longitude = 103 46 59.27E,Speed = 0.0Km/h,2010-10-09,13:47 2010102413 057
6591541895 Last: Latitude = 01 17 46.86N Longitude = 103 46 59.27E,Speed = 0.0Km/h,2010-10-09,13:47 20101024125930
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
94
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure E-2: Journey of field testing from SIM University to Singapore Polytechnic and back to SIM University
Figure E-3: SIM University
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
95
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure E-4: Ngee Ann Polytechnic
Figure E-5: Sunset Way
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
96
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure E-6: Singapore Polytechnic
Figure E-7: SingTel Tower at Dover
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
97
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Figure E-9: Ministry of Education (MOE) at Buona Vista
Figure E-8: National University of Singapore (NUS)
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
98
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Glossary
Almanac data
A set of parameters for each GPS satellite that can be used to calculate its approximate
location in orbit
Altitude
The height of an object above a reference level, especially above sea level or above the
Earths surface
American Standard Code for Information Exchange (ASCII)
A character-encoding scheme based on the ordering of English alphabet.
Application Programming Interface (API)
A set of routines, data structures, object classes and/or protocols provided by libraries and/or
operating system services in order to support the building of applications.
Coordinate
A number that identifies a position relative to an axis
Ephemeris data
Precise orbital position and clock data for each GPS satellite
Equator
The line which encircles the Earth at an equal distance from the North and South Poles
Global Positioning System (GPS)
A global navigation satellite system which provides reliable positioning, navigation and
timing services to worldwide users on a continuous basis in all weather, day and night, and
anywhere on or near the Earth.
Global System for Mobile Communications (GSM)
An international standard for wireless technology
Student Name/ Student No.: Tan Yong Peng Charles / J0704259
99
BME499 ENG499 MTD499 ICT499 MTH499 CAPSTONE PROJECT REPORT
Graphical User Interface (GUI)
A user interface based on graphics (icons, pictures or menus) instead of text; uses a mouse as
well as a keyboard as an input device.
Ionosphere
The outer region of the Earths atmosphere, distinguished because it is ionised by solar
radiation.
Latitude
Latitude is the angular distance between the Equator, with positive values going north and
negative values going south on the surface of the earth.
Longitude
Longitude is the angular distance between the Prime Meridian (which is the longitude that
runs through Greenwich, England), with positive values going east and negative values going
west on the surface of the Earth.
Pseudorandom code
The identifying signature signal transmitted by each GPS satellite and mirrored by the GPS
receiver in order to separate and retrieve the signal from background noise.
Short Message Service (SMS)
A communication protocol that enables the exchange of short text messages between mobile
devices.
Troposphere
It is lowest portion of the Earths atmosphere. It contains approximately 75% of the
atmospheres mass and 99% of its water vapour and aerosols.
Universal Serial Bus (USB)
A way of setting up communication between a computer and peripheral devices