1. introduction · security with optimum levels. vehicle tracking and security uses different...

80
1 1. INTRODUCTION A vehicle tracking system combines the installation of an electronic device in vehicle, or fleet of vehicle, with purpose -designed computer software to enable the owner or a third party to track the vehicle's location under theft condition and collecting data in the process from the field and deliver it to the server. Modern vehicle tracking systems commonly use GPS or GLONASS technology for locating the vehicle, but other type of automatic vehicle location technology can be used. Vehicle information can be viewed on electronic map via internet or specialized software. An integrated GPS-GSM system is proposed to track vehicles using Google Map API. The remote module has a GPS mounted on the moving vehicle to identify its current position, a processing unit to extract the received location information to be transferred by GSM modem with other parameters acquired by the automobile’s data port as an SMS and via GPRS connection to a recipient station. After data processing, Google Earth API is used to view the current location and status of the vehicle. The ability to accurately detect a vehicle’s location and its status is the main goal of the designed system. The systems is implemented using several hybrid techniques that include: wireless communication, geographical positioning and embedded applications GSM and GPS based vehicle location and tracking system will provide effective, real time vehicle location, mapping and reporting this information value and adds by improving the level of service provided. A GPS-GSM based vehicle tracking system will inform where your vehicles is and where it has been. The system uses geographical position and time information from Global Positioning Satellites. The system has an "On-Board Module " which resides in the vehicle also referred as "In-Vehicle Unit" to be tracked and a server that visualizes the location of the vehicle under the theft condition in secure mode on the map.

Upload: others

Post on 23-Sep-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

1

1. INTRODUCTION

A vehicle tracking system combines the installation of an electronic device in vehicle, or fleet

of vehicle, with purpose -designed computer software to enable the owner or a third party to

track the vehicle's location under theft condition and collecting data in the process from the

field and deliver it to the server. Modern vehicle tracking systems commonly use GPS or

GLONASS technology for locating the vehicle, but other type of automatic vehicle location

technology can be used. Vehicle information can be viewed on electronic map via internet or

specialized software.

An integrated GPS-GSM system is proposed to track vehicles using Google Map API. The

remote module has a GPS mounted on the moving vehicle to identify its current position, a

processing unit to extract the received location information to be transferred by GSM modem

with other parameters acquired by the automobile’s data port as an SMS and via GPRS

connection to a recipient station. After data processing, Google Earth API is used to view the

current location and status of the vehicle.

The ability to accurately detect a vehicle’s location and its status is the main goal of the

designed system. The systems is implemented using several hybrid techniques that include:

wireless communication, geographical positioning and embedded applications

GSM and GPS based vehicle location and tracking system will provide effective, real time

vehicle location, mapping and reporting this information value and adds by improving the

level of service provided. A GPS-GSM based vehicle tracking system will inform where your

vehicles is and where it has been. The system uses geographical position and time information

from Global Positioning Satellites. The system has an "On-Board Module " which resides in

the vehicle also referred as "In-Vehicle Unit" to be tracked and a server that visualizes the

location of the vehicle under the theft condition in secure mode on the map.

Page 2: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

2

1.1. Objectives

Depending upon the perception of the project, the objective may differ. The objective of the

project as a student of final year as a partial accomplishment for the academic qualification

differ from that of user's perception. It would be efficient to list out the objectives according

the perception of the project.

The user view objectives of this project are:

To be able to provide status of remote vehicle.

To be able to pin point vehicle's location

Provide better security and recovery of vehicle under theft condition.

To be able to log Travel information

The objective behind the development of this project as a student’s of final year is entirely to

implement the knowledge we have gained as an engineering student and a checkpoint. The

practical approach that we have attempted helps us to get more familiar with existing GPS and

GSM/GPRS networks with the view of both theoretical and practical side of the system.

To be more specific the objectives of the project can be listed as follows:

To implement a data logging system in the server side, which can be used for telemetry

To show how systems can be combined for the purpose of telemetry.

To understand in detail the electronics behind the GPS and GSM/GPRS.

Page 3: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

3

1.2. Methodology

This system is based on the ‘Data Acquisition, Logging and Control System’. The Data

Logging and control System consists of different elements. They are

Measuring the vehicle parameters such as position (latitude, longitude), time. The

sensor in this system is GPS sensor.

Recording and processing of the obtained parameters by the temporary logger unit.

Microcontroller acts as temporary logger unit.

Uploading / accessing the recorded data. The process involved is called Telemetry,

which is performed by GPRS.

Logging of the vehicle parameters in the server database.

Controlling the vehicle mode (secure, non-secure) through SMS.

Analysis and presentation of recorded data through internet.

Superimposing the data input of latitude and longitude in map and tracing the road

map.

Finally, use of accelerometer to detect theft condition for security purpose.

Page 4: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

4

2. LITERATURE REVIEW

Technology has made it easier to manage our daily life with different user friendly equipments.

Vehicle tracking and vehicle security has been uprising implementation of navigation and

wireless communication technology in this advancing society. Vehicle tracking and security

comes very handy while managing and keeping records of the vehicles. It not only facilitates

the personal users but also to the different automobile companies, taxi service companies,

government vehicles, public transportation to track their vehicles and managing the vehicle

security with optimum levels. Vehicle tracking and security uses different advanced technology

for data acquisition, data filtering, data logging, and data telemetry. It uses technology like GPS

technology, Mobile GPRS technology, device programming and handling.

Machine to Machine (M2M) communications is all about letting the machines to talk. It is a

system that enables machines to communicate with information systems or with other machines

and provide real-time data. GPRS link is used to establish the communication between the in-

vehicle tracking unit and the remote server.

In the context of Nepal there are no such location based services. This project combines the

M2M communication concept with the position based system for the purpose of vehicle

tracking and security.

The concept of position or location based-customized services is also in the rise these days. The

use of GPS has been widespread in areas such as recreational boating, commercial fishing, and

professional mariners, surveying, hiking etc. It has also been used in the emergency

management.

GPS originally developed by the U.S. army for obtaining a tactical edge over the enemies by

striking a position based attack have been recently accessible to the civilians. After it was

opened for the general public, the GPS system has been exploited for several position based

services.

Page 5: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

5

The removal of selective availability by the U.S. government in 2001 provided more accurate

positioning and since it has been used for many position based services. People around the

globe can use this service free of cost which encourages GPS based positioning systems.

Although some vendors abroad have combined the GPS and the GPRS technologies for the

similar purpose, this project provides more flexibility of reporting the end data to its users.

The evolution of GSM has provided considerable benefits compared to other technologies. The

widespread use of GSM means that the M2M product developed will be an international

product. Advanced data services, security features and several bearers such as GPRS, SMS,

HSCSD make GSM an attractive option.

Internet on the other had is a widespread communication topology. Originally developed by the

DoD as ARPANET in 1969 for information exchange, Internet now has become the most used

technology. This present time is also referred to as the “age of the Internet”. The concept of the

WWW has bloomed and provided user friendly interface to the general people. It is a cost

effective means of wide area communication.

With the dawn of the modernization of the world, development of transportation system has

also evolved highly. Each day, new vehicles with different luxurious features are being

launched in the market. And as a result, the countless vehicles are being added on the street

every day. So, the rate of the vehicles on the street is definitely increasing tremendously.

With the increase in number of the vehicles plying in the street, the problems of traffic

management, theft of the vehicles have increased in enormous fashion. These problems have

been rocketing with time. To get rid of these problems, the idea of ‘The Vehicle Tracking and

security System’ was conceived. The use of cost effective technologies such as GPS, GPRS for

the tracking of vehicles and the use of Google map to visualize the location information has

made this system economically as well as technologically feasible.

Page 6: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

6

2.1 GPS

A GPS receiver calculates its position by precisely timing the signals sent by

GPS satellites high above the Earth. Each satellite continually transmits messages that include

The time the message was transmitted.

Satellite position at time of message transmission.

The receiver uses the messages it receives to determine the transit time of each message and

computes the distance to each satellite using the speed of light. Each of these distances and

satellites' locations define a sphere. The receiver is on the surface of each of these spheres

when the distances and the satellites' locations are correct. These distances and satellites'

locations are used to compute the location of the receiver using the navigation equations. This

location is then displayed, perhaps with a moving map display or latitude and longitude;

elevation information may be included. Many GPS units show derived information such as

direction and speed, calculated from position changes.

In typical GPS operation, four or more satellites must be visible to obtain an accurate result.

Four sphere surfaces typically do not intersect. Because of this we can say with confidence

that when we solve the navigation equations to find an intersection, this solution gives us the

position of the receiver along with accurate time thereby eliminating the need for a very large,

expensive, and power hungry clock. The very accurately computed time is unused in many

GPS applications, which use only the location. A few specialized GPS applications do

however use the time; these include time transfer, traffic signal timing, and synchronization of

cell phone base stations.

Page 7: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

7

2.1.1. Structure

The current GPS consists of three major segments. These are the space segment (SS), a control

segment (CS), and a user segment (US) which are described below.

2.1.1.1. Space Segment

Figure 2.1: GPS constellation in motion with the Earth rotating.

The space segment (SS) is composed of the orbiting GPS satellites, or Space Vehicles (SV) in

GPS parlance. The GPS design originally called for 24 SVs, eight each in three approximately

circular orbits, but this was modified to six orbital planes with four satellites each. The orbits

are centered on the Earth, not rotating with the Earth, but instead fixed with respect to the

distant stars. The six orbit planes have approximately 55° inclination (tilt relative to

Earth's equator) and are separated by 60° right ascension of the ascending node (angle along

the equator from a reference point to the orbit's intersection). The orbital period is one-half a

sidereal day, i.e., 11 hours and 58 minutes. The orbits are arranged so that at least six satellites

are always within line of sight from almost everywhere on Earth's surface. The result of this

objective is that the four satellites are not evenly spaced (90 degrees) apart within each orbit.

In general terms, the angular difference between satellites in each orbit is 30, 105, 120, and

105 degrees apart which, of course, sum to 360 degrees.

Page 8: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

8

2.1.1.2. Control segment

A control segment comprises of the following components:

a master control station (MCS),

an alternate master control station,

four dedicated ground antennas and

six dedicated monitor stations

Satellite maneuvers are not precise by GPS standards. So to change the orbit of a satellite, the

satellite must be marked unhealthy, so receivers will not use it in their calculation. Then the

maneuver can be carried out, and the resulting orbit tracked from the ground. Then the new

ephemeris is uploaded and the satellite marked healthy again.

The Operation Control Segment (OCS) currently serves as the control segment of record. It

provides the operational capability that supports global GPS users and keeps the GPS system

operational and performing within specification.

2.1.1.3. User segment

In general, GPS receivers are composed of an antenna, tuned to the frequencies transmitted by

the satellites, receiver-processors, and a highly stable clock (often a crystal oscillator). They

may also include a display for providing location and speed information to the user. A receiver

is often described by its number of channels: this signifies how many satellites it can monitor

simultaneously.

2.1.2. Operation of GPS

At any point of times, there are about 24 operational GPS satellites orbiting around our globe,

which takes a period of 12 hours to orbit complete one full round. At any one point of time,

only 12 satellites can be detected as another 12 is at another side of the earth. Thus, the

satellite orbits the earth twice in a day. The satellites is operated and belonged to the U.S. Air

Force. Ground stations are used to precisely track each and every satellite's status and health.

Page 9: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

9

Theoretically, the satellites broadcast microwave radio signal to earth to determine positioning

in the Ultra High Frequency band. The GPS receiver will pick up the GPS signal. The GPS

signal is made up of 3 different bits of data which are known as pseudo random code, almanac

data and ephemeris data as follows:

Pseudorandom code: ID code that detect which satellites are broadcasting information.

The ID code can be view from the GPS’s unit satellite information screen. We used a

string of binary numbers to differentiate which satellite the signal is from. It also tells

the time difference between the transmitter and receiver. GPS satellites are around

20,000,000 meters above the Earth. The shift, which due to propagation delay is the so-

called “Time difference”. Time difference can be computed using the formula as

shown below:

Time Difference (in seconds) * 2.99792458 108 meters/second = Distance (in meters)

Almanac data: Data which has orbital parameters to differentiate between which

satellite is to be seen on the GPS receiver in the unobstructed sky. As such, the receiver

will know which satellite to follow. However, this Almanac data is not accurate as it

can be valid for several months.

An Ephemeris data: It allows the receiver to know where the GPS satellite is at any

point of time in the day. Conversely, this Ephemeris data can be only valid for 2 to 4

hours. Essentially, it is quite accurate as the GPS receiver receives the signal to provide

the orbital information that interprets the path which the satellite is following as its

orbits around.

With the aid of pseudorandom code, almanac data and ephemeris data, the GPS receiver can

easily determine the time, date, distance from satellite, velocity and satellite status and

coordination. For the GPS receiver’s location, a process called triangulation is used. And there

will a shift in frequency called Doppler Effect.

Page 10: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

10

2.1.3. Triangulation

GPS receiver can use triangulation process to determine the exact position by calculating 3 or

more distance of satellites. For instance, the 1st satellite is 11,000 miles to a point in space.

The 1st satellite is centered in a sphere which has a radius of 11, 000 miles to the surface.

There is a 2nd satellite which has a radius of 12,000 miles to the surface of the sphere. The

point where 2 spheres intersect can define some location points. However, the true location

still cannot be defined as the area coverage is too large. By using the same logic, there is 3rd

satellite which has about 13,000 miles radius to the surface of the sphere. 2 points can be

determined where the 3 satellites spheres intersect. Theses 2 points are far apart which is not

accurate. In order to find the true location, we need a 4th satellite. The in-built clock in the

GPS receiver will need to synchronize with the satellites atomic clocks to accurately calculate

the distance of the satellites to the GPS receiver. This is important as a small difference in the

time for these 2 clocks can cause hundred miles of error. By having 4th satellite predicted

point, we can determine the clock discrepancy between the locations predicted by initial 3

satellites since the GPS receiver clock is imperfect. The 4th satellite can also determine the

elevation.

2.1.4. GPS Frequency Overview

Every satellite transmits at two different frequencies called L1 and L2 frequencies. L1 has a

frequency of 1575.2MHz (19cm wavelength) and L2 a frequency of 1227.6MHz (24cm

wavelength). These carrier frequencies were chosen for GPS because the atmosphere is

transparent to them. Also, two frequencies are used instead of one because this allows easy

correction for the effect of the ionosphere on the signal propagation. The ionosphere slows the

signals and bends their path. However, ionosphere slows down the lower frequencies more

than the higher ones. Comparing the difference in signals' delay times allows removing the

effect of the ionosphere. The two carriers are modulated by various signals. Both L1 and L2

frequencies carry and broadcast satellite messages which are a low frequency data stream

containing information about the satellites' position. In addition to that two more signals are

transmitted. They are clear access or coarse acquisition C/A, and precise or private code P.

Page 11: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

11

Code C/A is available to all the users. It is carried only on the L1 frequency. The P code is

available in both L1 and L2 frequencies, and is used by the US army. The C/A code allows the

position fixes accurate to within 100m whereas, P code gives the accuracy to within 15m.

2.1.5. GPS Standard Format

Due to GPS manufacturers using their own format for GPS data representation it would be

difficult to use the data due to format differences. To overcome this problem various standards

has been made. Some of them are RINEX, RTCM SC-104, NMEA 0813.

The NMEA 0183

NMEA 0183 standard is discussed here as it is the format used by the GPS device from used

in our project. Also it is the most widely used standard by GPS devices.

NMEA 0813 is data stream in ASCII format, transmitted at a rate of 4,800 bps, from the GPS

receiver to the listener device .The NMEA 0183 data steam may include information on

position, datum, water depth and other variables. The data is sent in the form of sentences;

each starting with a dollar sign “$” and terminates with a carriage return –line

feed<CR><LF>.The dollar sign “$” is followed by five character address field, which

identifies the talker, the data type and the string format of the successive fields. The last field

in any sentence is a checksum field ,which follows a checksum delimiter character “*”.The

maximum total number of characters in any sentence is 82.A number of these sentences are

dedicated to the GPS and GLONASS system while the remaining sentences support other

devices such as echo sounders, gyros, and others.

Our sentence of interest is the GGA; Global Positioning System fix data. This sentence

represents the time and position, and solution-related information. The structure of the

sentence is written below:

$GPGGA,hhmmss.ss.llll.ll,a,yyyyy.yy,a.x,xx,.x.x.x.x,M,x.x,xxxx*hh<CR><LF>

Page 12: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

12

$ Start of sentence delimiter

GP Talker identifier (GPS in this case)

GGA Data identifier (GPS fix data in this case)

, Data field delimiter

hhmmss.ss Time of position in UTC system (hours minutes seconds .decimal)

llll.ll Latitude (degrees minutes. decimal)

a N/S(North or South)

yyyy.yy Longitude (degrees minutes .decimal)

a E/W (East or West)

x GPS quality indicator (1=points positioning with C/A-code)

xx Number of satellites used in producing the solution

x.x HDOP

x.x Orthometric Height

M Meters (units of orthometric Height)

x.x Meters (units of Geoidal Height)

xxxx Age of DGPS data in seconds (time since last RTCM message type 1 or 9

was received; null field when DGPS mode is not used

* Checksum delimiter character

hh Checksum field (last field in the sentence)

<CR><LF> Sentence termination

Table 2.1: GGA data format.

2.1.6. Applications

GPS has become a widely deployed and useful tool for commerce, scientific uses, tracking,

and surveillance. GPS's accurate time facilitates everyday activities such as banking, mobile

phone operations, and even the control of power grids by allowing well synchronized hand-off

switching.

Page 13: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

13

2.1.6.1. Civilian

Many civilian applications use one or more of GPS's three basic components: absolute

location, relative movement, and time transfer. GPS is used in many applications such as clock

synchronization, cellular telephony, geofencing, geotagging, GPS aircraft tracking, GPS tours,

map-making, navigation, phasor measurements, robotics, recreation, surveying, tectonics,

telematics, fleet tracking, etc.

2.1.6.2. Military

There are many military applications of GPS such as navigation, target tracking, search and

rescue etc. It can also be used reconnaissance for patrol movement which can be managed

more closely. GPS satellites carry a set of nuclear detonation detectors consisting of an optical

sensor (Y-sensor), an X-ray sensor, a dosimeter and an electromagnetic pulse (EMP) sensor

(W-sensor) as well for military application.

2.2. GSM

GSM (Global System for Mobile Communications, originally Groupe Spécial Mobile), is a

standard set developed by the European Telecommunications Standards Institute (ETSI) to

describe protocols for second generation (2G) digital cellular networks used by mobile

phones.

The GSM standard was developed as a replacement for first generation (1G) analog cellular

networks, and originally described a digital, circuit switched network optimized for full

duplex voice telephony. This was expanded over time to include data communications, first by

circuit switched transport, then packet data transport via GPRS (General Packet Radio

Services) and EDGE (Enhanced Data rates for GSM Evolution or EGPRS). Further

improvements were made when the 3GPP developed third generation (3G) UMTS standards

followed by fourth generation (4G) LTE Advanced standards.

Page 14: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

14

2.2.1. Network structure

Figure 2.2 : The structure of a GSM network

The network is structured into a number of discrete sections:

The Base Station Subsystem (the base stations and their controllers).

The Network and Switching Subsystem (the part of the network most similar to a fixed

network). This is sometimes also just called the core network.

The GPRS Core Network (the optional part which allows packet based Internet

connections).

The Operations support system (OSS) for maintenance of the network.

Page 15: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

15

2.2.2. GSM Frequency Bands

GSM networks operate in a number of different carrier frequency ranges (separated into GSM

frequency ranges for 2G and UMTS frequency bands for 3G), with most 2G GSM networks

operating in the 900 MHz or 1800 MHz bands. Where these bands were already allocated, the

850 MHz and 1900 MHz bands were used instead (for example in Canada and the United

States). In rare cases the 400 and 450 MHz frequency bands are assigned in some countries

because they were previously used for first-generation systems.

Most 3G networks in Europe operate in the 2100 MHz frequency band. Regardless of the

frequency selected by an operator, it is divided into timeslots for individual phones to use.

This allows eight full-rate or sixteen half-rate speech channels per radio frequency. These

eight radio timeslots (or eight burst periods) are grouped into a TDMA frame. Half rate

channels use alternate frames in the same timeslot. The channel data rate for all 8 channels is

270.833 Kbit/s, and the frame duration is 4.615 ms.

The transmission power in the handset is limited to a maximum of 2 watts in GSM

850/900 and 1 watt in GSM 1800/1900.

2.2.3. Subscriber Identity Module (SIM)

One of the key features of GSM is the Subscriber Identity Module, commonly known as

a SIM card. The SIM is a detachable smart card containing the user's subscription information

and phone book. This allows the user to retain his or her information after switching handsets.

Alternatively, the user can also change operators while retaining the handset simply by

changing the SIM. Some operators will block this by allowing the phone to use only a single

SIM, or only a SIM issued by them; this practice is known as SIM locking

Page 16: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

16

2.2.4. Short Message Service (SMS) Technology

Short Message Service (SMS) is a text messaging service component of phone, web, or mobile

communication systems, using standardized communications protocols that allow the

exchange of short text messages between fixed line or mobile phone devices.SMS text

messaging is the most widely used data application in the world, with 3.6 billion active users,

or 78% of all mobile phone subscribers. The term SMS is used as a synonym for all types of

short text messaging as well as the user activity itself in many parts of the world. SMS is also

being used as a form of direct marketing known as SMS marketing.SMS as used on modern

handsets originated from radio telegraphy in radio memo pagers using standardized phone

protocols and later defined as part of the Global System for Mobile Communications (GSM)

series of standards in 1985 as a means of sending messages of up to 160 characters, to and

from GSM mobile handsets. Since then, support for the service has expanded to include other

mobile technologies such as ANSI CDMA networks and Digital AMPS, as well as satellite

and Landline networks. Most SMS messages are mobile-to-mobile text messages though the

standard supports other types of broadcast messaging as well.

2.2.4.1. Technical details

GSM

The Short Message Service – Point to Point (SMS-PP) was originally defined in GSM

recommendation 03.40, which is now maintained in 3GPP as TS 23.040. GSM 03.41 (now

3GPP TS 23.041) defines the Short Message Service – Cell Broadcast (SMS-CB), which

allows messages (advertising, public information, etc.) to be broadcast to all mobile users in a

specified geographical area.

Messages are sent to a Short message service center (SMSC) which provides a "store and

forward" mechanism. It attempts to send messages to the SMSC's recipients. If a recipient is

not reachable, the SMSC queues the message for later retry. Some SMSCs also provide a

"forward and forget" option where transmission is tried only once.

Page 17: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

17

Message size

Transmission of short messages between the SMSC and the handset is done whenever using

the Mobile Application Part (MAP) of the SS7 protocol. Messages are sent with the MAP

MO- and MT-ForwardSM operations, whose payload length is limited by the constraints of

the signaling protocol to precisely 140 octets (140 octets = 140 * 8 bits = 1120 bits). Larger

content (concatenated SMS, multipart or segmented SMS, or "long SMS") can be sent using

multiple messages, in which case each message will start with a user data header (UDH)

containing segmentation information

AT commands

Many mobile and satellite transceiver units support the sending and receiving of SMS using an

extended version of the Hayes command set, a specific command language originally

developed for the Hayes Smartmodem 300-baud modem in 1977.

The connection between the terminal equipment and the transceiver can be realized with a

serial cable (e.g. USB), a Bluetooth link, an infrared link, etc. Common AT commands include

AT+CMGS (send message), AT+CMSS (send message from storage), AT+CMGL (list

messages) and AT+CMGR (read message).

However, not all modern devices support receiving of messages if the message storage (for

instance the device's internal memory) is not accessible using AT commands.

Unreliability

SMS messages are generally treated as lower-priority traffic than voice, and various studies

have shown that around 1% to 5% of messages are lost entirely, even during normal operation

conditions, and others may not be delivered until long after their relevance has passed.

2.3. GPRS

GSM was the most successful second generation cellular technology, but the need for higher

data rates spawned new developments to enable data to be transferred at much higher rates.

Page 18: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

18

The first system to make an impact on the market was GPRS. The letters GPRS stand for

General Packet Radio System, GPRS technology enabled much higher data rates to be

conveyed over a cellular network when compared to GSM that was voice centric.

GPRS became the first stepping-stone on the path between the second-generation GSM

cellular technology and the 3G W-CDMA / UMTS system. With GPRS technology offering

data services with data rates up to a maximum of 172 kbps, facilities such as web browsing

and other services requiring data transfer became possible. Although some data could be

transferred using GSM, the rate was too slow for real data applications.

2.3.1. GPRS benefits

GPRS technology brings a number of benefits for users and network operators alike. It was

widely deployed to provide a realistic data capability via cellular telecommunications

technology. GPRS technology offered some significant benefits:

Speed: One of the headline benefits of GPRS technology is that it offers a much

higher data rate than was possible with GSM. Rates up to 172 kbps are possible,

although the maximum data rates realistically achievable under most conditions will be

in the range 15 - 40 kbps.

Packet switched operation: Unlike GSM which was used circuit switched

techniques, GPRS technology uses packet switching in line with the Internet. This

makes far more efficient use of the available capacity, and it allows greater

commonality with Internet techniques.

Always on connectivity: A further advantage of GPRS is that it offers an "Always

On" capability. When using circuit switched techniques, charges are based on the time

a circuit is used, i.e. how long the call is. For packet switched technology charges are

for the amount of data carried as this is what uses the services provider's capacity.

Accordingly, always on connectivity is possible.

Page 19: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

19

More applications: The packet switched technology including the always on

connectivity combined with the higher data rates opens up many more possibilities for

new applications. One of the chief growth areas that arose from GPRS was the

Blackberry form of mobile or PDA. This provided for remote email applications along

with web browsing, etc.

Capex and Opex: The Capital expenditure (capex) and operational expenditure

(opex) are two major concerns for operators. As GPRS was an upgrade to existing

GSM networks (often implemented as a software upgrade achieved remotely), the

capital expenditure for introducing GPRS technology was not as high as deploying a

complete new network. Additionally opex was not greatly affected as the basic

basestation infrastructure remained basically the same. It was mainly new core network

elements that were required.

The GSM and GPRS elements of the system operate separately. The GSM technology still

carries the voice calls, while GPRS technology is sued for the data. As a result voice and data

can be sent and received simultaneously.

2.3.2. GPRS and packet switching

The key element of GPRS technology is that it uses packet switched data rather than circuit

switched data, and this technique makes much more efficient use of the available capacity.

This is because most data transfer occurs in what is often termed a "bursty" fashion. The

transfer occurs in short peaks, followed by breaks when there is little or no activity. Using a

traditional approach a circuit is switched permanently to a particular user. This is known as a

circuit switched mode. In view of the bursty nature of data transfer it means that there are

periods when it will not be carrying data.

Page 20: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

20

To improve the situation the overall capacity can be shared between several users. To achieve

this, the data is split into packets and tags inserted into the packet to provide the destination

address. Packets from several sources can then be transmitted over the link. As it is unlikely

that the data burst for different users will occur all at the same time, by sharing the overall

resource in this fashion, the channel, or combined channels can be used far more efficiently.

This approach is known as packet switching, and it is at the core of many cellular data

systems, and in this case GPRS.

2.3.3. GPRS network

GPRS and GSM are able to operate alongside one another on the same network, and using the

same base stations. However upgrades are needed. The network upgrades reflect many of

those needed for 3G, and in this way the investment in converting a network for GPRS

prepares the core infrastructure for later evolution to a 3G W-CDMA / UMTS .The upgraded

network, as described in later pages of this tutorial, has both the elements used for GSM as

well as new entities that are used for the GPRS packet data service. The upgrades that were

required for GPRS also formed the basis of the network required for the 3G deployments

(UMTS Rel 99). In this way the investment required for GPRS would not be a one off

investment used only on GPRS, it also formed the basis of the network for further

developments. In this way GPRS became a stepping stone used for the migration from 2G to

3G.

2.3.4. Key GPRS parameters

The key parameters for the GPRS, General Packet Radio System, are tabulated below:

PARAMETER SPECIFICATION

Channel Bandwidth 200 kHz

Modulation type GMSK

Page 21: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

21

Data handling Packet data

Max data rate 172 kbps

Table 2.2: Key GPRS Parameter

GPRS technology offered a significant improvement in the data transfer capacity over existing

cellular systems. It enabled many of the first email and web browsing phones such as PDAs,

Blackberries, etc to be launched. Accordingly GPRS technology heralded the beginning of a

new era in cellular communications where the mobile phone capabilities allowed significantly

more than voice calls and simple texts. GPRS enabled real data applications to be used and the

new phones to become mobile computers on the move allowing businessmen to be always in

touch with the office and domestic users to be able to use many more data applications.

With GPRS providing a move from circuit switched technology to packet switched

technology, it was necessary to upgrade the network architecture to accommodate this. To

accommodate this GPRS network architecture added new elements including the GGSN and

SGSN to the existing GSM network to be able to accommodate this.

However it was still necessary for the GPRS network elements and those from the existing

GSM elements to work along side one another. Accordingly the introduction of GPRS

technology saw the addition of some new entities within the over network architecture.

2.4. Web Hosting

A web hosting service is a type of Internet hosting service that allows individuals and

organizations to make their website accessible via the World Wide Web. Web hosts are

companies that provide space on a server owned or leased for use by clients, as well as

providing internet connectivity, typically in a data center. Web hosts can also provide data

center space and connectivity to the Internet for other servers located in their data center,

called colocation.

Page 22: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

22

The scope of web hosting services varies greatly. The most basic is web page and small-scale

file hosting, where files can be uploaded via File Transfer Protocol (FTP) or a Web interface.

The files are usually delivered to the Web "as is" or with minimal processing. Many Internet

service providers (ISPs) offer this service free to subscribers. Individuals and organizations

may also obtain Web page hosting from alternative service providers. Personal web site

hosting is typically free, advertisement-sponsored, or inexpensive. Business web site hosting

often has a higher expense.

Single page hosting is generally sufficient for personal web pages. A complex site calls for a

more comprehensive package that provides database support and application development

platforms (e.g. PHP, Java, Ruby on Rails, ColdFusion, or ASP.NET). These facilities allow

customers to write or install scripts for applications like forums and content management.

Also, Secure Sockets Layer (SSL) is typically used for e-commerce.

The host may also provide an interface or control panel for managing the Web server and

installing scripts, as well as other modules and service applications like e-mail. Some hosts

specialize in certain software or services (e.g. e-commerce), which are commonly used by

larger companies that outsource network infrastructure.

2.4.1. Reliability and uptime

The availability of a website is measured by the percentage of a year in which the website is

publicly accessible and reachable via the internet. This is different than measuring

the uptime of a system. Uptime refers to the system itself being online, however it does not

take into account being able to reach it as in the event of a network outage.

The formula to determine a system’s availability is relatively easy: Total time = 365 days per

year * 24 hours per day * 60 minutes per hour = 525,600 minutes per year. To calculate how

Page 23: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

23

many minutes of downtime a system may experience per year, take the uptime guarantee and

multiply it by total time in a year.

2.4.2. Obtaining Hosting

Web hosting is often provided as part of a general Internet access plan; there are many free

and paid providers offering these types of web hosting.

A customer needs to evaluate the requirements of the application to choose what kind of

hosting to use. Such considerations include database server software, scripting software,

and operating system. Most hosting providers provide Linux-based web hosting which offers a

wide range of different software. A typical configuration for a Linux server is

the LAMP platform: Linux, Apache, MySQL, and PHP/Perl/Python. The web hosting client

may want to have other services, such as email for their business domain, databases or multi-

media services for streaming media. A customer may also choose Windows as the hosting

platform. The customer still can choose from PHP, Perl, and Python but may also use ASP

.Net or Classic ASP. Web hosting packages often include a Web Content Management

System, so the end-user does not have to worry about the more technical aspects.

2.5. Hypertext Transfer Protocol (HTTP)

The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed,

collaborative, hypermedia information systems. HTTP is the foundation of data

communication for the World Wide Web.

Hypertext is a multi-linear set of objects, building a network by using logical links (the so-

called hyperlinks) between the nodes (e.g. text or words). HTTP is the protocol to exchange or

transfer hypertext.

Page 24: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

24

The standards development of HTTP was coordinated by the Internet Engineering Task Force

(IETF) and the World Wide Web Consortium (W3C), culminating in the publication of a

series of Requests for Comments (RFCs), most notably RFC 2616 (June 1999), which defines

HTTP/1.1, the version of HTTP in common use.

HTTP functions as a request-response protocol in the client-server computing model. A web

browser, for example, may be the client and an application running on a computer hosting a

web site may be the server. The client submits an HTTP request message to the server. The

server, which provides resources such as HTML files and other content, or performs other

functions on behalf of the client, returns a response message to the client. The response

contains completion status information about the request and may also contain requested

content in its message body.

A web browser is an example of a user agent (UA). Other types of user agent include the

indexing software used by search providers (web crawlers),voice browsers, mobile apps and

other software that accesses, consumes or displays web content.

HTTP is designed to permit intermediate network elements to improve or enable

communications between clients and servers. High-traffic websites often benefit from web

cache servers that deliver content on behalf of upstream servers to improve response time.

Web browsers cache previously accessed web resources and reuse them when possible to

reduce network traffic. HTTP proxy servers at private network boundaries can facilitate

communication for clients without a globally routable address, by relaying messages with

external servers.

HTTP is an application layer protocol designed within the framework of the Internet Protocol

Suite. Its definition presumes an underlying and reliable transport layer protocol, and

Transmission Control Protocol (TCP) predominates for this purpose. HTTP resources are

identified and located on the network by Uniform Resource Identifiers (URIs)—or, more

specifically, Uniform Resource Locators (URLs)—using the http or https URI schemes. URIs

and hyperlinks in Hypertext Markup Language (HTML) documents form webs of inter-linked

hypertext documents. On the Internet the World Wide Web was established in 1990 by

Page 25: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

25

English computer scientist and innovator Tim Berners-Lee.HTTP/1.1 is a revision of the

original HTTP (HTTP/1.0). In HTTP/1.0 a separate connection to the same server is made for

every resource request. HTTP/1.1 can reuse a connection multiple times to download images,

scripts, stylesheets etc after the page has been delivered. HTTP/1.1 communications therefore

experience less latency as the establishment of TCP connections presents considerable

overhead.

2.5.1. HTTP session

An HTTP session is a sequence of network request-response transactions. An HTTP client

initiates a request by establishing a Transmission Control Protocol (TCP) connection to a

particular porton a server (typically port 80). An HTTP server listening on that port waits for a

client's request message. Upon receiving the request, the server sends back a status line, such

as "HTTP/1.1 200 OK", and a message of its own. The body of this message is typically the

requested resource, although an error message or other information may also be returned.

2.5.2. Request Methods

HTTP defines methods (sometimes referred to as "verbs") to indicate the desired action to be

performed on the identified resource. What this resource represents, whether pre-existing data

or data that is generated dynamically, depends on the implementation of the server. Often, the

resource corresponds to a file or the output of an executable residing on the server.

The HTTP/1.0 specification defined the GET, POST and HEAD methods and the HTTP/1.1

specification added 5 new methods: OPTIONS, PUT, DELETE, TRACE and CONNECT. By

being specified in these documents their semantics is known and can be depended upon. Any

client can use any method that they want and the server can choose to support any method it

wants. If a method is unknown to an intermediate it will be treated as an un-safe and non-

idempotent method. There is no limit to the number of methods that can be defined and this

Page 26: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

26

allows for future methods to be specified without breaking existing infrastructure. For

example WebDAV defined 7 new methods and RFC5789 specified the PATCH method.

2.6. Serial Data Transmission

The digital data can be transmitted between any two devices in two ways, parallel or serial.

Serial data transmission means information is transmitted from source to destination over a

single pathway and one bit is transmitted at a time. There are two modes of serial data

transmission.

a. Simplex: Data is transmitted in single direction.

b. Duplex: Data is transmitted in either direction.

i. Half duplex: Transmission can be done on both direction but not simultaneously.

ii. Full duplex: Transmission can be done on both direction and simultaneously.

Although both synchronous and asynchronous serial data communication are widely used in

serial data transmission, brief overview on asynchronous serial data transmission is presented in

this report considering its use in the project.

2.6.1. Asynchronous Serial Data Transmission

The receiving and transmitting devices need not to be synchronized in asynchronous serial data

transmission system. The transmitting device can send one or more data units when it is ready to

send data. Each data unit must be formatted i.e. it must be transformed into specified format

before transmission. For asynchronous transmission, each data character has bit which identifies

its start and 1 or 2 bits which identify its end. Since each character is individually identified,

characters can be sent at any time i.e. asynchronously.

When no data is being sent, the signal line is in a constant high or marking state. The beginning

of a data character is indicated by the line going low for 1 bit time. This bit is called a start bit.

Page 27: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

27

The data bits are then sent out on the line one after the other. Note that the least significant bit is

sent out first. Depending on the system, the data word may consist of 5, 6, 7, or 8 bits. Following

the data bits is a parity bit, which is used to check for errors in received data. Some systems do

not insert or look for a parity bit. After the data bits and the parity bit, the signal line returned high

for at least 1 bit time to identify the end of the character. This always-high bit is referred to as

stop bit. Some older systems use 2 stop bits. Efficiency of this system is low.

2.6.1.1. UART

A universal asynchronous receiver/transmitter (usually abbreviated UART) is a type of a

“synchronous receiver/transmitter", a piece of computer hardware that translates data between

parallel and serial forms. UARTs are commonly used in conjunction with other communication

standards such as EIA RS-232. The "universal" designation indicates that the data format and

transmission speeds are configurable. A UART is usually an individual (or part of an) integrated

circuit used for serial communications over a computer or peripheral device serial port.

The Universal Asynchronous Receiver/Transmitter (UART) takes bytes of data and transmits the

individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits

into complete bytes. Each UART contains a shift register which is the fundamental method of

conversion between serial and parallel forms. Serial transmission of digital information (bits)

through a single wire or other medium is much more cost effective than parallel transmission

through multiple wires. The UART usually does not directly generate or receive the external

signals used between different items of equipment. Separate interface devices are used to convert

the logic level signals of the UART to and from the external signaling levels. External signals

may be of many different forms. Communication may be "full duplex" (both send and receive at

the same time) or "half duplex" (devices take turns transmitting and receiving).

A UART usually contains the following components:

A clock generator, usually a multiple of the bit rate to allow sampling in the middle of a

bit period.

Input and output shift registers

Page 28: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

28

Transmit/receive control

Read/write control logic

Transmit/receive buffers (optional)

Parallel data bus buffer (optional)

First-in, first-out (FIFO) buffer memory (optional)

Receiver

All operations of the UART hardware are controlled by a clock signal which runs at a multiple

(say, 16) of the data rate - each data bit is as long as 16 clock pulses. The receiver tests the state

of the incoming signal on each clock pulse, looking for the beginning of the start bit. If the

apparent start bit lasts at least one-half of the bit time, it is valid and signals the start of a new

character. If not, the spurious pulse is ignored. After waiting a further bit time, the state of the line

is again sampled and the resulting level clocked into a shift register. After the required number of

bit periods for the character length (5 to 8 bits, typically) have elapsed, the contents of the shift

register is made available (in parallel fashion) to the receiving system. The UART will set a flag

indicating new data is available, and may also generate a processor interrupt to request that the

host processor transfers the received data. In some common types of UART, a small first-in, first-

out FIFO buffer memory is inserted between the receiver shift register and the host system

interface. This allows the host processor more time to handle an interrupt from the UART and

prevents loss of received data at high rates.

Transmitter

Transmission operation is simpler since it is under the control of the transmitting system. As

soon as data is deposited in the shift register after completion of the previous character, the

UART hardware generates a start bit, shifts the required number of data bits out to the line,

generates and appends the parity bit (if used), and appends the stop bits. Since transmission of

a single character may take a long time relative to CPU speeds, the UART will maintain a flag

showing busy status so that the host system does not deposit a new character for transmission

until the previous one has been completed; this may also be done with an interrupt. Since full-

duplex operation requires characters to be sent and received at the same time, practical

Page 29: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

29

UARTs use two different shift registers for transmitted characters and received characters.

2.6.2. RS-232 standard

In telecommunications, RS-232 is the traditional name for a series of standards

for serial binary single-ended data and control signals connecting between a DTE (Data

Terminal Equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly used

in computer serial ports. The standard defines the electrical characteristics and timing of

signals, the meaning of signals, and the physical size and pinout of connectors.

The Electronic Industries Association (EIA) standard RS-232-C as of 1969 defines:

Electrical signal characteristics such as voltage levels, signaling rate, timing and slew-

rate of signals, voltage withstand level, short-circuit behavior, and maximum

load capacitance.

Interface mechanical characteristics, pluggable connectors and pin identification.

Functions of each circuit in the interface connector.

Standard subsets of interface circuits for selected telecom applications.

The standard says that bit rates should be lower than 20,000 bits per second. Details of

character format and transmission bit rate are controlled by the serial port hardware, often a

single integrated circuit called a UART that converts data from parallel to asynchronous start-

stop serial form. Details of voltage levels, slew rate, and short-circuit behavior are typically

controlled by a line driver that converts from the UART's logic levels to RS-232 compatible

signal levels, and a receiver that converts from RS-232 compatible signal levels to the UART's

logic levels.

2.6.2.1. Standard Details

In RS-232, user data is sent as a time-series of bits. Both synchronous and asynchronous

transmissions are supported by the standard. In addition to the data circuits, the standard

defines a number of control circuits used to manage the connection between the DTE and

Page 30: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

30

DCE. Each data or control circuit only operates in one direction that is, signaling from a DTE

to the attached DCE or the reverse. Since transmit data and receive data are separate circuits,

the interface can operate in a full duplex manner, supporting concurrent data flow in both

directions. The standard does not define character framing within the data stream, or character

encoding.

Voltage levels

The RS-232 standard defines the voltage levels that correspond to logical one and logical zero

levels for the data transmission and the control signal lines. Valid signals are either in the

range of +3 to +15 volts, or the range -3 to -15 volts; the range between -3 to +3 volts is not a

valid RS-232 level. Data signals and control signals use opposite polarity to represent a "true"

or logic 1 asserted state. For data transmission lines (TxD, RxD and their secondary channel

equivalents) logic one is defined as a negative voltage and logic zero is. Control signals have

the opposite polarity; the asserted state is positive voltage and the inactive state is negative

voltage. Examples of control lines include request to send (RTS), clear to send (CTS), data

terminal ready (DTR), and data set ready (DSR).

The standard specifies a maximum open-circuit voltage of 25 volts: signal levels of ±5 V, ±10

V, ±12 V, and ±15 V are all commonly seen depending on the voltages available to the line

driver circuit. Some RS-232 driver chips have inbuilt circuitry to produce the required

voltages from a 5 volt supply. RS-232 drivers and receivers must be able to withstand

indefinite short circuit to ground or to any voltage level up to ±25 volts. The slew rate, or how

fast the signal changes between levels, is also controlled.

.

Connectors

RS-232 devices may be classified as Data Terminal Equipment (DTE) or Data

Communication Equipment (DCE), this defines at each device which wires will be sending

and receiving each signal. In general and according to the standard, terminals and computers

have male connectors with DTE pin functions, and modems have female connectors with DCE

pin functions.

The standard specifies 20 different signal connections. Since most devices use only a few

Page 31: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

31

signals, smaller connectors can often be used.

Signals

The following table lists commonly used RS-232 signals and pin assignments.

Signal Origin DB-

25 Pin

DB-

9

Pin Name Typical purpose Abbrevi

ation DTE DCE

Data Terminal

Ready

Indicates presence of DTE to

DCE. DTR ●

20

4

Data Carrier

Detect

DCE is connected to the

telephone line. DCD

● 8

1

Data Set

Ready

DCE is ready to receive

commands or data. DSR

● 6

6

Ring Indicator DCE has detected an incoming

ring signal on the telephone line. RI

● 22

9

Request To

Send

DTE requests the DCE prepare to

receive data. RTS ●

4

7

Clear To Send Indicates DCE is ready to accept

data. CTS

● 5

8

Transmitted

Data Carries data from DTE to DCE. TxD ●

2

3

Received Data Carries data from DCE to DTE. RxD

● 3 2

Common Gnd

GND common 7 5

Protective Gnd

PG common 1 No

Table 2.3: RS-232 signals and pin configuration

Page 32: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

32

The signals are named from the standpoint of the DTE. The ground signal is a common return

for the other connections. The DB-25 connector includes a second "protective ground" on pin

1 which is not available on DB-9 connector.

The standard defines the maximum capacitance that a compliant drive circuit must tolerate. A

widely used rule of thumb indicates that cables more than 50 feet (15 m) long will have too

much capacitance, unless special cables are used. By using low-capacitance cables, full speed

communication can be maintained over larger distances up to about 1,000 feet (300 m). For

longer distances, other signal standards are better suited to maintain high speed. For functional

communication through a serial port interface, conventions of bit rate, character framing,

communications protocol, character encoding, data compression, and error detection, not

defined in RS 232, must be agreed to by both sending and receiving equipment.

2.7. Accelerometer

An accelerometer is a device that measures proper acceleration, also called the four-

acceleration. This proper acceleration is associated with the weight of a test mass. An

accelerometer measures all accelerations, except those accelerations due to gravity. An

accelerometer measures weight per unit of (test) mass, a quantity with dimensions of

acceleration that is sometimes known as specific force, or g-force (although it is not a force).

Another way of stating this is that by measuring weight, an accelerometer measures the

acceleration of the free-fall reference frame (inertial reference frame) relative to itself (the

accelerometer). Equivalently, accelerometers measure their own acceleration relative to free-

fall at their location (since accelerations relative to free-fall must be provided by forces that

are not gravitational forces).

Most accelerometers do not display the value they measure, but supply it to other devices.

Real accelerometers also have practical limitations in how quickly they respond to changes in

acceleration, and cannot respond to changes above a certain frequency of change. Single- and

multi-axis models of accelerometer are available to detect magnitude and direction of the

Page 33: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

33

proper acceleration (or g-force), as a vector quantity, and can be used to sense orientation

(because direction of weight changes), coordinate acceleration (so long as it produces g-force

or a change in g-force), vibration, shock, and falling in a resistive medium (a case where the

proper acceleration changes, since it starts at zero, then increases). Micromachined

accelerometers are increasingly present in portable electronic devices and video game

controllers, to detect the position of the device or provide for game input.

2.7.1. Physical Principle

An accelerometer measures proper acceleration, which is the acceleration it experiences

relative to freefall and is the acceleration felt by people and objects popularly measured in

terms of g-force.

An accelerometer at rest relative to the Earth's surface will indicate approximately 1 g

upwards, because any point on the Earth's surface is accelerating upwards relative to the local

inertial frame (the frame of a freely falling object near the surface). To obtain the acceleration

due to motion with respect to the Earth, this "gravity offset" must be subtracted and

corrections for effects caused by the Earth's rotation relative to the inertial frame. The reason

for the appearance of a gravitational offset is Einstein's equivalence principle, which states that

the effects of gravity on an object are indistinguishable from acceleration. When held fixed in

a gravitational field by, for example, applying a ground reaction force or an equivalent upward

thrust, the reference frame for an accelerometer (its own casing) accelerates upwards with

respect to a free-falling reference frame. The effects of this acceleration are indistinguishable

from any other acceleration experienced by the instrument, so that an accelerometer cannot

detect the difference between sitting in a rocket on the launch pad, and being in the same

rocket in deep space while it uses its engines to accelerate at 1 g. For similar reasons, an

accelerometer will read zero during any type of free fall. This includes use in a coasting

spaceship in deep space far from any mass, a spaceship orbiting the Earth, an airplane in a

parabolic "zero-g" arc, or any free-fall in vacuum.

Page 34: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

34

However this does not include a (non-free) fall in which air resistance produces drag forces

that reduce the acceleration, until constant terminal velocity is reached. At terminal velocity

the accelerometer will indicate 1 g acceleration upwards. For the same reason a skydiver, upon

reaching terminal velocity, does not feel as though he or she were in "free-fall", but rather

experiences a feeling similar to being supported (at 1 g) on a "bed" of uprushing air. For the

practical purpose of finding the acceleration of objects with respect to the Earth, such as for

use in an inertial navigation system, a knowledge of local gravity is required. This can be

obtained either by calibrating the device at rest, or from a known model of gravity at the

approximate current position.

2.8. Microcontroller

A microcontroller is self contained computer architecture on a single integrated circuit. It is

made of a basic computer architecture consists of a processor, memory and programmable

input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also

often included on chip, as well as a typically small amount of RAM. Microcontrollers are

designed for embedded applications, in contrast to the microprocessors used in personal

computers or other general purpose applications.

Microcontrollers are used in automatically controlled products and devices, such as

automobile engine control systems, implantable medical devices, remote controls, office

machines, appliances, power tools, toys and other embedded systems. By reducing the size

and cost compared to a design that uses a separate microprocessor, memory, and input/output

devices, microcontrollers make it economical to digitally control even more devices and

processes. Mixed signal microcontrollers are common, integrating analog components needed

to control non-digital electronic systems.

Page 35: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

35

2.8.1. Microcontroller Requirement Vehicle Tracking System

Microcontroller in vehicle tracking system serves as the main controlling unit on the vehicle

sided system. It is responsible for coordinating and controlling whole peripherals installed

namely GSM unit, GPS unit, Sensor unit and the local communication system. It is the main

unit for realization of our algorithm into hardware implementation by its programmable

facility.

Requirement of microcontroller for real time vehicle tracking system is that it should have an

architecture capable of communicating with different independent peripheral consisting of the

GPS sensor, GSM module and, Accelerometer. It must also have basic processing capability

for simple data processing purpose. The required features needed for this project

implementation can be listed below:

USART communication capability

ADC hardware

Enough permanent memory for software storage

Enough runtime memory

Enough computation power for basic processing requirements

Reliable performance

Enough I/O interfaces

Ease of Software Development

Low cost and easy availability

Low power requirement

The selection of microcontroller should be able to meet the above requirements

2.8.2. Microchip PIC16F877A Microcontroller

The PIC16F877A is one of the ideal microcontrollers for the real-time vehicle tracking system

as it meets all the above listed requirements. Features of it are listed below:

Page 36: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

36

High-Performance RISC CPU

Operating speed: 20 MHz, 200 ns instruction cycle

Operating voltage: 4.0-5.5V

Industrial temperature range (-40° to +85°C)

15 Interrupt Sources

35 single-word instructions

All single-cycle instructions except for program branches (two-cycle)

Figure 2.3: Pin configuration of PIC16F877A

Special Microcontroller Features

Flash Memory: 14.3 Kbytes (8192 words)

Data SRAM: 368 bytes

Page 37: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

37

Data EEPROM: 256 bytes

Self-reprogrammable under software control

In-Circuit Serial Programming via two pins (5V)

Watchdog Timer with on-chip RC oscillator

Programmable code protection

Power-saving Sleep mode

Selectable oscillator options

In-Circuit Debug via two pins

Peripheral Features

33 I/O pins; 5 I/O ports

Timer0: 8-bit timer/counter with 8-bit prescaler

Timer1: 16-bit timer/counter with prescaler

- Can be incremented during Sleep via external crystal/clock

Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler

Two Capture, Compare, PWM modules

- 16-bit Capture input; max resolution 12.5 ns

- 16-bit Compare; max resolution 200 ns

- 10-bit PWM

Synchronous Serial Port with two modes:

- SPI Master

- I2C Master and Slave

USART/SCI with 9-bit address detection

Parallel Slave Port (PSP)

- 8 bits wide with external RD, WR and CS controls

Brown-out detection circuitry for Brown-Out Reset

Analog Features

10-bit, 8-channel A/D Converter

Brown-Out Reset

Page 38: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

38

Analog Comparator module

- 2 analog comparators

- Programmable on-chip voltage reference module

- Programmable input multiplexing from device inputs and internal VREF

- Comparator outputs are externally accessible

Page 39: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

39

3. SYSTEM DESIGN AND OPERATION

3.1. System Block Description

The following figure shows the surface idea about the general introduction of our project and

what actually is occurring all over the different units we have used.

Figure 3.1: System Block Diagram of Project

We have termed our sensor and data processing in the vehicle as "In-Vehicle Unit" and our

data logging side as out GPS Server Unit and the part that creates a communication channel

between these two units is the mobile carrier. As explaining to our user, it can simply be

described as the In-Vehicle unit extracts the GPS data, processes data and extracts useful

information such as position, time and acclerometer output and sends it to the GPS server via

mobile carrier with GPRS technology. GPS server acts as the User Interface (UI). The UI

simply works as the Presentation Unit that has a user friendly pattern to view the location

statistics.

Page 40: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

40

3.2. Operation Flow Of The System

This project is designed to track the vehicle under theft in almost any part of the globe and

report the position of the vehicle on demand using Global Positioning System (GPS) and

Global system for mobile communication (GSM) module.

Interfacing between different hardware peripherals is done using the PIC 16F877A

microcontroller. GPS, GSM modem and are connected to the microcontroller using serial

communication technique multiplexed using the logic gates combination. The AND gate IC

7408 is used as a multiplexer. The RS232 protocol is used to communicate between the

modems and the microcontroller. MAX 232 IC is used for converting voltage levels from TTL

to RS232 levels. Accelerometer is used as a sensor to sense the unauthorized access/attempt to

access the vehicle.

When the system is powered on, it runs in non-secure mode by default. In that mode, it

continuously monitors the GSM modem for SMS from which the owner can send commands

to on/off secure mode. Once system receives the secure-mode-on command from the remote,

the microcontroller activates its internal analogue-to-digital converter to convert the analogue

voltage signals from the X Y Z channels of the accelerometer. First, it sets the static value of

the X Y Z axes, and then it continuously compares the later digitally converted values with the

static/neutral values.

While in the secure mode, when the vehicle moves (due to unauthorized access), the

accelerometer values changes due to which the outputs of the ADC crosses the threshold

values (static values ± tolerance). This condition is used by the microcontroller to detect the

vehicle theft.

Once the vehicle theft has been detected, the system first sends a SMS to the owner warning

about the theft. Microcontroller does this by sending necessary AT commands to the GSM

module. The GPS receives the data from space segments and transmits to the microcontroller

working at the baud rate 4800. The microcontroller extracts the necessary data from the strings

received from the GPS module. Then it sends necessary AT commands to the GSM modem to

Page 41: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

41

establish the GRPS connection to the web server. Once the connection is set up it sends the

coordinates data to sever through GPRS connection which can be view by the owner on online

maps. Until the system receives the deactivation SMS from the authorized person, the system

continuously extracts the necessary data from the string from GPS modem, process and

forward to the server. Once the deactivation SMS is received, it extracts the sender

information. If the sender information is valid then it deactivates the GPS and GSM modem

and sets the system back to non-secure

Page 42: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

42

Figure 3.2: Overall system flowchart.

Page 43: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

43

4. HARDWARE IMPLEMENTATION

Several hardware modules have been used in the in-vehicle unit. The hardware modules were

interfaced using standard protocols and were integrated in circuit implementation. The

description of the hardware modules used are described below.

4.1. Accelerometer

This project requires to sense movement of vehicle which can be used to determine the status

of vehicle. The vehicles movement under parked condition could be a possible signal for theft

condition. Also events of accidents can be detected by abrupt change of orientation which is

sensed by accelerometer.

When the system is powered on, it runs in non-secure mode by default. Switching between the

modes is controlled through SMS. Once system receives the secure-mode-on command, the

microcontroller activates its internal analogue-to-digital converter to convert the analogue

voltage signals from the X Y Z channels of the accelerometer. First, it sets the static value of

the X Y Z axes, and then it continuously compares the later digitally converted values with the

static/neutral values while monitoring the RF signal from the remote control along side.

While in the secure mode, when the vehicle moves (due to unauthorized access), the

accelerometer values changes due to which the outputs of the ADC crosses the threshold

values (static values ± tolerance). This condition is used by the microcontroller to detect the

vehicle theft. Once the vehicle theft has been detected, the system first sends a SMS to the

owner warning about the theft.

The MMA7260QT low cost capacitive micro-machined accelerometer features signal

conditioning, a 1-pole low pass filter, temperature compensation and g select which allows for

the selection among 4 sensitivities. Zero-g offset full scale span and filter cut-off are factory set

Page 44: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

44

and require no external devices. Includes a Sleep Mode that makes it ideal for handheld battery

powered electronics.

Figure 4.1: Interfacing accelerometer to microcontroller

The device consists of two surface micromachined capacitive sensing cells (g-cell) and a

signal conditioning ASIC contained in a single integrated circuit package. The sensing

elements are sealed hermetically at the wafer level using a bulk micromachined cap

wafer.The g-cell is a mechanical structure formed from semiconductor materials

(polysilicon) using semiconductor processes (masking and etching). It can be modeled as a

set of beams attached to a movable central mass that move between fixed beams. The

movable beams can be deflected from their rest position by subjecting the system to

acceleration. As the beams attached to the central mass move, the distance from them to the

fixed beams on one side will increase by the same amount that the distance to the fixed

beams on the other side decreases. The change in distance is a measure of acceleration. The

g-cell beams form two back-to-back capacitors. As the center beam moves with

acceleration, the distance between the beams changes and each capacitor's value will

change,

(C = €A/D).

Page 45: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

45

Where A is the area of the beam,

€ is the dielectric constant, and

D is the distance between the beams.

The ASIC uses switched capacitor techniques to measure the g-cell capacitors and extract the

acceleration data from the difference between the two capacitors. The ASIC also signal

conditions and filters (switched capacitor) the signal, providing a high level output voltage

that is radiometric and proportional to acceleration.

Figure 4.2: simplified transducer physical model

4.2. GSM Modem

Figure 4.3: SIM-300 GSM modem

Page 46: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

46

The wireless GSM module used in this project is SIMCOM’S SIM 300.It works on frequencies

EGS900MHZ, DCS1800MHZ, and PCS1 1900MHZ. It is fitted with standard interface for a

power supply, an antenna, a pc and a headset with its plug and play technology. It uses SIM

Card and can be controlled by means of AT Commands.

Features

1)Wireless data transmission

2)Data received can be displayed in LED

3)SIM application toolkit

4)The modem can be controlled and programmed by means of AT commands

5)Integrated SIM card holder

6)Wide input voltage range

4.3. GPS Receiver

Figure 4.4: GPS modem (GT-320 RW)

Page 47: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

47

The GT-320RW GPS module will continuously track all satellites in view and provide

accurate satellite positioning data. This module support acquisition sensitivity of –140dBm

and tracking sensitivity of –155dBm having limited sky view .It support both the LVTTL-

level and RS232-level serial interface. Supply voltage of 3.8V~8.0V is supported. The supply

voltage used for GPS in the project is +5v. It uses 16 parallel channels and 4100 search bins

for satellite signal acquisition and short startup time.

Pin

Number

Signal Name

Description

1 Serial Data

Out 1

Asynchronous serial output at LVTTL level, to output

NMEA message

2 Serial Data In

1

Asynchronous serial input at LVTTL level, to input

command message

3 Serial Data

Out 2

Asynchronous serial output at RS-232 level, to output NMEA

message

4 Data In 2 Asynchronous serial input at RS-232 level, to input command

message

5 Power 3.8V ~ 8.0V DC input

6 Ground Power and signal ground

Table 4.1: Pinout Description of GPS modem (GT-320 RW)

4.4. Microcontroller

Microcontroller used in In-Vehicle unit is of PIC family. PIC is Harvard architecture

microcontrollers made by microchip technology derived from the PIC1650 originally developed by

General Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral

Page 48: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

48

Interface Controller". PICs are popular with both industrial developers and hobbyists alike due to

their low cost, wide availability, large user base, extensive collection of application notes,

availability of low cost or free development tools, and serial programming (and re-programming

with flash memory) capability.

PIC16f877A is the microcontroller used in the In-Vehicle unit. The PORTA of

microcontroller is used as analog inputs. three analog input pins AN0, AN1, AN2 are used to

receive analog output of three channels of accelerometer. The RX pin of microcontroller is

used to receive SMS from GSM modem through MAX232 and GPS data from GPS receiver

using multiplexing technique. The TX pin of microcontroller is used to transmit data from

microcontroller to web server or to our mobile phone through GPS modem using GPRS link.

4.4.1. ADC

The Analog-to Digital Converter (ADC) module has eight input channels for PIC16F877A.

The conversion of an analog input signal results in a corresponding 10-bit digital number. The

ADC module has high and low voltage reference input that is software selectable to some

combination of VDD, VSS, RA2 or RA3. The ADC has a unique feature of being able to

operate while the device in sleep mode. To operate in sleep mode ADC clock must be derived

from ADC’s internal RC oscillator. The ADC module has four registers. These registers are:

•ADC Result High Register(ADRESH)

•ADC Result Low Register(ADRESL)

•ADC Result Register 0 (ADCON0)

•ADC Result Register 1 (ADCON1)

ADCON0 register controls the operation of ADC module . ADCON1 register configures the

functions of port pins. The port pins can be configured as analog inputs (RA3 can also be the

voltage reference ) or as digital I/O.

Page 49: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

49

We used 'built in' ADC for the conversion of analog value received from accelerometer into

digital value. Three channels of accelerometer gives analog value of voltage corresponding to

acceleration applied on it in three direction and these analog values are converted to digital

value for further processing by 'built in' ADC. In our project three ADC channels (AN0, AN1,

AN2) are used for converting analog value of voltage obtained from X, Y, Z direction output

of accelerometer.

4.5. USART

The Universal Synchronous Asynchronous Receiver is also known as serial communication

interface. The USART can be configured as a full duplex asynchronous system that can

communicate with peripheral devices such as personal computer or it can be configured as a

half duplex synchronous system that can communicate with peripheral devices such as ADC.

The serial communication used in this project is full duplex asynchronous system that is used

to interface GPS modem and GSM modem with microcontroller PIC16F877A.The UART

transmitter contains the Transmitter Shift Register(TSR). The TSR obtains its data from

read/write Transmit Buffer (TXREG). The TXREG is loaded with data in software. The

UART receiver contains Receiver Shift register .After sampling the stop bit, the received data

in the Receiver Shift Register (RSR) is transferred to the RCREG register.

The UART baud rate used in this project is 4800 for GPS and microcontroller interface and

9600 for GSM and microcontroller interface. We have initialized the SPBRG register for

appropriate baud rate.

Page 50: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

50

4.6. Glue Logic

Glue logic defines the interfacing between the different modules and method of obtaining the

defined logical implementation as described below.

4.6.1. Multiplexing

The technique or process of selecting many parallel inputs in a time domain and converts into

single output through single channel is called multiplexing. In electronics, a multiplexer (or

MUX) is a device that selects one of several analog or digital input signals and forwards the

selected input into a single line. A multiplexer of 2n inputs has n select lines to select one of

the desired input line input line to send to the output. Multiplexers are mainly used to increase

the amount of data that can be sent over the network within a certain amount of time and

bandwidth. A multiplexer is also called a data selector.

In our project two AND gate and one OR gate are used to build a multiplexer. In the in-

vehicle module the microcontroller need to transfer only location and status information to the

owner or to the server through GSM modem. So, there is no complexity for transmission since

a single transmitter of a microcontroller is capable of performing this action. However

microcontroller should be capable of receiving signals both from GPS (latitude, longitude)

and from owner (SMS). Hence to have this capability the signals should be multiplexed. Time

division multiplexing is implemented to select between the GPS input and received SMS from

vehicle owner for control action.

Figure 4.5: 4X1 MUX

Page 51: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

51

Figure 4.6: Combinational Logic Implementation

4.6.2. Bridging circuit

A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -3V to -

12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins of the uC

chips, thus need a converter chip. A MAX232 chip has long been using in many uC boards. It

provides 2-channel RS232C port and requires external 1uF capacitors. Carefully check the

polarity of capacitor when soldering the board. A DS275, however, no need external capacitor

and smaller. Either circuit can be used without any problems.

Figure 4.7: MAX232C Interfacing circuit diagram

Page 52: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

52

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to

signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual

driver/receiver and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V supply

via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-

232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as

power supply design does not need to be made more complicated just for driving the RS-232

in this case.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard 5 V TTL

levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may operate at

higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF

capacitors used with the original device .

4.7.1. Voltage levels

It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a

TTL level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL

Logic 1 to between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be

confusing when you realize that the RS232 Data Transmission voltages at a certain logic state

are opposite from the RS232 Control Line voltages at the same logic state. To clarify the

matter, see the table below. For more information see RS-232 Voltage Levels.

RS232 Line Type & Logic Level RS232

Voltage

TTL Voltage to/from

MAX232

Data Transmission (Rx/Tx) Logic 0 +3 V to

+15 V

0 V

Data Transmission (Rx/Tx) Logic 1 -3 V to -

15 V

5 V

Control Signals (RTS/CTS/DTR/DSR) Logic 0 -3 V to -

15 V

5 V

Page 53: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

53

Control Signals (RTS/CTS/DTR/DSR) Logic 1 +3 V to

+15 V

0 V

Table 4.2: MAX232 Voltage Conversion

4.7. Liquid crystal display (LCD)

LCD is a thin, flat electronic visual display device that uses the light modulating properties of

liquid crystals. It has been used to display current position (latitude, longitude, time, height,

number of satellite), accelerometer values in three dimension. Mainly it is used to provide

information to the owner whether the vehicle is in secure or non-secure mode. While vehicle

in secure mode “secure mode” is displayed in LCD, otherwise “non-secure mode” is displayed

in it.

The ability of LCD to display numbers, characters, and graphics and its low price and easy

availability in the market encouraged us in using it. LCD incorporates a refreshing controller

in itself and hence CPU is not required in refreshing the LCD.

Page 54: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

54

5. SOFTWARE IMPLEMENTATION

The heart of the in-vehicle unit, that is microcontroller unit has been programmed using

MPLAB IDE. And the server unit has been programmed using a very powerful web based

programming language such as HTML, PHP and JavaScript.

5.1. Microcontroller Programming

MPLAB IDE is a software program that runs on a PC .It helps to develop applications for

Microchip microcontrollers. It is called an Integrated Development Environment, or IDE,

because it provides a single integrated “environment” to develop code for embedded

microcontroller.

The tasks needed for developing a controller application are:

Decide which PIC MCU device is best suited to the application, select the compiler. In

this project we have used MPLAB_8_33 and HITECH_PICC_9.7.

Write the code, compile, assemble and link the software using assembler or compiler

and linker to convert your code into machine code.

’’ Burn ’’ the code into a microcontroller.

Figure 5.1: Microcontroller Software Design Cycle

Page 55: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

55

In this project the MBLAB IDE is used for hardware programming such as accelerometer

digital display, GPS interfacing and position display, GSM interfacing and for SMS sending

during theft condition and sending position of vehicle in the server.

5.2. Server Implementations

The Micro-controller with the help of the GSM modem connects to the remote server to

upload the GPS data. We have used the PHP script to collect the data received which includes

the position information (latitude, longitude) of the vehicle along with the device id. PHP

script is embedded in HTML. JavaScript is used to access the Google map using Google map

API to visualize the data in map.

5.2.1. Domain Name Registration and Hosting

Website www.co.cc allows to register the domain name at free of cost. The domain name

www.realtimetrack.co.cc is registered. Hosting of website is provided by

www.000webhost.com . Www.000webhost.com provides the free hosting services and allows

us to create and manage required databases. It provides 1500MB disk space with data transfer

of 100GB/month. It provides five adds-on domain with five sub-domains, two e-mail

addresses and two MySQL databases providing 99% uptime. PHP with MySQL database is

supported by the host. All these features are provided for free hosting service as used by our

system.

5.2.2. HTML

HyperText Markup Language (HTML) is the main markup language for displaying web pages

and other information that can be displayed in a web browser. HTML is written in the form of

HTML elements consisting of tags enclosed in angle brackets (like <html>), within the web

page content. HTML tags most commonly come in pairs like <h1> and </h1>, although some

Page 56: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

56

tags, known as empty elements, are unpaired, for example <img>. The first tag in a pair is the

start tag, the second tag is the end tag (they are also called opening tags and closing tags). In

between these tags web designers can add text, tags, comments and other types of text-based

content. The purpose of a web browser is to read HTML documents and compose them into

visible or audible web pages. The browser does not display the HTML tags, but uses the tags

to interpret the content of the page.

Web browsers can also refer to Cascading Style Sheets (CSS) to define the appearance and

layout of text and other material. The W3C, maintainer of both the HTML and the CSS

standards, encourages the use of CSS over explicit presentational HTML markup.

5.2.2.1. Elements

HTML elements form the building blocks of all websites. HTML allows images and objects to

be embedded and can be used to create interactive forms. It provides a means to create

structured documents by denoting structural semantics for text such as headings, paragraphs,

lists, links, quotes and other items. It can embed scripts in languages such as JavaScript which

affect the behavior of HTML web pages

5.2.2.2. Attributes

HTML attributes are modifiers of HTML elements. They generally appear as name-value

pairs, separated by "=", and are written within the start tag of an element, after the element's

name:

<tag attribute="value">(content to be modified by the tag)</tag>

Where tag names the HTML element, attribute is the name of the attribute, set to the provided

value.

Attribute Value Description

class classname Specifies a classname for an element

id id Specifies a unique id for an element

style style_definition Specifies an inline style for an element

Page 57: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

57

title tooltip_text Specifies extra information about an element

(displayed as a tool tip)

Table 5.1: HTML attribute table.

5.2.3. PHP script

PHP is a general-purpose server-side scripting language originally designed for Web

development to produce dynamic Web pages. It is one of the first developed server-side

scripting languages to be embedded into an HTML source document rather than calling an

external file to process data. The code is interpreted by a Web server with a PHP processor

module which generates the resulting Web page.

PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP

runtime, usually to create dynamic web page content or dynamic images used on Web sites or

elsewhere. It can also be used for command-line scripting and client-side graphical user

interface (GUI) applications. PHP can be deployed on most Web servers, many operating

systems and platforms, and can be used with many relational database management systems

(RDBMS). It is available free of charge, and the PHP Group provides the complete source

code for users to build, customize and extend for their own use. PHP only parses code within

its delimiters, such as <? php ?>.Anything outside its delimiters is sent directly to the output

and not parsed by PHP. Variables are prefixed with a dollar symbol and a type does not need

to be specified in advance.

The predefined $_GET variable is used to collect data sent with GET method. Information

sent from a form with the GET method is displayed in the browser's address bar. Data sent

from modem is received in the page process.php. The typical URL sent to the server looks

like:

Page 58: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

58

http://www.realtimetrack.co.cc/process.php?lat=27.5776&&lng=85.6783&&dev=101

The "process.php" file can now use the $_GET variable to collect and stores the received data

to database.

$lat = $_GET['lat'];

$lng = $_GET['lng'];

$device_id = $_GET['dev'];

5.2.4. Database Design

Database is designed to store all received vehicle information, user information and the

location information. Information to be stored in the database is

Information about users of the system.

Information about vehicles.

Information about received from vehicles.

This database is accessible from internet to authorized users through a web interface.

5.2.4.1. MySQL Database

MySQL is the world's most used open source relational database management system

(RDBMS). The MySQL development project has made its source code available under the

terms of the GNU General Public License, as well as under a variety of proprietary

agreements. MySQL was owned and sponsored by a single for-profit firm, the Swedish

company MySQL AB, now owned by Oracle Corporation.

MySQL is a popular choice of database for use in web applications, and is a central

component of the widely used LAMP open source web application software stack—LAMP is

an acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source

projects that require a full-featured database management system often use MySQL. The

Page 59: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

59

MySQL database has become the world's most popular open source database because of its

high performance, high reliability and ease of use.

PHP and MySQL combine to be an easy yet powerful way to create dynamic web pages that

actually interact with visitors. HTML can create useful and well formatted web pages. With

the addition of PHP and MySQL we can collect data from your users, create specific content

on the fly, and do many other things that HTML alone can't do. Using PHP scripting and

MySQL database enables programmers to create applications that will run on just about any

computer, regardless of operating system.

5.2.5. JavaScript

JavaScript is a programming language used to make web pages interactive. It runs on visitor's

computer and doesn't require constant downloads from website. It is programming code that

can be inserted into HTML pages to be executed by web browser. The official name of the

JavaScript standard is ECMA-262.

5.2.6. Google Maps

Google Maps (formerly Google Local) is a web mapping service application and technology

provided by Google, that powers many map-based services like Google Maps website and

maps embedded on third-party websites via the Google Maps API. Google Maps uses

JavaScript extensively. As the user drags the map, the grid squares are downloaded from the

server and inserted into the page. When a user searches for a place, the results are downloaded

in the background for insertion into the side panel and map; the page is not reloaded.

Locations are drawn dynamically by positioning a red pin (composed of several partially

transparent PNGs) on top of the map images. A hidden IFrame with form submission is used

because it preserves browser history. The site also uses JSON for data transfer rather than

XML, for performance reasons.

Page 60: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

60

5.2.6.1. Google Maps API

Google Maps API allows us to integrate Google Maps into our websites. It is a free service.

By using the Google Maps API, it is possible to embed Google Maps site into an external

website, on to which site specific data can be overlaid.

Loading the Google Maps API

<html>

<head>

<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>

The URL contained in the script tag is the location of a JavaScript file that loads all of the

symbols and definitions we need for using the Google Maps API. This script tag is required.

The Map Object

var map = new google.maps.Map(document.getElementById("map_canvas"),

mapOptions);

The JavaScript class that represents a map is the Map class. Objects of this class define a

single map on a page. We create a new instance of this class using the JavaScript new

operator. When we create a new map instance, we specify a <div> HTML element in the page

as a container for the map. HTML nodes are children of the JavaScript document object, and

we obtain a reference to this element via the document.getElementById() method.

This code defines a variable (named map) and assigns that variable to a new Map object, also

passing in options defined within the mapOptions object literal. These options will be used to

initialize the map's properties. The function Map() is known as a constructor.

Map(mapDiv:Node, opts?:MapOptions)

Page 61: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

61

Creates a new map inside of the given HTML container , which is typically a DIV element

using any (optional) parameters that are passed.

Latitudes and Longitude

Because we want to center the map on a specific point, we create a LatLng object to hold this

location by passing the location's coordinates in the order { latitude, longitude }:

center = new google.maps.LatLng(-34.397, 150.644)

Loading the Map

<body onload="initialize()">

While an HTML page renders, the document object model (DOM) is built out, and any

external images and scripts are received and incorporated into the document object. To ensure

that our map is placed on the page after the page has fully loaded, we only execute the

function which constructs the Map object once the <body> element of the HTML page

receives an onload event. Doing so avoids unpredictable behavior and gives us more control

on how and when the map draws.

Polylines

The Polyline class defines a linear overlay of connected line segments on the map. A Polyline

object consists of an array of LatLng locations, and creates a series of line segments that

connect those locations in an ordered sequence. The Polyline constructor takes a set of

Polyline options specifying the LatLng coordinates of the line and a set of styles to adjust the

polyline's visual behavior. Polylines are drawn as a series of straight segments on the map. We

can specify custom colors, weights, and opacities for the stroke of the line within a Polyline

options object used when constructing line, or change those properties after construction.

Page 62: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

62

6. Software Tools

Several software tools were used in order to accompany the development of tour project.

Software tools were used for hardware programming and server programming which are

briefly described below.

6.1. MPLAB IDE

MPLAB Integrated Development Environment (IDE) is a toolset for the development of

embedded applications employing Microchip's PIC and dsPIC microcontrollers. MPLAB

IDE serves as a single, unified graphical user interface for additional Microchip and third-

party software and hardware development tools.

6.2. Proteus VSM

Proteus Virtual System Modeling (VSM) is a graphical environment for circuit simulation,

animated components and microprocessor models to facilitate co-simulation of complete

microcontroller based designs. It enables us to develop and test such designs before a

physical prototype is constructed.

6.3. PCB Wizard

PCB wizard is a innovative package for designing single sided and double sided printed circuit

boards (PBCs). It provides a comprehensive range of tools covering all traditional steps in

PCB production including, schematic drawing, schematic capture component placement and

automatic routing. To design a circuit the component is simply dragged and dropped from the

list of components and connected together using intelligent wiring system.

Page 63: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

63

The server side code is built and edited in Netbeans and Dreamweaver. We have used Apache

web server for testing of our webpage in localhost. For Apache web server, PHP and MySQL

we have installed XAMPP.

6.4. XAMPP

XAMPP is a free and open source cross-platform web server solution stack package,

consisting mainly of the Apache HTTP Server, MySQL database, and interpreters for scripts

written in the PHP and Perl programming languages.

XAMPP's name is an acronym for:

X (to be read as "cross", meaning cross-platform)

Apache HTTP Server

MySQL

PHP

Perl

The program is released under the terms of the GNU General Public License and acts as a free

web server capable of serving dynamic pages. XAMPP is available for Microsoft Windows,

Linux, Solaris, and Mac OS X, and is mainly used for web development projects.

6.4.1. Use

Officially, XAMPP's designers intended it for use only as a development tool, to allow

website designers and programmers to test their work on their own computers without any

access to the Internet. To make this as easy as possible, many important security features are

disabled by default. In practice, however, XAMPP is sometimes used to actually serve web

pages on the World Wide Web. A special tool is provided to password-protect the most

important parts of the package. XAMPP also provides support for creating and manipulating

databases in MySQL and SQLite among others. Once XAMPP is installed we can treat your

Page 64: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

64

localhost like a remote host by connecting using an FTP client. Using a program like FileZilla

has many advantages when installing a content management system (CMS) like Joomla. We

can also connect to localhost via FTP with HTML editor.

The default FTP user "newuser", the default FTP password is "wampp". The default MySQL

user is "root" while there is no default MySQL password.

6.5. Adobe Dreamweaver

Adobe Dreamweaver is an industry standard website authoring program created by

Macromedia and now developed by Adobe Systems. It enables users to create fully- functional

websites using both programming code and design view where the user is able to see the

layout of the page.

Page 65: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

65

7. APPLICATIONS

The vehicle tracking and security system has wide spread application. The system can be implemented

for vehicle security. When vehicle is theft, it informs the owner and helps to recover the vehicle. Since

the complete journey of a vehicle can be tracked on Google map, this can also be implemented in

monitoring of adolescent drivers by their parents.

Other scenarios in which this technology can be employed include:

Stolen vehicle recovery: Both consumer and commercial vehicles can be outfitted with

GPS units to allow police to do tracking and recovery.

Fleet management: When managing a fleet of vehicles, knowing the real-time location

of all drivers allows management to meet customer needs more efficiently.

Asset tracking: Companies needing to track valuable assets for insurance or other

monitoring purposes can now plot the real-time asset location on a map and closely

monitor movement and operating status.

Field sales: Mobile sales professionals can access real-time locations. For example, in

unfamiliar areas, they can locate themselves as well as customers and prospects, get

driving directions and add nearby last-minute appointments to itineraries. Benefits

include increased productivity, reduced driving time and increased time spent with

customers and prospects.

.

Page 66: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

66

8. RESULTS

Hardship of several months yielded satisfactory results in this project that are enlisted below:

The GPS data was extracted from GPS receiver module and displayed in LCD.

SMS was sent to owner's mobile alerting him of theft condition when the

accelerometer output exceeded certain threshold.

Switching between secure and non-secure modes is achieved by giving the SMS

command through owner's mobile.

A server database was developed to logging the vehicle position.

Google API was embedded in the website to locate the vehicle position in the map

Page 67: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

67

9. PROBLEMS ENCOUNTERED

We have faced many problems and glitches during the course of our project development.

Some of the problems were solved immediately, while others used a lot of our time. These

major problems are listed below.

The first problem we faced was collecting the equipments required for the project. The

GSM modem SIM900 was not easily available. So we had to use SIM300.

We faced great difficulty in establishing GPRS connection to web server through

SIM300 GSM modem.

Also there was problem during the PCB design as the modules and the printed circuit

showed error during implementation.

Page 68: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

68

10. FUTURE ENHANCEMENTS

This project is a cost effective solution to vehicle security problems. The final Output obtained

fulfills the objectives set. But still there is room for lots more enhancements and additional

facilities. Some of these enhancements are listed below.

Present system is a single user system which can be extended to multiple user login

system to track a number of vehicle at a time. For this each device must send their

vehicle id along with their location information.

Well managed database can be built to keep track of past vehicle positions as well.

Using the 3G instead of GPRS and simple camera equipment the video feed of

vehicles can also be obtained in the server side which serves a higher level of security.

With a little modification in the programming, the system can be upgraded to detect

accident.

Page 69: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

69

11. CONCLUSION

During the course of our project development we made ourselves familiar with different

existing technologies such as the GPS and the GPRS. We combined these technologies along

with micro-controller and an accelerometer to achieve the complete vehicle tracking and

security system. We hope that this system addresses the vehicle security issues and helps to

pinpoint the vehicle's location anywhere in the globe. Visualization of position of vehicle is

achieved through Google map API.

While this undertaking has equipped us with lots of practical knowledge and interpersonal

skills we hope that it will also be useful in our life.

Page 70: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

70

13. REFERENCE

1. Theodore S. Rappaport,”Wireless Communications: Principles and Practice”,

Second Edition, Prentice Hall India, 2008,

2. The Book on PIC “Microcontroller Programming”

-Julio sanchez and Maria P. Canton

CRC Press

Taylor and Francis Group ,

6000 Broken Sound Parkway NW, Suite 300

Boca Raton, FL 33487-2742

3. www.w3schools.com/php

4. http://www.wrox.com/WileyCDA/WroxTitle/Beginning-PHP5-Apache-and-MySQL-

Web-Development.productCd-0764579665,descCd-DOWNLOAD.html

5. https://developers.google.com/maps/documentation/javascript/tutorial

6. http://en.wikipedia.org/wiki/Vehicle_tracking_system

7. http://www.wvshare.com/datasheet/Microchip_PDF/PIC16F877A.PDF

8. http://www.alldatasheet.com/datasheet-

pdf/pdf/165829/FREESCALE/MMA7260QT.html

9. http://www.amazon.co.uk/Interfacing-PIC-Microcontrollers-Interactive-

ebook/dp/B000PY3EBS#reader_0750680288

10. http://en.wikipedia.org/wiki/NMEA_0183

Page 71: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

71

12. APPENDIX

12.1. Hardware Implementation And Simulation

Figure 12.1: Simplified accelerometer function block diagram

Figure 12. 2: Pin description of MMA7260QT accelerometer chip

Page 72: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

72

Figure 12.3: Circuit implementation of accelerometer

Page 73: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

73

Figure 12. 4: Block diagram of PIC16F877A

Page 74: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

74

Figure 12.5: Circuit diagram of vehicle tracking and security system using GPS and GSM

Page 75: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

75

Figure 12.6: Real world design of PCB used in the project .

Figure 12.7: Layout of PCB used in our project

Page 76: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

76

Figure 12.8: Simulation circuit of GPS receiver from virtual hyperterminal using proteus

Page 77: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

77

Figure 12.9: Simulation circuit of accelerometer from potentiometer using Proteus.

Page 78: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

78

Figure 12.10: Simulation of GSM modem from virtual terminal for sending SMS during theft

condition using Proteus

Page 79: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

79

12.2. Snapshots Of Server Implementation

Figure 12.11: Screenshot of Google map showing the path of vehicle for manual entry of

location information.

Page 80: 1. INTRODUCTION · security with optimum levels. Vehicle tracking and security uses different advanced technology for data acquisition, data filtering, data logging, and data telemetry

80

Figure 12.12: Database storing the location information of vehicle