Professional Documents
Culture Documents
INTRODUCTION
1.1 TRACKING
Tracking of vehicle is becoming a need of the hour for every logistics companies
around the world for their fleet management. Goods transported through the road needs to
be continuously monitored for their position and informed about the status of the delivery
of those goods to the customers. Vehicle tracking is also used to help navigation of
drivers in an unknown city by indicating their position in a map along with the place they
want to go with the roads and current traffic information on these roads with the help of
satellites.
The concept of tracking also plays a vital part in determining the position of the
theft vehicles and also in tracking of kidnapped children who get lost. In these cases the
location of the stolen vehicle or the kidnapped child is determined and alerted the concern
person.
The key components of this project are GPS module, GSM modem and
ATmega324p microcontroller. GPS commonly abbreviated as Global positioning system
plays a vital in tracking by providing the location information by retrieving it from a
group of GPS satellites. GSM which is abbreviated as Global System Mobile is a mobile
standard in this modern era of cellular revolution. The GSM module solves the problem
of establishing communication between the tracker and one who is tracked. The
microcontroller here controls both the GPS and the GSM units.
1
CHAPTER – 2
GLOBAL POSITIONING SYSTEM
Each GPS satellite has an atomic clock, and continually transmits messages
containing the current time at the start of the message, parameters to calculate the
location of the satellite (the ephemeris), and the general system health (the almanac). The
signals travel at the speed of light through outer space, and slightly slower through the
atmosphere. The receiver uses the arrival time to compute the distance to each satellite,
from which it determines the position of the receiver using geometry and trigonometry.
Although four satellites are required for normal operation, fewer may be needed
in some special cases. If one variable is already known (for example, a sea-going ship
2
knows its altitude is 0), a receiver can determine its position using only three satellites.
Also, in practice, receivers use additional clues (Doppler shift of satellite signals, last
known position, dead reckoning, inertial navigation, and so on) to give degraded answers
when fewer than four satellites are visible.
3
The GPS navigation message includes the difference between GPS time and UTC.
Receivers subtract this offset from GPS time to calculate UTC and specific time zone
values. New GPS units may not show the correct UTC time until after receiving the UTC
offset message. The GPS-UTC offset field can accommodate 255 leap seconds (eight
bits) which, at the current rate of change of the Earth's rotation, is sufficient to last until
the year 2330.
The week number is transmitted as a ten-bit field in the C/A and P(Y) navigation
messages, and so it becomes zero again every 1,024 weeks (19.6 years). GPS week zero
started at 00:00:00 UTC (00:00:19 TAI) on January 6, 1980 and the week number
became zero again for the first time at 23:59:47 UTC on August 21, 1999 (00:00:19 TAI
on August 22, 1999). To determine the current Gregorian date, a GPS receiver must be
provided with the approximate date (to within 3,584 days) to correctly translate the GPS
date signal. To address this concern the modernized GPS navigation messages use a 13-
bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero
until near the year 2137.
COMMAND DESCRIPTION
$PNMRX103 This message is being sent to enable or to disable the output of an NMEA
message and to determine its output rate
$GPGLL This message transfers Geographic position, Latitude, Longitude, and time.
Table 2.1.:- GPS Commands
4
CHAPTER – 3
GLOBAL SYSTEM FOR MOBILE COMMUNICATION
In the 900 MHz band the uplink frequency band is 890–915 MHz, and the
downlink frequency band is 935–960 MHz this 25 MHz bandwidth is subdivided into
124 carrier frequency channels, each spaced 200 kHz apart. Time division multiplexing is
used to allow eight full-rate or sixteen half-rate speech channels per radio frequency
channel. There are eight radio timeslots (giving eight burst periods) grouped into what is
called a TDMA frame. Half rate channels use alternate frames in the same timeslot. The
channel data rate is 270.833 Kbit/s, and the frame duration is 4.615 ms.
5
frequency modulator, which greatly reduces the interference to neighboring channels
(adjacent channel interference).
6
3.5. GSM COMMANDS USED
COMMANDS DESCRIPTION
AT Initializing SIM Card
AT+CSDT Switch ON or OFF detecting SIM Card
AT+CMGF Select SMS Message format
AT+CSCS Selecting the Terminal Equipment character set
ATE Set command Echo mode
ATD Originate call to phone number in memory
ATA Answer incoming call
AT+CSQ Signal Quality Report
AT+CPOWD Normal Power off
AT+CMGS Send SMS Message
AT+CMGR Read SMS Message
AT+CMGD Delete SMS Message
AT+CMGL List SMS Messages from preferred store
Table 3.2:- GSM command list
7
CHAPTER – 4
SHORT MESSAGE SERVICE
Transmission of short messages between the SMSC and the handset is done using
the Mobile Application Part (MAP) of the SS7 protocol. Messages are sent with the MAP
mo- and mt – Forward SMS operations, whose payload length is limited by the
constraints of the signaling protocol to precisely 140 octets (140 octets = 140 * 8 bits =
1120 bits). Short messages can be encoded using a variety of alphabets: the default GSM
7-bit alphabet, the 8-bit data alphabet, and the 16-bit UTF-16/UCS-2 alphabet.
Depending on which alphabet the subscriber has configured in the handset, this leads to
the maximum individual Short Message sizes of 160 7-bit characters, 140 8-bit
characters, or 70 16-bit characters.
8
CHAPTER – 5
SYSTEM OVERVIEW
On the master – the tracker side, a GSM SIM 300 modem is interfaced directly
with the personal computer (PC) through the computer’s serial port. A utility is designed
to run on the PC, about which we will take later in this report. The utility is designed to
read data from the computer’s serial port which naturally being the positional values sent
as a text message through the GSM network. Then this data is extracted and used to plot
the latitude and longitude values on a geographical map of the area. The utility is
designed to control the GSM modem on the master’s side. The utility monitors the status
of the SIM in the modem and issues proper commands to extract the message which
contains the positional data.
9
its call to the first node and makes the call to the next node. In this manner, the master
issues the request to the nodes and gets the location information from each of the nodes.
The master receives the data from the nodes and identifies the node from which it
received this data. The node sends the data to the master only if there is a change in its
position. In such a situation, the latitude and longitude values of the node’s position will
change. If the node is not moving, the node does not send the data to the master. In such a
situation, the master displays the previous location of the vehicle since the node is not
moving. In this manner, the master periodically issues the request to all the nodes and
gets the data from them.
Now, having understood how the master gets the data from the nodes, let us see
the tool used by the master to do its work. We have developed a visual basic utility
program that will run on the PC in the master side giving the AT commands to the GSM
Modem to call the nodes and get the data from them. Now, let us see the description of
the utility program in detail.
10
The above block diagram shows the idea of implementation at the node. The
system is as simple as it appears in the diagram. The GPS module CP3838 collects the
information about the position values of the place where it is present. The GSM modem
SIM 300 is used to send the position values collected by the CP3838 to the master node –
The Tracked. . Generally, the GPS receiver generates the seven different formats of data,
such as $GPGGA, $GPGLL, $GPGSA, $GPGSV, $GPRMC, $GPVTG and $GPZDA.
NMEA standard messages commence with ‘GP’, then a 3-letter message identifier.
NemeriX specific messages commence with $PNMRX followed by a 3 digit number.
Now, let us see the interface between GPS receiver and microcontroller.
Generally GPS receiver needs 60 seconds for its cold start. So initially microcontroller
generates about 60 seconds delay before reception of GPS data. After the execution of
delay, microcontroller sends the filtering command $PNMRX103, GLL, 2*xx in hex
format as 24 50 4E 4D 52 58 31 30 33 2C 47 4C 4C 2C 32 2A 1E 0D 0A through its
transmission line. This command sets the GPS receiver for sending only $GPGLL data
format in every 2 seconds. Whenever getting the request from master, the received data
from GPS receiver is stored in microcontroller. Generally GPS receiver sends the data
simultaneously. Microcontroller checks three conditions for storing the valid data, 1)the
request received from master, 2)the received data from GPS receiver has originated with
11
‘$’ sign, 3)the received data status is valid. If these three conditions are satisfied, then the
data had been stored in microcontroller. Then stored data had sent to master as SMS
through GSM engine.
Then the microcontroller commands the GSM modem to send this data as a text
message in other terms this position data is sent to other GSM modem on the master side
as a SMS message. The GSM modem is interfaced to the microcontroller through UART
1. This controller, the ATmega324p has inbuilt 2 UART which facilitates the interfacing
of both the GPS and GSM units at the same time and establish a full fledged two way
communication between the GPS and GSM units. The GSM modem uses the AT
commands to send the filtered position data to the GSM modem at the master side.
Now, let us see about the interface between microcontroller and GSM modem.
First we initialize the GSM modem. Microcontroller had sent the three initialization
commands to the GSM modem. 1) “AT+CSDT=1” for auto detection of SIM card, 2)
“AT+CMGF=1” for selecting the message format in text mode, 3) “AT+CSCS= “GSM”
for select the GSM character set in the Terminal Equipment (TE). Whenever getting the
call from master, the microcontroller counts the number of rings received from GSM
modem at the master. After 10 rings, the microcontroller cancels the incoming call by
setting the command “ATH”. If master confirm the node is live, then again made a call to
node. Then microcontroller had sends the stored position data as a SMS to the master
using the command “AT+CMGS= “destination GSM number”,129”\n message (data) and
then control-Z. This is repeated whenever node is requested by master.
12
CHAPTER – 6
FLOW CHART
6.1. FLOW CHART OF MASTER
START
If master
Get the
side
previous
response is
position data If master side
“BUSY”
response is
“NO
CARRIER”
Receives the position data from requested
node as SMS
END
13
6.2. FLOW CHART OF NODE
START
If no. of
rings from Wait for further incoming call
master=10
The node cuts the incoming call to indicate the master that it is live
If GPS
data valid
µC sends the position data to the master through the GSM modem as SMS
END
14
CHAPTER – 7
UTILITY
7.1. INTRODUCTION
Visual Basic is an ideal, event driven programming language for developing
sophisticated professional applications for Microsoft Windows. It makes use of Graphical
User Interface for creating robust and powerful applications. In a GUI environment, the
number of options open to the user is much greater, allowing more freedom to the user
and developer.
7.2. DESCRIPTION:
GPS receiver receives data once in every 5 seconds when the vehicle moves. This
received data is transmitted to the GSM modem at the application end by GSM modem at
vehicle end and this transmission takes more than 20 seconds to reach the application end
due to delay in the network. So each received GPS data consumes at least 40 seconds by
the time it gets stored in the database. So to make the tracking appear lively the
application must be triggered to map the received data once in every 40 seconds. This
mapping procedure is placed under this timer sub routine and the Interval property of the
timer control is set to 40 seconds. So every 40 seconds timer triggers the application to
map the received data to show the position of the vehicle.
15
stores attributes for each primitive shape in the shape file. Shape file is actually a set of
several files of which the following three files are mandatory to store core data, they are:
There are further eight optional files which store primarily index data to improve
performance. The following are the steps to convert a scanned Madurai topological map
to shape file:
7.4. DATABASE:
A database is a tool for collecting and organizing information and helps in easy
access to information stored. The Latitude and longitude values of vehicle’s position
collected are stored in database. Time and date values of data received are also stored in
database. This application uses Microsoft Access, because it is a computerized relational
database management system which stores its tables in a single file and it is also easy to
add new data to a database, edit existing data in the database, delete information,
organize and view data in different ways.
16
Database Object:
Vehicle tracking application first opens the database where tables containing
latitude and longitude values are stored. A variable is declared to hold a reference to the
database.
Adding records:
Latitude and Longitude values collected at various time and date are added to the
database table using AddNew method. Records can also be deleted, updated.
17
CHAPTER – 8
COMPONENTS OF TRACKING
8.1. GPS-CP3838
CPIT GPS module CP3838 is a high sensitivity ULTRA LOW power
consumption cost efficient, compact size; plug & play GPS module board designed for a
broad spectrum of OEM applications. The GPS module receiver will track up to 16
satellites at a time while providing fast time-to-first-fix and 1Hz navigation updates. Its
superior capability meets the sensitivity & accuracy requirements of car navigation as
well as other location-based applications, such as AVL system. Handheld navigator,
PDA, pocket PC, or any battery operated navigation system.
The CP3838 design utilizes the latest surface mount technology and high level
circuit integration to achieve superior performance while minimizing dimension and
power consumption. The module communicates with application system via RS232 (TTL
level) with NMEA0183 protocol.
18
8.3. PIN DIAGRAM AND DESCRIPTION
(i) Pin Diagram
19
8.4. SIM 300
Designed for global market, SIM 300 is a Quad-band GSM/GPRS engine that works
on frequencies GSM 850 MHz, GSM 900 MHz, DCS 1800 MHz and PCS1900 MHz.
SIM 300 provides GPRS multi-slot class 10 capability and supports the GPRS coding
schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of 39.5mm x 32.5mm x 3
mm, SIM 300 can fit almost all the space requirement in your application, such as Smart
phone, PDA phone and other mobile device. The physical interface to the mobile
application is made through a 60 pins board-to-board connector, which provides all
hardware interfaces between the module and customers’ boards except the RF antenna
interface.
• 8 out of 60 pins are programmable as General Purpose I/O (2 pins just defined as
Output). This gives you the flexibility to develop customized applications.
• Two serial ports can help you easily develop your applications.
• Two audio channels include two microphones inputs and two speaker outputs.
This can be easily configured by AT command.
With the charge circuit integrated inside the SIM 300, it is very suitable for the battery
power application.
SIM 300 provide RF antenna interface with two alternatives: antenna connector
and antenna pad. The antenna connector is MURATA MM9329-2700. And customer’s
antenna can be soldered to the antenna pad. The SIM 300 is designed with power saving
technique, the current consumption to as low as 4Ma in SLEEP mode. The SIM 300 is
integrated with the TCP/IP protocol Extended TCP/IP AT commands are developed for
customers to use the TCP/IP protocol easily, which is very useful for those data transfer
applications.
20
8.5. FEATURES OF SIM 300
Feature Implementation
Power supply Single supply voltage 3.4V – 4.5V
Power saving Typical power consumption in SLEEP mode to 3mA
Charging Supports charging control for Li-Ion battery
• SIM200 Quad-band: GSM 850, GSM 900, DCS 1800,
Frequency bands PCS 1900
• Compliant to GSM Phase 2/2+
GSM class Small MS
• Class 4 (2W) at EGSM900 and GSM850
Transmit power
• Class 1 (1W) at DCS1800 and PCS 1900
• Normal operation: -20°C to +55°C
Temperature range • Restricted operation: -25°C to -20°C and +55°C to +70°C
• Storage temperature -40°C to +80°C
• MT, MO, CB, Text and PDU mode
• SMS storage: SIM card
SMS
• Support transmission of SMS alternatively over CSD or
GPRS.
External antenna Connected via 50 Ohm antenna connector or antenna pad
• Serial Port 1 Seven lines on Serial Port Interface
• Serial Port 1 can be used for CSD FAX, GPRS service
and send AT command of controlling module.
• Serial Port 1 can use multiplexing function, but you can
Two serial interfaces
not use the Serial Port 2 at the same time;
• Serial port 2 Two lines on Serial Port Interface /TXD and
/RXD
• Serial Port 2 only used for transmitting AT command.
Table 8.2.:- Features Of SIM 300 GSM Modem.
21
8.6. ATMEGA 324p – 8 BIT MICROCONTROLLERS
The AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in
one clock cycle. The Atmega324p has 32K bytes of In-System Programmable Flash, 1K
EEPROM, 2K SRAM, three Timer/Counters with compare modes, 2 USARTs, a byte
oriented 2-wire Serial Interface, a 8-channel, 10-bit ADC with optional differential input
stage with programmable gain, IEEE std. 1149.1 compliant JTAG test interface with
boundary scan capabilities.
The Power-down mode saves the register contents but freezes the Oscillator,
disabling all other chip functions until the next interrupt or Hardware Reset. In Power-
save mode, the asynchronous timer continues to run, allowing the user to maintain a timer
base while the rest of the device is sleeping. In Standby mode, the Crystal/Resonator
Oscillator is running while the rest of the device is sleeping. This allows very fast start-up
combined with low power consumption.
23
8.9. Max 232
8.9.1. Pin diagram
24
CHAPTER – 9
FUTURE WORKS
25
CHAPTER – 10
CONCLUSION
10.1. CONCLUSION
Thus by this project we can track any kind of vehicle which moves on the road by
using the kits. The tracked vehicle can be monitored from anywhere in this world through
a computer terminal. The information of the tracked vehicle is shown in the computer
terminal in a graphical manner in such a way that it would be easy for the user to
intercept the data about the tracked vehicle.
We hereby believe that this project will be useful to the society as a tool to
provide safety to the public by monitoring the suspicious vehicles on the road and put an
end to the act of theft seen in the common day life.
26
11. References
• www.avrfreaks.net
• www.atmel.com
• www.cpit.com
• www.edaboard.com
• www.maps.google.com
• www.alldatasheet.com
• www.embeddeddeveloper.com
• www.gpsinformation.org
27
12. SCREENSHOTS AND SCHEMATICS
12.1. Screenshot
28
12.2. System Diagram
29