Professional Documents
Culture Documents
Vehicle Tracking Using GPS PDF
Vehicle Tracking Using GPS PDF
SCHOOL OF ENGINEERING
DEPT. OF ELECTRICAL AND INFORMATION
ENGINEERING
PROJECT REPORT
TITLE OF PROJECT: VEHICLE TRACKING
USINGGPS
NAME: GICHANA MARTIN OGETO
ADM NO: F17/37585/2010
YEAR OF STUDY: 5TH YEAR
PROJECT SUPERVISOR: MR. AHMED SAYYID
EXAMINER: PROF. ELIJAH MWANGI
DUE DATE: Thursday, April 23, 2015
Project leading to the award of Bachelor of Science in Electrical and Information Engineering
DECLARATIONOF ORIGINALITY
F17/37585/2010
SCHOOL OF ENGINEERING
i. I understand what plagiarism is and I am aware of the university policy in this regard.
ii. I declare that this final year project is my own originality work and has not been
submitted elsewhere for examination, award of a degree or publication. Where other
peoples work, or my own work has been used, this has properly been acknowledged
and referenced in accordance with the University of Nairobi`s requirements.
iii. I have not sought or used the service of any professional agencies to produce the
work.
iv. I have not allowed, shall not allow anyone to copy this work with the intention of
passing it as his/her own work.
v. I understand that any false claim in respect of this work shall result in disciplinary
action, In accordance with University anti-plagiarism policy.
Signature: _________________________________
Date: _________________________________
i
DEDICATION
To my father and mother, David Okeyo Gichana and Zaveria Wanjiru Gichana together with my
brothers Kevin Mochiemo and Newton Mogaka and my girlfriend Renalda Mwanyuma.
ACKNOWLEDGEMENT
I am greatly indebted to a number of people without whose assistance and input this project could
not be a success.
I am more indebted to my supervisor, Mr. Ahmed Sayyid who guided me throughout the project ups
and downs. He remained as my great source of inspiration and always opened my way of looking at
things beyond what I could imagine as possible. Great thanks to all the lecturers and other staff
members who have assisted me during the course of my studies and also throughout the project
implementation period.
I am also thankful to the two most beloved women in my life, my mother and my girlfriend for their
continuous support both financially and emotionally during the entire life in campus. They stood by
me at times of need when I was almost losing it and helped me rise back to my feet.
To my beloved father for the life teachings that he gave me throughout my study in campus and for
being there to ensure I don’t lack motivation to better myself in this life time since we only live ones.
Lastly and most importantly, I would like to appreciate my classmates for their suggestions and
opinions on my project and to University of Nairobi for giving me the opportunity to study BSc.
Electrical and Information Engineering for five years and through Fablab to help me complete my
project.
Table of Contents
DEDICATION ........................................................................................................................................................... II
ACRONYMS.......................................................................................................................................................... VIII
ABSTRACT ............................................................................................................................................................... X
CHAPTER 1.............................................................................................................................................................. 11
CHAPTER 2.............................................................................................................................................................. 17
CHAPTER 3.............................................................................................................................................................. 24
CHAPTER 4.............................................................................................................................................................. 38
CHAPTER 5.............................................................................................................................................................. 50
APPENDIX .................................................................................................................................................................. I
REFERENCES ........................................................................................................................................................ XX
List of Figures
TTFF Time-To-First-Fix
CS Communication Service
AT ATtention commands
The current position of the vehicle was acquired by a GPS device (SIM 908) which is integrated in
the target vehicle and the location coordinates are sent through GPRS service provided by the GSM
network. The GPS data are sent using Get method of HTTP protocol, the data at server side are
stored in a database tables and can be retrieved as request for position browsing on map. A web
application is developed using;
i. PHP
ii. JavaScript
iii. Ajax
iv. XML
v. MySQL
vi. Mozilla Firefox -32
All the above are embedded Google Map top retrieve and display web page.In this project, an
integrated cost effective web based GPS-GPRS vehicle tracking system was designed
andimplemented. The system enables enterprises owners to viewthe present and past positions
recorded of the target vehicle onGoogle Map through purpose designed web site. The currentposition
of the vehicle was acquired by GPS device which isintegrated in the target vehicle and the location
coordinatesare sent through GPRS service provided by the GSM network.
The GPS data are sent using Get method of HTTP protocol,the data at server side are stored in a
database tables and canbe retrieved as request for position browsing on map. A webapplication is
developed using PHP, JavaScript, XML,and MySQL with embedded Google Map to retrieve
anddisplay on the clients’ homepage the position and other track details.
CHAPTER 1
1. INTRODUCTION AND BACKGROUND INFORMATION
The GPS-GPRS based vehicle tracking system is one that makes use of the Global
Positioning System (GPS) to determine the precise location of a vehicle to which it is attached. I
therefore sought to design a cost effective web-based GPS-GPRS vehicle tracking system that
enables owners to view the present and past positions recorded of the target vehicle on Google Map
through a purpose designed website. With the rapidly increase in number of vehicles in Kenya, there
is an increase need of tracking your vehicle or fleet of vehicles due to the following reasons:
A GPS-GPRS based tracking system gives all the specifications about the location of a
vehicle. The system utilizes geographic position and time information from the Global Positioning
Satellites.In order to track the movement of the vehicle Google Maps used for mapping the location.
The GSM modem fetches the GPS location and sends it to the server using GPRS.
The integration of GPS and GSM was first established using SMS as a method of
transmitting GPS coordinates. The inclusion of GPRS technology to transmit location coordinates to
a remote server facilitates the tracking of object remotely using any computer connected to the web.
The GPS is a space-based satellite navigation system that provides location and time
information in all weather conditions, anywhere on or near the Earth where there is an unobstructed
line of sight to three or more GPS satellites. GPS technology can be described in terms of three
segments:
11
ii. Control Segment: Consists of 5 ground stations around the globe that manage the
operational health of the satellites by transmitting orbital corrections and clock
updates.
iii. User Segment: Consists of various types of GPS receivers that can vary in complexity
and sophistication.
GPS receivers are able to identify their location when three GPS satellites triangulate and
measure the distance to the receiver and compare the measurements. A fourth satellite measures the
time to the receiver. The information from all four satellites is compiled to determine the location.
The sophistication of a GPS receiver impacts the reliability and accuracy of the GPS data received.
General Packet Radio Service GPRS is a packet switched service based on Global System for
Mobile Communications GSM, an extensively deployed voice technology. GPRS is a 2.5 G cellular
network. It provides affordable and fast internet connections to service users. Billing is based on the
amount of data transferred rather than on the connection time. This is achieved by allocating
resources radio channels to users only when they need to send data. GPRS utilizes most nodes in an
existing GSM network; two additional nodes are introduced in the GSM network to support GPRS
Serving GPRS Support node SGSN and Gateway GPRS Support Node GGSN, these two nodes
constitute the core network of a GPRS sub-network and they are connected through an IP based
GPRS backbone network.
The web based tracking system is a system designed using a combination of several modern
information and communications technologies. The system comprises of vehicle-mounted tracking
devices, a central server system and a web-based application. Through the system, users will have
the facility of monitoring the location graphically and other relevant information of vehicle. This
system is designed to serve enterprises with an unlimited number of vehicles and complex usage
requirements. The web based system enables user to browse location track on map through
developed web application embed Google Map and interact with database server for vehicles track
details. Using the web based system enables users with different operating system platforms to easily
reach the demanded details by the existence of internet access.
1.4 System Components
The overall system functionality outcomes from interaction between the system components which
are:
Quad-Band SIM908 module is used which combines GPS technology for satellite navigation
with worldwide known technology GSM. This module is configured to connect to navigation
satellite and gets GPS location at predetermined intervals and sends this information to web
application through GPRS service provided by GSM. The GSM/GPRS engine works on frequencies
GSM 850MHz; EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM908 supports the GPRS
coding schemes CS-1, CS-2, CS-3 and CS-4. The GPS solution offers best- in-class acquisition and
tracing sensitivity, TTFF and accuracy. With a tiny configuration of 30*30*3.2mm, the device can
meet almost all the space requirements in user applications and is designed with power saving
technique so that the current consumption is as low as 1.0mA in sleep mode.
The overall functionality and usage eased using various web application development languages
where the interaction between several purposes designed applications resulted in complete integrated
system enables the users to reach and benefit of the system. The overall design goals of the web
application can be summarized in the following:
Generate reports of agent’s movements showing agent information and tracking details. Web
pages formatted using HTML elements. Appearances and text layout formatted using. HTML
embeds scripts such as JavaScript and PHP which performs functions and adds effects on the
behavior of HTML pages.
JavaScript performs all background operations and functions such as login checking, data
validation, and paging function; also JavaScript embeds Google Map API on the web site using key
and Google maps class provided by Google where vehicle locations coordination are presented.
Administration of accounts implemented using PHP functions; PHP commands can be embedded
directly into HTML source document rather than calling external file to process data. The
administration functions include adding, editing, deleting, browsing clients and agents accounts, and
formatting those accounts into tables. PHP used at the server side to store the received GPS data in
forms which is easier to examine and check relevant parts of received data. Detailed reports of
agents track also generated using PHP function where the relevant data are presented into table
contains agent basic information and detailed track including exact time and location coordination.
The database responsible for storing all system information including user login credentials, clients
information, agent information, and tracking data. Databases also enforce data integrity by ensuring
that data is collected and presented using a consistent format. For the system to be usable, it must
retrieve data efficiently. The need for efficiency has led to use complex data structures to represent
data in the database. The database architecture consists of the following layers:
i. Presentation layer: This is the topmost level of application. The presentation layer
displays information related services. The presentation layer communicates with other
tiers by outputting results to the browser/client tier and all other tiers in the network.
ii. Business Logic Layer, Data Access Layer (or middle layer): The logical layer is
pulled out from the presentation layer and, as its own layer; it controls an
application’s functionality by performing detailed processing. Another in-between
layer added to make benefit of the reusable set of functions performing database
operations, this is the DB Worker Layer.
iii. Data layer: This layer consists of database servers. Here the information is stored and
retrieved. This keeps data neutral and independent from application servers or
business logic. Giving data its own tier also improves scalability and performance.
The power supply of SIM908 is from a single source of VBAT, its normal operating voltage
is from +3V to +5V. The peak working current can rise up to 2A during maximum power
transmitting period, which cause a voltage drop lower than 3V, and the module may will
automatically power down. In our Tracker, VBAT was set to 5V.
The input voltage to the power supply is 12V or 24V DC supply voltage, which a practical
values that a present in our motor vehicles on the roads. A suitable voltage regulator was chosen that
could regulate both 12V and 24V input to give a stable output of 5V.
Status of the module during the power on/off will be done by the netlight circuit. After power
up, AT commands will not respond till the status pin change to high, and status pin will change to
low after the module is logged off from the base station in a power down procedure.
Netlight is a net status indicator. It can drive a transistor to control a LED which will blink
slowly or quickly according to different states.
1.10 Programming and Coding
In the design of a car tracker requires a lot of knowledge in various programming language to
ensure a coherent communication and storage of data. One has first of all design a desktop
application which will be the presentation layer. Here one has to know how to code and accurately
configure:
i. WAMP Server
ii. PHP as a scripting language
iii. HTML
With the interface designed and connected to a WAMP server, it has to get data from the
tracker to process and map on the website. The tracker has a microprocessor chip and a SIM908
modem module that have also to be programmed to be able to communicate together with each other
and send coordinates to the server. For this to happen successfully one has to be able to program the
microprocessor and the modem using:
This proposed car tracking system will be well equipped and up to date with cutting edge
technology. What it does best is to be cost effective and readily available to its users since the
components used are readily available to the public and can easily be purchased without government
restrictions.
In this project, we build a GPS tracker with integrated Google maps. The GPS chip outputs
the position information of the car which is transferred over GPRS link to a mobile operator`s GGSN
and then to a remote server over HTTP connection. The HTTP server stores the incoming positional
data in a MySQL database. When a client logs in to the tracking webpage, a PHP web application
embedded with JavaScript code. The JavaScript runs in the browser and integrates this information
into Google Maps through Google Maps API which displays the position on a map. Since the
positional information is retrieved every second and the maps updated at the same frequency, a real
time GPS tracking effect is achieved.
This module has different functional parts that makes it best suited to be used as a car tracker
in this project, these are:
The above are the main functional parts of the SIM908 module.
This MCU is a low-power CMOS 8-bit MCU based on the AVR enhanced RISC
architecture. By executing powerful instructions in asingle clock cycle, the MCU achieves
throughputs approaching 1 MIPS per MHz that allowed me to optimize power consumption and
processing speed. The AVR core combines a rich instruction set with 32 general purpose working
registers. All the32 registers are directly connected to the ALU, allowing two registers to be
accessed in one single instruction executed in one clock cycle. The resultingarchitecture is more
code efficient while achieving throughputs up to ten times faster than conventional microcontrollers.
This is a pictorial representation of how the different users will be interacting with the
system. It is a general overview of how each of them queries the system for a desired function
including:
This sequence diagram makes it easy to understand how the website interacts between the
application layer and the database. All user interactions designed to be through presentation layer,
were information related accounts administration and tracking on map displayed in forms of HTML
web pages. The figure below shows the interaction between application layer and database.
Databases also enforce data integrity by ensuring that data is collected and presented using a
consistent format. For the system to be usable, it must retrieve data efficiently. The need for
efficiency has led to use complex data structures to represent data in the database. The database
architecture consists of the following layers:
The figure below presents the database architecture indicating to all database layers.
Figure 5. Database Architecture Layers
CHAPTER 3
3. SYSTEMS DESIGN
SIM908 is the modem module of choice for this project. It’s the latest SIMCom modem
module and has a lot of in built functions that can be advantageous in the design of a car tracker. The
module was connected as shown below and various connections done described in detail henceforth.
Initially, the SIM908 module is initialized to start gathering GPS data from the satellite;
device initiation is done using AT commands and includes GPS and GSM module; to turn on the
GPS, first it is powered on and put in reset mode then in the worm mode where the module become
ready for receiving coordinates from satellite. The GPRS is next turned on; the process includes
GPRS power on, setting APN of service provider, initiating HTTP protocol, and setting protocol
method (Get method). Device initialization process may take up to 1 minute to worm up and
calculate the accurate position. In the SIM908 module initialization process, the process starts with
powering the module and setting the reset mode, the wormto the provider. In case of network un-
availability, theacquisitioned GPS coordinates and other data such as timeand speed are stored
temporarily until the network returnsback to service then the stored coordinates are sent withtheir
time stamp and speed.
Figure 6. SIM908 Circuit connection diagram
3.2 Power Supply Design
The power range of SIM908 is from 3.2V to 4.8V. The transmitting burst will cause voltage
drop and the power supply must be able to provide sufficient current up to 2A. For the DC car power
input, a bypass capacitor of 100µF was used and placed as close as possible to SIM908 DC input
pins.
Since there is a high drop-out between input and desired output, a DC-DC power supply will
be preferable because of its better efficiency especially with the 2A peak current in burst mode of the
module.
During the power supply design, attention was paid to power losses. The voltage was never
allowed to drop below 3.1V even when current consumption rises to 2A in the transmit burst since
the module would shut down automatically. The PCB traces from the VBAT pins to the power
supply should be wide enough to decrease Voltage drops in transmit burst. The bypass capacitor was
placed close to the module as possible.
The single 3.7V Li-ion cell battery can be connected to SIM908 VBAT pins directly. A Li-
ion 3.7V 1000mAh battery was chosen with a limited charge voltage of 4.2V.
When battery is used, the total impedance between battery and VBAT pins should be less
than 150mΩ, this was confirmed by use of a digital multimeter.
When powering on SIM908 we pull down the PWRKEY pin for at least 1 second and
release. This pin is already pulled up to 3V in the module internal, so there was no need to have an
external pull up.
When power on procedure is completed, SIM908 will send RDY (ready) command to
indicate that the module is ready to operate at a fixed baud rate but since we are not using a screen,
we will use the status and netlight indicator. In this mode during normal operation, all operations and
AT commands are available.
The SIM908 will automatically turn on when the car battery is connected to the switched off
SIM908 of which VBAT pin voltage is greater than 3.2V. SIM908 will go into the charge –only
mode. In this mode, the module does not register to the network, and has a few AT commands
available.
When the module is powered on using the VCHG signal, SIM908 status pin LED
continuously lights red. This only occurs when the car battery is discharged or doesn’t supply
enough voltage to power on the module.
SIM908 will be powered down in the following situations:
When powering down SIM908, we pull down the PWRKEY pin for at least 1 second and
release. The power down scenario is illustrated in the following figure:
This procedure makes the module log off from the network and allows the software to enter
into a secure state to save data before shut down. At this moment, AT commands cannot be executed
any more. Power down mode will therefore be indicated by STATUS pin, which is at low level at
this time.
SIM908 has integrated a charging circuit inside the module for Li-ion batteries charging
control, which makes it very convenient for battery charging support.
SIM908 has optimized the charging algorithm for the Li0Ion battery that meets the following
characteristics listed below:
i. The maximum voltage of the Li-Ion battery pack is 4.2V and the recommended
capacity is 1100mAh if exceeded the battery pack will take longer to charge.
ii. The battery pack should have a protection circuit to avoid overcharging,deep
discharging and over current, and the circuit should be insensitive to pulsed current.
iii. The internal resistance of the battery including protection circuit should be as low as
possible. In our case it should not exceed 150mΩ.
iv. The battery pack should be protected from reserve pole connection.
There are three pins in SIM908 related to battery charging function: there are VCHG, VBAT
and TEMP_BAT/ADC0 pins. The VCHG pin is driven by an external voltage, system can use this
pin to detect a charger supply and provide most charging current through SIM908 module to battery
when charging is in fast charge state. VBAT pin gives charging current to external battery from
SIM908 module. TEMP_BAT pin is used to measure the battery temperature; this pin was left open
since temperature of battery is not our concern.
The SIM interface complies with the GSM specifications (phase 1 and phase 2). The SIM
interface is powered from an internal regulator in the module. There is no need of a pull up resistor
on the SIM_DATA line is already added in the modules internal design. The following table shows
pin connections of SIM card interface.
Table 1: SIMcard pin connections
Pin Name Signal Description
A supply voltage of 5V was supplied to the microcontroller as per design specification to the
three power pins VCC, AVCC, and AREF from the power supply circuit. VCC is the digital supply
voltage, AVCC is the supply voltage pin for the A/D converter, PC3:0 and ADC7:6. It is connected
to the VCC externally regardless of whether the pins are used or not. The AREF is the analog
reference pin for the A/D converter.
Port B is an 8-bit bidirectional I/O port with internal pull up resistors. They can therefore be
used as both inputs and outputs. For this reason they are used to program the ATMEGA328P-PU
using pins PB3, PB4 and PB5 as MOSI, MISO and SCK respectively.
Port C6/RESET is used as an I/O pin. In our case PC6 was used as a reset input. A low level
on this pin for longer than the minimum pulse length will generate a reset even if the clock is not
running. We need to use an external 10KΩ pull-up resistor to the reset pin.
Port D is an 8-bit bidirectional I/O port with internal pull up resistors, this is the reason pins
PD0 and PD1 were used as transmission and reception pins. The port D output buffers have
symmetrical drive characteristics with both high sink and source capability, this is the reason why
port PD5 was used to power the SIM908 module. As inputs, Port D pins that are externally pulled
low will source current if the pull-up resistors are activated. The port D pins are tri-stated when a
reset condition becomes active, even if the clock is not running.
To be able to program the microcontroller, a six pin AVR_SPI connector was integrated in
the design circuit of the tracker and was connected as shown on the diagram.
Figure 13. ATMEGA328P-PU circuit connection diagram
Figure 14. AVR SPI 6 pin connection diagram
This is a net status indicator. It can drive a transistor to control a LED which will blink
slowly or quickly according to different states. The module cannot drive the LED directly on its own
hence the need of the transistor.
NETLIGHT has a dedicated pin in the SIM908. The circuit below is the circuit responsible
for netlight in the design.
Figure 15. Netlight circuit connection diagram
This pin is used to monitor the module status during the power on/off process. After power
up, AT commands will not respond till the status pin change to high and change to low after the
module is logged off from the base station in the power down procedure. STATUS pin has a
dedicated pin in SIM908 and was connected to GPIO of the MCU.
Figure 16. Status circuit connection diagram
Using the schematic diagram from EAGLE 7.2.0 a PCB design was extrapolated and the
PCB layout was done. As per the design there are various factors that were considered while
carrying out the design layout with special considerations for the SIM908 module. A good PCB
layout will help improve the whole performance, including reliability and efficiency. These factors
that were considered are as follows:-
i. The power trace should be short and wide, it is recommended to be routed above
12.5mil and was easily done by manually routing the power traces.
ii. The layout of ground is of great importance. A whole ground layer is the best for the
module performance if it is possible. Some noise interference signal is shielded by the
ground.
The PCB drawn with the above considerations is as follows.
43
Figure 19. Client login index page
After completion of the interface implementation, PHP scripts were programmed to do all the
form handling that are done with the administrator and the agent. The scripts also were used to
handle POST and GET functions to and from the database.
5.1 Conclusion
The main objective of the project was to develop a GPS tracking system that uploads a set of
given parameters to a database server through a GGSN network to a website where it can be viewed
remotely. The expected results were obtained as it can be evident as analysed as in CHAPTER 4
above.
i. Investigate how to protect the data collected on the website by making sure users only get to
access only those devices that they are authorized to. Generally increased security to protect
Vehicle tracker identity.
ii. To develop a mobile application for the different types of mobile Operating Systems rather
than just using a desktop application.
iii. Developing a means to show track record of where the vehicle has been rather than just the
position it is located.
APPENDIX
There are two distinct important programs that are responsible for the functionality of the system, these
are:
i. The web server program which handles the recording and displaying of the data posted by the
GPS module via GGSN network. The web server program is divided into various parts but will
only list the most important parts, namely:
a) Index.html that handles the client user interface.
b) The config.php and auth.php both of which handles establishment and
authentication of HTTP connection between the module and the server.
c) gpsinsert.php which handles the entry of the data posted by the GPS module
to the megawcoc_cartracker database in the tracklog table.
d) client_index.php that contains the google embedded maps that shows the map
and given parameters to the client.
ii. The microcontroller program that controls the GPS module to get a fix, send the fix through
GGSN network to the webserver(database and client_index.php)
<html>
<head>
<title>CarTracker Home</title>
<!-- JavaScripts-->
<script type="text/javascript">
$(document).ready(function() {
$('#slider').s3Slider({
timeOut: 1600
});
});
</script>
</head>
<body>
<div id="templatemo_wrapper">
<div id="templatemo_menu">
<ul>
<li><a href="portfolio.html">Gallery</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
<div id="templatemo_left_column">
<div id="templatemo_header">
<div id="site_title">
<div id="templatemo_sidebar">
<div id="templatemo_rss">
<a href="http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/overview.page">SUBSCRIBE
NOW <br /><span>to our rss feed</span></a>
</div>
<h4>Client Login</h4>
<tr>
<td width="112"><b>Username</b></td>
</tr>
<tr>
<td><b>Password</b></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
<div class="cleaner_h40"></div>
<h4>Adminstrator Login</h4>
<ul class="templatemo_list">
</ul>
<div id="templatemo_right_column">
<div id="featured_project">
<div id="slider">
<ul id="sliderContent">
<li class="sliderImage">
<span class="top"><strong>THE GLOBE</strong><br />GPRS has made the whole to fit on your
hand.</span>
</li>
<li class="sliderImage">
</li>
<li class="sliderImage">
</li>
<li class="sliderImage">
</li>
</div>
</div>
<div id="templatemo_main">
<p>The GPS-GPRS based vehicle tracking system is one that makes use of the Global Positioning
System (GPS) to determine the precise location of a vehicle to which it is attached. I therefore
sought to design a cost effective web-based GPS-GPRS vehicle tracking system that enables
owners to view the present and past positions recorded of the target vehicle on Google Map through
a purpose designed website. With the rapidly increase in number of vehicles in Kenya, there is an
increase need of tracking your vehicle or fleet of vehicles due to the following reasons:</p>
<ol>
<li>To know exactly where all your vehicles are and of what use they are being used for. It will tell
you what time your driver started, how long is being spent on breaks or whether the vehicle is being
used to pursue non-work related activities.</li>
<li>Can be used to settle false claim or complaints against the company that may arise hence prove
indubitably where the vehicle was at the time of the alleged and thus demonstrate that the claim is
bogus.</li>
</ol>
<p> A GPS-GPRS based tracking system gives all the specifications about the location of a
vehicle. The system utilizes geographic position and time information from the Global Positioning
Satellites. In order to track the movement of the vehicle Google Maps used for mapping the
location. The GSM modem fetches the GPS location and sends it to the server using GPRS. <br />
The integration of GPS and GSM was first established using SMS as a method of transmitting
GPS coordinates. The inclusion of GPRS technology to transmit location coordinates to a remote
server facilitates the tracking of object remotely using any computer connected to the web. </p>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner_h20"></div>
<div id="templatemo_footer">
</div>
<div class="cleaner"></div>
</body>
</html>
define('DB_HOST', 'localhost');
define('DB_USER', 'megawcoc_client');
define('DB_PASSWORD', 'GKFyn%^c0_GN');
define('DB_DATABASE', 'megawcoc_cartracker');
?>
//Start session
session_start();
header("location: access-denied.php");
exit();
?>
//$file = 'gps.txt';
$lat = getParameter("latitude");
$lon = getParameter("longitude");
$time = getParameter("time");
$sat = getParameter("satellites");
$speed = getParameter("speedOTG");
$course = getParameter("course");
$person = $lat.",".$lon.",".$time.",".$sat.",".$speed.",".$course."\n";
echo "
DATA:\n
Latitude: ".$lat."\n
Longitude: ".$lon."\n
Time: ".$time."\n
Satellites: ".$sat."\n
Speed OTG: ".$speed."\n
Course: ".$course;
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Client Index</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Load Jquery -->
<script
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyChCCC5_hDzQbonSDvSngtZPQZd5YuMdvA&se
nsor=false"></script><!--AIzaSyChCCC5_hDzQbonSDvSngtZPQZd5YuMdvA-->
<script type="text/javascript">
var myCenter=new google.maps.LatLng(-1.29206586 ,36.82194647);
var marker;
var map;
var mapProp;
function initialize()
{
mapProp = {
center:myCenter,
zoom:24,
mapTypeId:google.maps.MapTypeId.HYBRID
};
setInterval('mark()',4000);
}
function mark()
{
map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
var file = "gps.txt";
$.get(file, function(txt) {
var lines = txt.split("\n");
for (var i=0;i<lines.length;i++){
console.log(lines[i]);
var words=lines[i].split(",");
if ((words[0]!="")&&(words[1]!=""))
{
marker=new google.maps.Marker({
position:new google.maps.LatLng(words[0],words[1]),
});
marker.setMap(map);
map.setCenter(new google.maps.LatLng(words[0],words[1]));
document.getElementById('sat').innerHTML=words[3];
document.getElementById('speed').innerHTML=words[4];
document.getElementById('course').innerHTML=words[5];
}
}
marker.setAnimation(google.maps.Animation.BOUNCE);
});
<div>
<center><br />
<b> CAR TRACKER </b><br /><br />
<div id="superior" style="width:1000px;border:1px solid;color:purple">
<table style="width:100%">
<tr>
<td>Time</td>
<td>Satellites</td>
<td>Speed OTG</td>
<td>Course</td>
</tr>
<tr>
<td id="time">'. date("Y M d - H:m") .'</td>
<td id="sat"></td>
<td id="speed"></td>
<td id="course"></td>
</tr>
</table>
</div>
<br /><br />
<div id="googleMap" style="width:1000px;height:500px;"></div>
</center>
</div>';
?>
</body>
//<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</html>
<?php } ?>
int8_t answer;
int onModulePin= 2;
char data[100];
int data_size;
char aux_str[30];
char aux;
int x = 0;
char N_S,W_E;
char frame[200];
char latitude[15];
char longitude[15];
char altitude[6];
char date[16];
char time[7];
char satellites[3];
char speedOTG[10];
char course[10];
void setup(){
pinMode(onModulePin, OUTPUT);
Serial.begin(115200);
Serial.println("Starting...");
power_on();
delay(3000);
delay(3000);
delay(5000);
void loop(){
// gets GPS data
get_GPS();
send_HTTP();
delay(5000);
void power_on(){
uint8_t answer=0;
if (answer == 0)
// power on pulse
digitalWrite(onModulePin,HIGH);
delay(3000);
digitalWrite(onModulePin,LOW);
while(answer == 0){
int8_t start_GPS(){
previous = millis();
return 1;
else
return 0;
int8_t get_GPS(){
long previous;
counter = 0;
answer = 0;
previous = millis();
do{
if(Serial.available() != 0){
frame[counter] = Serial.read();
counter++;
answer = 1;
frame[counter-3] = '\0';
strtok(frame, ",");
strtok(NULL, ",");
strtok(NULL, ",");
strtok(NULL, ",");
convert2Degrees(latitude);
convert2Degrees(longitude);
return answer;
*/
float deg;
float minutes;
//auxiliar variable
char aux[10];
if (input[0] == '-')
neg = true;
else
deg = atof(aux);
minutes=atof(aux);
minutes/=1000000;
minutes += deg;
deg = 0;
else
deg=deg+minutes/60;
if (neg == true)
deg*=-1.0;
neg = false;
neg = true;
deg*=-1;
float numeroFloat=deg;
int parteEntera[10];
int cifra;
long numero=(long)numeroFloat;
int size=0;
while(1){
size=size+1;
cifra=numero%10;
numero=numero/10;
parteEntera[size-1]=cifra;
if (numero==0){
break;
int indice=0;
if( neg ){
indice++;
input[0]='-';
input[indice]=parteEntera[i]+'0';
indice++;
input[indice]='.';
indice++;
numeroFloat=(numeroFloat-(int)numeroFloat);
numeroFloat=numeroFloat*10;
cifra= (long)numeroFloat;
numeroFloat=numeroFloat-cifra;
input[indice]=char(cifra)+48;
indice++;
input[indice]='\0';
void send_HTTP(){
if (answer == 1)
if (answer == 1)
// Sets url
sprintf(frame,
"visor=false&latitude=%s&longitude=%s&altitude=%s&time=%s&satellites=%s&speedOTG=%s&course=%s",
Serial.print(frame);
if (answer == 1)
if (answer == 1)
Serial.println(F("Done!"));
else
else
else
else
{
Serial.println(F("Error initializating"));
char response[100];
delay(100);
x = 0;
previous = millis();
do{
if(Serial.available() != 0){
response[x] = Serial.read();
x++;
answer = 1;
return answer;
}
REFERENCES
[1] SIM908 AT Command Manual_Version 1.01 by SIMCom Tech company, China, 2011
[2] SIM908 Hardware Design Manual_V2.00 by SIMCom Tech company, China, 2013
[3] SIM908 Reference Design Guide_Application Note_Version 1.00 by SIMCom Tech
company, China, 2011-08-10
[4] www.ijcset.net - WEB BASED VEHICLE TRACKING SYSTEM by Khalifa A. Salim et al |
IJCSET | December 2013 | Vol 3, Issue 12, 443-448 | ISSN: 2231-0711 443IV.