You are on page 1of 87

THEFT ALERTING AND NOTIFICATION SYSTEM USING GPS AND

GSM

CHAPTER 1
INTRODUCTION
In

the

world

of

advanced

electronics ,

every

product

should

be

secured

to make the life of human beings simpler. Hence to make the life of human beings simpler
and convenient, we have made THEFT ALERTING AND NOTIFICATION SYSTEM
USING GSM AND GPS .
This

security system

which is used in vehicles helps

millians of

people to keep their

vehicles secured.This model uses GPS and GSM modems with microcontroller to intimate
the status of GSM and to find out the exact location of the vehicle after the vehicle is theft.
This project consists of microcontroller, GPS modem, GSM and Security switch.Security
switch connected to microcontroller with positive logic. This project fixed inside the vehicle.
Press security switch after parking the vehicle. Then microcontroller locks the coordinates
(latitude, longitude and altitude) of that particular place. If anybody move the vehicle from
that place microcontroller can detect and sends SMS to the user or vehicle owner. After
moving vehicle from fixed coordinates microcontroller sends coordinates to user
continuously. With the help of this project we can easily find out the vehicle position
through coordinates.

1.1 INTRODUCTION TO EMBEDDED SYSTEMS:


An embedded
specific

system

can

be defined

as a computing device that does

focused job. Appliances such as the air-conditioner, VCD player, DVD player,

printer, fax machine, mobile phone etc. are examples of embedded systems. Each of these
appliances will have a processor and special hardware to meet the specific requirement
of the

application along with the embedded software that is executed by the processor

for meeting that specific requirement.


DRK INSTITUTE OF SCIENCE AND
TECHNOLOGY

Overview of Embedded System Architecture


Every embedded system consists of custom-built hardware built around a Central
Processing Unit (CPU). This hardware also contains memory chips onto which the
software is loaded. The software residing on the memory chip is also called the
firmware. The embedded system architecture can be represented as a layered
architecture as shown in below Fig.

Fig 1.1:Architecture of an embedded system

The operating system runs above the hardware, and the application software runs
above the operating system. The same architecture is applicable to any computer
including a desktop computer. However, there are significant differences. It is not
compulsory to have an operating system in every embedded system. For small
appliances such as remote control units, air conditioners, toys etc., there is no need for
an operating system and you can write only the software specific to that application.
For applications involving complex processing, it is advisable to have an operating
system.

In

software

with

such

case,

you

need

to

integrate

the

application

the operating system and then transfer the entire software on to the

memory chip. Once the software is transferred to the memory chip, the software will
continue to run for a long time you dont need to reload new software.

Memory:
The memory
Read Only

is

categorized

as

Random Access

11emory

(RAM)

and

Memory (ROM). The contents of the RAM will be erased if power is switched off to
the chip, whereas ROM retains the contents even if the power is switched off. So, the
firmware is stored in the ROM. When power is switched on, the processor reads the
ROM; the program is program is executed.
Input devices:
Unlike the desktops, the input devices to an embedded system have very limited
capability. There will be no keyboard or a mouse, and hence interacting with the
embedded
have

system

is

no

easy

task.

Many

embedded

systems

will

small keypad-you press one key to give a specific command. A keypad may

be used to input only the digits. Many embedded systems used in process control do
not have any input device for user interaction; they take inputs from sensors or
transducers 1fnd produce electrical signals that are in turn fed to other systems.
Output devices:
The output devices of the embedded systems also have very limited capability. Some
embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the
health status of the system modules, or for visual indication of alarms. A small Liquid
Crystal Display (LCD) may also be used to display some important parameters.

CHAPTER 2
LITERATURE REVIEW
The existing car anti theft system are Car alarm, , flashing light techniques which
makes use of different type of sensors which can be pressure, tilt and shock & door sensors,
but the drawbacks are cost and it only prevents the vehicles from theft but cant be used to
trace the thief. In 1997 B Webb introduce wheel and steering lock system, to prevent car
from theft, but they are visible from outside the car and prevent the wheel from being turned
more than a few degrees.[1] . The next system was proposed on Security Module for Car
Appliances by Pang- Chieh Wang,ET.AL. This system prevents car appliances from stealing
and illegal use on other cars. If illegal moving and use a car appliance with the security
module without permission occur that will lead the appliance to useless. But it does not
prevent vehicle from theft [4]. In 2008 Lili Wan, ET.AL. implemented new system based on
GSM in which owner can receive the alarm message quickly and if necessary, also it can
monitor the car by phone [6].The next system was a sensor network based vehicle anti theft
System (SVATS). In this system, first step is to form a sensor network by using the sensors
in the vehicles that are parked within the same parking area, then monitor and identify
possible vehicle thefts by detecting unauthorized vehicle movement. An alert will be
reported to a base station in the parking area if an unauthorized movement is detected. As the
sensor cannot communicate with the base station directly in the extreme case, vehicle cannot
receive any protection when no neighbors can be found even if a sensor has tried its
maximum power level [5]. In [7] authors define an automotive security system to disable an
automobile and its key auto systems through remote control when it is stolen. But it does not
help to recognize the theft. An efficient automotive security system is implemented for
anti-theft using an embedded system occupied with a Global Positioning System (GPS) and
a Global System of mobile (GSM) by Montaser N. Ramadan ET.AL. to track and monitor
vehicles that are used by certain party for particular purposes, also to stop the vehicle if
stolen and to track it online for retrieval[8]. The next system was proposed in 2013 on real
time vehicle theft identity and control system based on ARM 9. It performs the real time

user authentication using face recognition, using the Principle Component Analysis
(PCA)

algorithm if the result is not authentic then ARM produces the signal to block the car access
and the car owner will informed about the unauthorized access with the help Short Message
Services (SMS) by using of GSM modem . But in this method the camera captures owners
image only. If the owners relatives or friends want to start the vehicle it will not start [11].
Recently new system proposed on vehicle anti-theft system based on an embedded platform
consists of multiple layers of protection .The first layer of protection in the system is a
fingerprint recognition, based on which the doors are opened. Also to prevent thieves from
breaking the glass and getting inside the vehicle, vibration sensors are used in all the
windows with a threshold level to prevent false alarms. the vehicle is turned on only with the
mechanical keys along with correct key number entry on the combination keypad present,
failing to do so for three successive times will result in vehicle getting immobilized by
cutting the fuel supply and an alert message is sent to the mobile number of the owner.
Further to prevent the seizure of the vehicle, Tyre pressure sensor is also being used which
also alerts the owner through a mobile message.[12]
Our Project is the proposed version of the existing system for bikes as well as for
cars.In our project we have added the GPS system along with the GSM module,not only to
send SMS to the respective owner but also to send the two dimensional values of the satellite
to know the exact location of the vehicle.

CHAPTER 3
BLOCK DIAGRAM
The block diagram of the system consists of a micro controller, GPS and
GSM modem,max 232 and a security switch.

Fig 3.1:Block diagram of the proposed system

3.1 DESCRIPTION:
This project is designed with AT89S52 micro controller. The
AT89S52 is used because of its low-power; high-performance CMOS 8-bit micro
controller with 8Kilo bytes of In-system programmable Flash memory. The operating
voltage range of micro controller is 4V to 5.5V DC.
The power supplies are designed to convert high voltage AC mains electricity to a
suitable low voltage supply for electronic circuits and other devices. Power supply is
connected to micro controller by series of blocks, each of which performs a particular
function.
A DC power supply which maintains the output voltage constant irrespective of AC
mains fluctuations or load variations is known as Regulated D.C Power Supply.
Power supply is connected to micro controller to supply the operating voltage of
micro controller i.e.5V DC.
This project fixed inside the vehicle. Press security switch after
parking the vehicle. Then micro controller locks the coordinates
(latitude, longitude and altitude) of that particular place. If anybody
move the vehicle from that place micro controller can detect and
sends SMS to the user or vehicle owner. After moving vehicle from
fixed coordinates micro controller sends coordinates to user
continuously. With the help of this project we can easily find out the
vehicle position through coordinates.

3.2:SCHEMATIC DIAGRAM:

Fig 3.2:Schematic Diagram Of The Proposed System

THEFT ALERTING AND NOTIFICATION SYSTEM USING GPS AND GSM

CHAPTER 4
HARDWARE COMPONENTS

The hardware components used in the proposed system are,


1.AT89S52 Microcontroller
2.Power supply
3.GPS
4.GSM
5.MAX232
6.LCD
MICROCONTROLLER:
Microprocessors and microcontrollers are widely used in embedded systems products.
Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed
amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount
of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for
many applications in which cost and space are critical.
The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was developed
by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but
today it has largely been superseded by a vast range of enhanced devices with 8051-compatible
processor cores that are manufactured by more than 20 independent manufacturers including
Atmel, Infineon Technologies and Maxim Integrated Products.
8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time.
Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU.8051 is
available in different memory types such as UV-EPROM , Flash and NV-ROM.
9

DRK INSTITUTE OF SCIENCE AND


TECHNOLOGY

61 9

Features of AT89S52:

8K Bytes of Re-programmable Flash Memory.

RAM is 256 bytes.

4.0V to 5.5V Operating Range.

Fully Static Operation: 0 Hz to 33 MHzs

Three-level Program Memory Lock.

256 x 8-bit Internal RAM.

32 Programmable I/O Lines.

Three 16-bit Timer/Counters.

Eight Interrupt Sources.

Full Duplex UART Serial Channel.

Low-power Idle and Power-down Modes.

Interrupt recovery from power down mode.

Watchdog timer.

Dual data pointer.

Power-off flag.

Fast programming time.

Flexible ISP programming (byte and page mode).

Description:
The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer
with
8K bytes of Flash programmable memory. The device is manufactured using Atmels high
density

nonvolatile

memory

technology and

is

compatible

with

the

industry-standard MCS-51 instruction set. The on chip flash allows the program memory to be
reprogrammed in system or by a conventional non volatile memory programmer.

DRK INSTITUTE OF SCIENCE AND TECHNOLOGY

10

THEFT ALERTING AND NOTIFICATION SYST EM USING GPS AND GSM


In addition, the AT89s52 is designed with static logic for operation down to zero frequency
and supports two software selectable power saving modes. The Idle Mode stops the CPU
while allowing the RAM, timer/counters, serial port and interrupt system to continue
functioning. The power-down mode saves the RAM contents but freezes the oscillator
disabling all other chip functions until the next hardware reset.

PIN DIAGRAM OF AT89S52:

Fig 4.1:Pin Diagram of Micro controller


Pin description:
Vcc

Pin 40 provides supply voltage to the chip. The voltage source is +5V.

THEFT ALERTING AND NOTIFICATION SYSTEM USING GPS AND GSM


GND

Pin 20 is the ground.

Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs.
Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses
to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes
during Program verification. External pull-ups are required during program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and
P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the
timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table.
Table 4.1: Port pins and its functions

Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the
internal pull-ups and can be used as inputs.
Port

emits

the

high-order

address

byte

during

fetches

from

external

program memory and during accesses to external data memory that uses 16-bit addresses
(MOVX @ DPTR).
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pull-ups.
Port 3 also serves the functions of various special features of the AT89S52, as shown in the
following table 4.2.
Table 4.2:Port pins and its functions

ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG) during
Flash programming.
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When the
AT89S52 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external
data memory.
EA/VPP
External Access Enable EA must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note, however,
that if lock bit 1 is programmed, EA will be internally latched on reset.
UART
The Atmel 8051 Microcontrollers implement three general purpose, 16-bit timers/ counters.
They

are

identified

as

Timer

0,

Timer

and

Timer

and

can

be

independently configured to operate in a variety of modes as a timer or as an event counter.


When operating as a timer, the timer/counter runs for a programmed length of time and then
issues an interrupt request. When operating as a counter, the timer/counter counts negative
transitions on an external pin. After a preset number of
counts, the counter issues an interrupt request.

Since it takes 2 cycles (12 peripheral clock periods) to recognize a negative transition, the
maximum count rate is FPER / 12, i.e. FOSC / 24 in standard mode or FOSC / 12 in X2 mode.
In addition to the timer or counter selection, Timer 0 and Timer 1 have four operating
modes from which to select which are selected by bit-pairs (M1, M0) in TMOD. Modes 0,
1and 2 are the same for both timer/counters. Mode 3 is different.
The four operating modes are described below. Timer 2, has three modes of
operation:
capture, auto-reload and baud rate generator.

Timer 0
Timer 0 functions as either a timer or event counter in four modes of operation. Timer
0 is controlled by the four lower bits of the TMOD register and bits 0, 1, 4 and 5 of the
TCON register. TMOD register selects the method of timer gating (GATE0), timer or counter
operation (T/C0#) and mode of operation (M10 and M00).

Mode 0 (13-bit Timer)


Mode 0 configures timer 0 as a 13-bit timer which is set up as an 8-bit timer (TH0 register)
with a modulo-32 prescaler implemented with the lower five bits of the TL0
register. The upper three bits of TL0 register are indeterminate and should be ignored.
Prescaler overflow increments the TH0 register.
Mode 0 operation is the same for Timer 0 as for Timer 1. There are two different
GATE bits, one for Timer 1 (TMOD.7) and one for Timer 0
(TMOD.3).

Interrupts
The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1),
three timer interrupts (Timers 0, 1, and 2) and the serial port interrupt. These interrupts are all
shown in the below figure.Timer 2 interrupt is generated by the logical OR of bits TF2 and
EXF2 in register T2CON.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers
overflow.

The

values

are

then

polled

by

the

circuitry

in

the

next

cycle.

However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which
the timer overflows.

Serial Communication:
The main requirements for serial communication are:
1. Microcontroller
2. PC
3. RS 232 cable
4. MAX 232 IC
5. HyperTerminal
When the pins P3.0 and P3.1 of microcontroller are set, UART which is inbuilt in the
microcontroller will be enabled to start the serial communication.
RS232 CABLE:
To allow compatibility among data communication equipment, an interfacing standard called
RS232 is used. Since the standard was set long before the advent of the TTL logic family, its
input and output voltage levels are not TTL compatible. For this reason, to connect any RS232

to a microcontroller system, voltage converters such as MAX232 are used to convert the TTL
logic levels to the RS232 voltage levels and vice versa.
MAX 232:
Max232 IC is a specialized circuit which makes standard voltages as required by RS232
standards. This

IC

provides

best

noise rejection

and

very

reliable

against

discharges and short circuits. MAX232 IC chips are commonly referred to as line drivers.
To ensure data transfer between PC and microcontroller, the baud rate and voltage levels
of
Microcontroller and PC should be the same. The voltage levels of
microcontroller are logic1 and logic 0 i.e., logic 1 is +5V and logic 0 is 0V. But for PC, RS232
voltage levels are considered and they are: logic 1 is taken as -3V to -25V and logic 0 as +3V
to +25V. So, in order to equal these voltage levels, MAX232 IC is used. Thus this IC converts
RS232 voltage levels to microcontroller voltage levels and vice versa.

Fig 4.2 Pin Diagram of MAX232

Interfacing max232 with microcontroller:

Fig 4.3:Interfacing max232 with microcontroller


SCON (serial control) register:
The SCON register is an 8-bit register used to program the start bit, stop bit and data bits of data
framing.

SM0
specifier

SCON.7

Serial port mode

SM1
specifier

SCON.6

Serial port mode

SM2
communication

SCON.5

REN
reception

Used for multiprocessor

SCON.4

Set/cleared by software to enable/disable

TB8
used

SCON.3

Not widely

RB8
used

SCON.2

Not widely

TI

SCON.1

Transmit interrupt flag. Set by hardware at

the beginning of the stop bit in mode 1. Must be


cleared by software.
RI

SCON.0

Receive interrupt flag. Set by hardware at

the beginning of the stop bit in mode 1. Must be


cleared by software.
SM0

SM1

0
Mode 0

Serial

0
start bit

Serial Mode 1, 8-bit data, 1 stop bit, 1

1
Mode 2

Serial

1
Mode 3

Serial

Of the four serial modes, only mode 1 is widely used. In the SCON register, when serial mode
1 is chosen, the data framing is 8 bits, 1 stop bit and 1 start bit, which makes it compatible
with the COM port of IBM/ compatible PCs. And the most important is serial mode 1 allows
the baud rate to be variable and is set by Timer 1 of

the 8051. In serial mode 1, for each character a total of 10 bits are transferred, where the first
bit is the start bit, followed by 8 bits of data and finally 1 stop bit.
RELAYS:

A relay is an electrically controllable switch widely used in industrial controls,


automobiles and appliances.The relay allows the isolation of two separate sections of a system
with two different voltage sources i.e., a small amount of voltage/current on one side can
handle a large amount of voltage/current on the other side but there is no chance that these two
voltages mix up
Inductor

Fig 4.4: Circuit symbol of a relay

Operation:

When current flows through the coil, a magnetic field is created around the coil i.e.,
the coil is energized. This causes the armature to be attracted to the coil. The
armatures contact acts like a switch and closes or opens the circuit. When the coil is not
energized, a spring pulls the armature to its normal state of open or closed. There are all types
of relays for all kinds of applications.

GSM Technology:
Definition of GSM:
GSM (Global System for Mobile communications) is an open, digital cellular technology used
for transmitting mobile voice and data services.
GSM

(Global

System

for

Mobile

communication)

is

digital

mobile

telephone system that is widely used in Europe and other parts of the world. GSM uses a
variation of Time Division Multiple Access (TDMA) and is the most widely used of the three
digital wireless telephone technologies (TDMA, GSM, and CDMA). GSM digitizes and
compresses data, then sends it down a channel with two other streams of user data, each in its
own time slot. It operates at either the 900 MHz or 1,800 MHz frequency band. It supports
voice calls and data transfer speeds of up to 9.6 kbit/s, together with the transmission of SMS
(Short Message Service).

GSM Frequencies
GSM networks operate in a number of different frequency ranges (separated into GSM
frequency ranges for 2G and UMTS frequency bands for 3G). Most 2G GSM networks
operate

in

the

900

MHz

or

1800

MHz

bands.

Some

countries

in

the

Americas (including Canada and the United States) use the 850 MHz and 1900 MHz bands
because the 900 and 1800 MHz frequency bands were already allocated. Most
3G GSM networks in Europe operate in the 2100 MHz frequency band.

GSM-900 uses 890915 MHz to send information from the mobile station to the base station
(uplink) and 935960 MHz for the other direction (downlink), providing 124

RF channels (channel numbers 1 to 124) spaced at 200 kHz.


Table 4.3:Mobile Telephone Standard

1G
The first generation of mobile telephony (written 1G) operated using analogue
communications and portable devices that were relatively large. It used primarily the following
standards:

AMPS (Advanced Mobile Phone System), which appeared in 1976 in the United

States, was the first cellular network standard. It was used primarily in the Americas, Russia
and Asia. This first-generation analogue network had weak security mechanisms which allowed
hacking of telephones lines.

TACS (Total Access Communication System) is the European version of the AMPS
model. Using the 900 MHz frequency band, this system was largely used in England
and then in Asia (Hong-Kong and Japan).
ETACS

(Extended

Total Access

Communication

System)

is

an

improved version of the TACS standard developed in the United Kingdom that uses a
larger number of communication channels.

Second Generation of Mobile Networks (2G)


The second generation of mobile networks marked a break with the first generation of cellular
telephones by switching from analogue to digital. The main 2G mobile telephony standards
are:

GSM (Global System for Mobile communications) is the most commonly used
standard in Europe at the end of the 20th century and supported in the United States.
This standard uses the 900 MHz and 1800 MHz frequency bands in Europe. In the
United States, however, the frequency band used is the 1900
MHz band. Portable telephones that are able to operate in Europe and the
United States are therefore called tri-band.

CDMA (Code Division Multiple Access) uses a spread spectrum technique that
allows a radio signal to be broadcast over a large frequency range.

TDMA (Time Division Multiple Access) uses a technique of time division of


communication channels to increase the volume of data transmitted simultaneously.

With the 2G networks, it is possible to transmit voice and low volume digital data, for example
text messages (SMS, for Short Message Service) or multimedia messages (MMS, for
Multimedia Message Service). The GSM standard allows a maximum data rate of 9.6 kbps.
3G
The IMT-2000 (International Mobile Telecommunications for the year 2000)
specifications from the International Telecommunications Union (ITU) defined the
characteristics of 3G
(third generation of mobile telephony). The most important of these characteristics are:
1.

High transmission data rate.

2.

144 Kbps with total coverage for mobile use.

3.

384 Kbps with medium coverage for pedestrian use.

4.

2 Mbps with reduced coverage area for stationary use.

5.

Compatibility

of

3rd

generation

mobile

services

with

second

generation networks.
3G

offers

access

data

to multimedia

high-speed internet
the

rates

of

uses

access.

more
such

3G

than

as

144

video

networks

use

Kbit/s,

thereby

transmission,
different

allowing

video-conferencing
frequency

bands

the
or
than

previous networks: 1885-2025 MHz and 2110-2200 MHz.

Introduction to the GSM Standard


In Europe, the GSM standard uses the 900 MHz and 1800 MHz frequency bands. In the
United States, however, the frequency band used is the 1900 MHz band. For this reason,
portable telephones that are able to operate in both Europe and the United States are called
tri-band while those that operate only in Europe are called bi-band. The
allows

maximum

throughput

of

9.6

kbps

which

GSM

standard

allows transmission of

voice and low-volume digital data like text messages (SMS, for Short Message Service) or
multimedia messages (MMS, for Multimedia Message Service).

GSM Standards:
GSM uses narrowband TDMA, which allows eight simultaneous calls on the same radio
frequency.
There are three basic principles in multiple access, FDMA (Frequency Division Multiple
Access), TDMA (Time Division Multiple Access), and CDMA (Code Division Multiple
Access). All three principles allow multiple users to share the same physical c hannel. But
the two competing technologies differ in the way user sharing the common resource.

TDMA allows the users to share the same frequency channel by dividing the signal into
different time slots. Each user takes turn in a round robin fashion for transmitting and receiving
over the channel. Here, users can only transmit in their respective time slot.
CDMA uses a spread spectrum technology that is it spreads the information contained
in a particular signal of interest over a much greater bandwidth than the original signal. Unlike
TDMA, in CDMA several users can transmit over the channel at the same time.
The concept of cellular network
Mobile telephone networks are based on the concept of cells, circular zones that overlap to
cover a geographical area.

Fig 4.5:Cellular networks


Cellular networks are based on the use of a central transmitter-receiver in each cell, called a
"base station" (or Base Transceiver Station, written BTS). The smaller the radius of a cell, the
higher is the available bandwidth. So, in highly populated urban areas, there are cells with a
radius of a few hundred meters, while huge cells of up to
30 kilometers provide coverage in rural areas.
In a cellular network, each cell is surrounded by 6 neighbouring cells (thus a cell is generally
drawn as a hexagon). To avoid interference, adjacent cells cannot use the same frequency. In

practice, two cells using the same frequency range must be separated by a distance of two to
three times the diameter of the cell.
Architecture of the GSM Network
In a GSM network, the user terminal is called a mobile station. A mobile station is made up
of a SIM (Subscriber Identity Module) card allowing the user to be uniquely identified and a
mobile terminal.
The terminals

(devices)

are

identified

by

unique 15-digit

identification

number called IMEI (International Mobile Equipment Identity). Each SIM card also has a
unique (and secret) identification number called IMSI (International Mobile Subscriber
Identity). This code can be protected using a 4-digit key called a PIN code. The
therefore

allows

each

user

to

be

identified

independently

of

SIM

card

the terminal used

during communication with a base station. Communications occur through a radio link (air
interface) between a mobile station and a base station.
All the base stations of a cellular network are connected to a base station controller
(BSC) which is responsible for managing distribution of the resources. The system consisting
of the base station controller and its connected base stations is called the Base Station
Subsystem (BSS).
Finally, the base station controllers are themselves physically connected to the Mobile
Switching Centre (MSC), managed by the telephone network operator, which connects them
to the public telephone network and the Internet. The MSC belongs to a Network Station
Subsystem (NSS), which is responsible for managing user identities, their location and
establishment of communications with other subscribers.

GSM Modem:
A GSM modem is a wireless modem that works with a GSM wireless network. A wireless
modem behaves like a dial-up modem. The main difference between them is that a dial-up
modem sends and receives data through a fixed telephone line while a wireless modem sends
and receives data through radio waves.

Fig 4.6:GSM Modem


Computers use AT commands to control modems. Both GSM modems and dial-up modems
support a common set of standard AT commands. In addition to the standard
AT commands,

GSM

modems

support

an

extended

set

of AT commands.

These extended AT commands are defined in the GSM standards. With the extended
AT
commands, the following operations can be performed:

Reading, writing and deleting SMS messages.

Sending SMS messages.

Monitoring the signal strength.

Monitoring the charging status and charge level of the battery.

Reading, writing and searching phone book entries.

Introduction to AT Commands
AT commands are instructions used to control a modem. AT is the abbreviation of ATtention.
Every command line starts with "AT" or "at". That's the reason, modem commands are
called AT commands. Many of the commands that are used to control wired dial-up modems,
such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data
state) are also supported by GSM modems and mobile phones.
Besides this common AT command set, GSM modems and mobile phones support an AT
command set that is specific to the GSM technology, which includes SMS-related commands
like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from storage),
AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages).
I t should be noted that the starting "AT" is the prefix that informs the modem about
the
start of a command line. For example, D is the actual AT command name in ATD and +CMGS is
the actual AT command name in AT+CMGS.
Some of the tasks that can be done using AT commands with a GSM modem or mobile
phone are listed below:

Get basic information about the mobile phone or GSM modem. For example, name of
manufacturer (AT+CGMI), model number (AT+CGMM), IMEI number (International
Mobile Equipment Identity) (AT+CGSN) and software version (AT+CGMR).

Get

the

For example,

current

status

mobile

network registration

status

of
phone

the

mobile
activity

(AT+CREG),

phone

or

status
radio

signal

battery charge level and battery charging status (AT+CBC).

GSM/GPRS
(AT+CPAS),
strength

modem.
mobile

(AT+CSQ),

Establish a data connection or voice connection to a remote modem (ATD,


ATA, etc).

Send and receive fax (ATD, ATA, AT+F*).

Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write (AT+CMGW)


or delete (AT+CMGD) SMS messages and obtain notifications of newly received SMS
messages (AT+CNMI).

Read

(AT+CPBR),

write

(AT+CPBW)

or

search

(AT+CPBF)

phonebook entries.

Control the presentation of result codes / error messages of AT commands. For


example, the user can control whether to enable certain error messages
(AT+CMEE) and whether error messages should be displayed in numeric format or
verbose format
(AT+CMEE=1 or AT+CMEE=2).

Get or change the configurations of the mobile phone or GSM/GPRS modem.


For example, change the GSM network (AT+COPS), bearer service type
(AT+CBST), radio link protocol parameters (AT+CRLP), SMS center address
(AT+CSCA) and
storage of SMS messages (AT+CPMS).

Save and restore configurations of the mobile phone or GSM/GPRS modem.


For example, save (AT+CSAS) and restore (AT+CRES) settings related to
SMS messaging such as the SMS center address.

GPS:
Global Positioning System (GPS) is a Global Navigation Satellite System (GNSS) developed
by the United States Department of Defense. It is the only fully functional GNSS in the world.
It uses a constellation of between 24 and 32 Medium Earth Orbit
satellites that transmit precise microwave
determine their current location,

signals, which

the time, and

enable GPS receivers

their velocity.

Its

to

official name is

NAVSTAR GPS.
Each

satellite

continually

transmits

messages containing the time the message was sent,

precise orbital information (the ephemeris), and the general system health and rough orbits of
all GPS satellites (the almanac). The receiver measures the transit time of each message and
computes the distance to each satellite. Geometric trilateration is used to combine these
distances with the location of the satellites to determine the receiver's location. The position is
displayed, perhaps with a moving map display or latitude and longitude; elevation information
may be included.

What is GPS?

The Global Positioning System (GPS) is a satellite-based navigation system made up of a


network of 24 satellites placed into orbit by the U.S. Department of Defense. GPS was
originally intended for military applications, but in the 1980s, the government made the system
available for civilian use. GPS works in any weather conditions, anywhere in the world, 24
hours a day. There are no subscription fees or setup charges to use GPS.

How it works?
GPS satellites circle the earth twice a day in a very precise orbit and transmit signal
information to earth. GPS receivers take this information and use triangulation to calculate the
user's exact location. Essentially, the GPS receiver compares the time a signal was transmitted
by a satellite with the time it was received. The time difference tells the GPS receiver how far
away the satellite is. Now, with distance measurements from a few more satellites, the
receiver
can determine the user's position and display it on the unit's electronic map.

Fig 4.7:GPS system


A GPS receiver must be locked on to the signal of at least three satellites to calculate a
2D posi tion (latitude and longitude) and track movement. With four or more satellites in view,
the receiver can determine the user's 3D position (latitude, longitude and altitude). Once the
user's position has been determined, the GPS unit can calculate other information, such as
speed, bearing, track, trip distance, distance to destination, sunrise and sunset time and more.

How accurate is GPS?


Today's GPS receivers are extremely accurate, thanks to their parallel multi-channel design.
Garmin's 12 parallel channel receivers are quick to lock onto satellites when first turned on and
they maintain strong locks, even in dense foliage or urban settings with tall buildings. Certain
atmospheric factors and other sources of error can affect the accuracy of GPS receivers. This

system consists of a network of towers that receive GPS signals and transmit a corrected
signal by beacon transmitters. In order to get the corrected signal, users must have a differential
beacon receiver and beacon antenna in addition to their GPS.
The 24 satellites that make up the GPS space segment are orbiting the earth about
12,000 miles above us. They are constantly moving, making two complete orbits in less than
24 hours. These satellites are travelling at speeds of roughly 7,000 miles an hour.
GPS satellites are powered by solar energy. They have backup batteries
onboard to keep them running in the event of a solar eclipse, when there's no solar power.
Small rocket boosters on each satellite keep them flying in the correct path.
o

The first GPS satellite was launched in 1978.

A full constellation of 24 satellites was achieved in 1994.

Each satellite is built to last about 10 years. Replacements are


constantly being built and launched into orbit.

A GPS satellite weighs approximately 2,000 pounds and is about 17 feet


across with the solar panels extended.

GPS satellites transmit two low power radio signals, designated L1 and L2. Civilian GPS
uses the L1 frequency of 1575.42 MHz in the UHF band. The signals travel by line of sight,
meaning they will pass through clouds, glass and plastic but will not go through most solid
objects such as buildings and mountains.

Fig 4.8:Sources of GPS signal errors

Factors

that

can

include

the following:

degrade

the

GPS

signal

and

thus

affect

accuracy

Ionosphere and troposphere delays - The satellite signal slows as it passes


through the atmosphere. The GPS system uses a built-in model that calculates an
average amount of delay to partially correct for this type of error.

Signal multipath - This occurs when the GPS signal is reflected off objects such
as tall buildings or large rock surfaces before it reaches the receiver. This increases
the travel time of the signal, thereby causing errors.

Receiver clock errors - A receiver's built-in clock is not as accurate as the atomic
clocks onboard the GPS satellites. Therefore, it may have very slight timing errors.

Applications:
GPS has a variety of applications on land, at sea and in the air. Basically, GPS is usable
everywhere except where it's impossible to receive the signal such as inside most buildings,
in caves and other subterranean locations, and underwater. The most common airborne
applications are for navigation by general aviation and commercial aircraft. At sea, GPS is

also typically used for navigation by recreational boaters, commercial fishermen, and
professional mariners. Land-based applications are more diverse. The scientific community
uses GPS for its precision timing capability and position information.

LIQUID CRYSTAL DISPLAY:


LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven
segment LEDs or other multi segment LEDs) because of the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which
are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task
of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying
the data.
4. Ease of programming for characters and graphics.
These components are specialized for being used with the microcontrollers, which means that they
cannot be activated by standard IC circuits. They are used for writing different messages on a
miniature LCD.

Fig 4.9:LCD display

A model described here is for its low price and great possibilities most frequently used in practice. It
is based on the HD44780 microcontroller (Hitachi) and can display messages in two lines with 16
characters each. It displays all the alphabets, Greek letters, punctuation marks, mathematical symbols
etc. In addition, it is possible to display symbols that user makes up on its own.
Automatic shifting message on display (shift left and right), appearance of the pointer, backlight etc.
are considered as useful characteristics.

Pins Functions
There are pins along one side of the small printed board used for connection to the microcontroller.
There are total of 14 pins marked with numbers (16 in case the background light is built in). Their
function is described in the table below:
Table 4.4:Pin functions of LCD
Function

Pin Number Name

Logic State Description

Ground

Vss

0V

Power supply

Vdd

+5V

Contrast

Vee

0 Vdd

D0 D7 are interpreted as commands

D0 D7 are interpreted as data

D0 D7 are interpreted as commands

D0 D7 are interpreted as data

Write data (from controller to LCD)

Read data (from LCD to controller)

Control of operating 4

RS

RS

R/W

Control of operating
Normal operating

Data / commands

Access to LCD disabled


0
1
Data/commands are transferred to
From 1 to 0
LCD

D0

0/1

Bit 0 LSB

D1

0/1

Bit 1

D2

0/1

Bit 2

10
11

D3
D4

0/1
0/1

Bit 3
Bit 4

12

D5

0/1

Bit 5

13

D6

0/1

Bit 6

14

D7

0/1

Bit 7 MSB

LCD screen:
LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot matrix.
Contrast on display depends on the power supply voltage and whether messages are displayed in one
or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as Vee. Trimmer
potentiometer is usually used for that purpose. Some versions of displays have built in backlight
(blue or green diodes). When used during operating, a resistor for current limitation should be used
(like with any LE diode).

Fig 4.10:LCD connections

LCD Basic Commands


All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data,
which depends on logic state on pin RS:
RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor
addresses built in map of characters and displays corresponding symbols. Displaying position is
determined by DDRAM address. This address is either previously defined or the address of
previously transferred character is automatically incremented.
RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands which LCD
recognizes are given in the table below:
Table 4.5:List of LCD commands
Command

RS RW D7 D6 D5 D4 D3 D2 D1 D0 Execution Time

Clear display

1.64Ms

Cursor home

1.64mS

Entry mode set

I/D S

40uS

Display on/off control

40uS

Cursor/Display Shift

D/C R/L x

40uS

Function set

DL N

40uS

Set CGRAM address

CGRAM address

Set DDRAM address

DDRAM address

Read BUSY flag (BF)

BF DDRAM address

Write to CGRAM or DDRAM

D7 D6 D5 D4 D3 D2 D1 D0 40uS

Read from CGRAM or DDRAM

D7 D6 D5 D4 D3 D2 D1 D0 40uS

I/D 1 = Increment (by 1)


0 = Decrement (by 1)
S 1 = Display shift on
0 = Display shift off

40uS
40uS
-

R/L 1 = Shift right


0 = Shift left
DL 1 = 8-bit interface
0 = 4-bit interface

D 1 = Display on

N 1 = Display in two lines

0 = Display off
U 1 = Cursor on

0 = Display in one line


F 1 = Character format 5x10 dots

0 = Cursor off
B 1 = Cursor blink on

0 = Character format 5x7 dots


D/C 1 = Display shift

0 = Cursor blink off

0 = Cursor shift

LCD Connection
Depending on how many lines are used for connection to the microcontroller, there are 8-bit and
4-bit LCD modes. The appropriate mode is determined at the beginning of the process in a phase
called initialization. In the first case, the data are transferred through outputs D0-D7 as it has been
already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O pins of the
microcontroller, there are only 4 higher bits (D4-D7) used for communication, while other may be
left unconnected.

Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that normally
would be sent through lines D4-D7), four lower bits are sent afterwards. With the help of
initialization, LCD will correctly connect and interpret each data received. Besides, with regards to
the fact that data are rarely read from LCD (data mainly are transferred from microcontroller to LCD)
one more I/O pin may be saved by simple connecting R/W pin to the Ground. Such saving has its
price.

Even though message displaying will be normally performed, it will not be possible to read from
busy flag since it is not possible to read from display.

LCD Initialization
Once the power supply is turned on, LCD is automatically cleared. This process lasts for
approximately 15mS. After that, display is ready to operate. The mode of operating is set by default.
This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off

Automatic reset is mainly performed without any problems. If for any reason power supply voltage
does not reach full value in the course of 10mS, display will start perform completely unpredictably.
If voltage supply unit cannot meet this condition or if it is needed to provide completely safe
operating, the process of initialization by which a new reset enabling display to operate normally
must be applied.
Algorithm according to the initialization is being performed depends on whether connection to the
microcontroller is through 4- or 8-bit interface. All left over to be done after that is to give basic
commands and of course- to display messages.

Fig 4.11:Procedure on 8-bit initialization

Contrast control:
To have a clear view of the characters on the LCD, contrast should be adjusted. To adjust the
contrast, the voltage should be varied. For this, a preset is used which can behave like a variable
voltage device. As the voltage of this preset is varied, the contrast of the LCD can be adjusted.

Fig 4.12:Variable Resistor

Potentiometer
Variable resistors used as potentiometers have all three terminals connected. This arrangement is
normally used to vary voltage, for example to set the switching point of a circuit with a sensor, or
control the volume (loudness) in an amplifier circuit. If the terminals at the ends of the track are
connected across the power supply, then the wiper terminal will provide a voltage which can be
varied from zero up to the maximum of the supply.

Fig 4.13:Potentiometer symbol


Presets
These are miniature versions of the standard variable resistor. They are designed to be mounted
directly onto the circuit board and adjusted only when the circuit is built. For example, to set the
frequency of an alarm tone or the sensitivity of a light-sensitive circuit, a small screwdriver or
similar tool is required to adjust presets.
Presets are much cheaper than standard variable resistors so they are sometimes used in projects
where a standard variable resistor would normally be used.

Multiturn presets are used where very precise adjustments must be made. The screw must be turned
many times (10+) to move the slider from one end of the track to the other, giving very fine control.

Fig 4.14:Preset symbol

LCD interface with the micro controller (4-bit mode):

Fig 4.15:Interfacing LCD with Micro controller

CHAPTER 5
SOFTWARE REQUIREMENTS

The softwares are used to develop the system are given below.

Keil compiler

Proteus

Prog ISP

5.1 KEIL IDE:


Keil development tools for the 8051 Microcontroller Architecture support every level of
software developer from the professional applications engineer to the student just learning
about embedded software development. The Keil software development tools are designed to
solve the complex Problems facing embedded software developers
SIMULATION:
The Vision Simulator allows you to debug programs using only your PC using
simulation drivers provided by Keil and various third-party developers. A good simulation
environment, like Vision, does much more than simply simulate the instruction set of a
microcontroller it simulates your entire target system including interrupts, startup code,
on-chip peripherals, external signals, and I/O. This software is used for execution of
microcontroller programs. Keil development tools for the

MC architecture support every

level of software developer from the professional applications engineer to the student just
learning about embedded software development. The industry-standard keil C compilers,
macro assemblers, debuggers, real, time Kernels, Single-board computers and emulators

support all microcontroller derivatives and help you to get more projects completed on
schedule.
The Keil software development tools are designed to solve the complex Problems facing
embedded software developers.
When starting a new project, simply select the microcontroller you
and the

vision IDE sets

all compiler,

the device

database

assembler, linker, and memory options for you.

Numerous example programs are included to help you get started with the most popular
embedded AVR devices. The keil Vision debugger accurately simulates on-chip
peripherals (PC, CAN, UART, SPI, Interrupts, I/O ports, A/D converter, D/A converter and
PWM modules)of your AVR device. Simulation helps you understand h/w configurations and
avoids time wasted on setup problems. Additionally, with simulation, you can write and test
applications before target h/w is

available.

When you are ready to begin testing your s/w application with target h/w, we can use any one
of the MON51, MON390, MONADI, or flash MON51 target monitors, the ISD51 In-System
Debugger, or the ULINK USB-JTAG adapter to download and test program code on your
target system.

Click on the Keil Vision Icon on Desktop


The following fig 5.1 will appear

FIG 5.1: KEILVISION IS OPENED


1. Click on the Project menu from the title bar
Then Click on New Project. The following fig5.2 will appear.

FIG 5.2: TO CREATE NEW PROJECT


2. Save the Project by typing suitable project name with no extension in your own folder
sited in either C:\ or D:\. The following fig5.3 will appear.

FIGS 5.3: SAVE AS .ASM FILE


Then Click on save button above.
3. Select the component for your project. I.e. Atmelas shown in below fig 5.4.
4. Click on the + Symbol beside of Atmel.

FIG 5.4: SELECTION OF ATMEL


5. Select AT89S52 as shown below fig 5.5.

Fig 5.5: SELECTON OF AT89S52 MICROCONTROLLER


6. Then Click on OK
7. The Following fig5.6

will appear

FIG 5.6: STARTUP CODE


8. Then Click either YES or NOmostly NO
9. Now your project is ready to USE
10. Now double click on the Target1, you would get another option Source group 1 as
shown in fig 5.7.

FIG 5.7: SOURCE GROUP 1 IS SHOWING


11. Click on the file option from menu bar and select new as shown in below fig 5.8.

FIG 5.8: SELECTION NEW


12. The next screen will be as shown in fig5.9, and just maximize it by double clicking on
its blue boarder.

FIG 5.9: TEXT BOX CREATED


13. Now start writing program in either in C or ASM
14. For a program written in Assembly, then save it with extension . asm

and

for

C based program save it with extension .C as shown in below fig5.10.

FIG 5.10: SAVE THE PROGRAM WITH EXTNSION


15. Now right click on Source group 1 and click on Add files to Group Source as
shown in below fig 5.11.

FIG 5.11: ADDING FILES TO SOURCE


16. Now you will get another window, on which by default C files will appear as shown
in below fig 5.12.

FIG 5.12: SELECT FILE EXTENSION


17. Now select as per your file extension given while saving the file
18. Click only one time on option ADD
19. Now Press function key F7 to compile. Any error will appear if so happen as shown
in fig 5.13.

FIG 5.13: COMPILETION OF PROGRAM


20. If the file contains no error, then press Control+F5 simultaneously.
21. The new window is as follows in fig 5.14.

FIG 5.14: ERROR DETECTION


22. Then Click OK
23. Now Click on the Peripherals from menu bar, and check your required port as shown
in fig 5.15 below

FIG 5.15: SELETION OF PORTS


24. Drag the port a side and click in the program file as shown in fig 5.16.

FIG 5.16: SHOWS SELECTED PORT


25. Now keep Pressing function key F11 slowly and observe the ports for output.
You are running your program successfully.

5.2 PROTEUS:
Proteus is best simulation software for various designs with microcontroller. It is mainly popular
because of availability of almost all microcontrollers in it. So it is a handy tool to test programs and
embedded designs for electronics hobbyist. You can simulate your programming of microcontroller
in Proteus Simulation Software. After simulating your circuit in Proteus Software you can directly
make PCB design with it so it could be an all in one package for students and hobbyists.
To design the layout we use Proteus software.
1. Click on ISIS professional. Then the following fig 5.17 will appear.

FIG 5.17: PROTEUS WINDOW IS OPENED


2. Click on file menu on the title bar.
Then click on new design. Then the following fig 5.18 will appear

FIG 5.18: CREATING A NEW DESIGN


3. Using pick and places devices we can pick required devices. So click on microcontroller
which is to be used in the project and place it in new design then the following fig 5.19 will
appear

FIG 5.19: MICROCONTROLLER IS SELECTED

4. Connect the power supply,crystal oscillator and reset circuit to the micro controller.

FIG 5.20: CONNECTION OF POWER SUPPLY TO THE CONTROLLER


5.

Connect 4bit LCD to the microcontroller.

FIG 5.21: CONNECTION OF LCD TO THE CONTROLLER


6.Connect the Max232,Relay and Security switch to the micro controller.

Fig 5.22:Connection of MAX232,relay and security switch


7.Connect GSM and GPS modules to the relay and micro controller.

Fig 5.23:Connection of GSM and GPS modules

5.3 PROG ISP SOFTWARE:


PROGISP is the software used to load the HEX file on to the target chip. KEIL Micro vision is the
software to create HEX file using C code or Assembly language.
The drivers for the ISP Programmer are found inside the Drivers folder of PROGISP. The following
fig 5.24 will appear.

FIG 5.24: DRIVERS INSIDE THE PROG ISP FOLDER


Open the DEVICE Manager of your PC while connecting the ISP programmer to USB port. If you
get an exclamation mark against device, Update driver & browse to the location of Drivers inside
PROGISP folder youve downloaded. Once the Drivers are installed you get the USBasp under
Device manager. The following fig 5.25 shows that the setup is now ready to load the HEX file.

FIG 5.25: INSTALLATION OF DRIVERS


We use the PROGISP application to load the HEX file on to the target IC. No installation is required
for this software, its a standalone one. Double click progisp.exe to open the application. The PRG
ISP & USB ASP buttons should be bright .If its grayed out, and then check the USB cable
connection & the driver installation. Select the target chip (here 89S 52) from the Select Chip drop
down menu. The following fig 5.26 will appear.

FIG 5.26: SELECTION OF TARGET IC


Ensure that following buttons are enabled: Verify Signature, Chip Erase, Program Flash and Verify
Flash. If you enable the LOCK CHIP button; others cant make a copy of your chip. The following
fig 5.27 shows the buttons mentioned above.

FIG 5.27: ENABLING THE ABOVE BUTTONS


Click on Erase button then the contents in chip will be erased and ready to load another file. The
following fig 5.28 shows the deletion of data from chip.

FIG 5.28: DELETION OF DATA


Click on FILE > LOAD FLASH & browse to the location of the HEX file youve created using
KEIL. The following figures fig 5.29 and fig 5.30 shows the loading and selection of hex file.

FIG 5.29: LOADING HEX FILE

FIG 5.30: SELECTION OF HEX FILE

Once the HEX file is loaded, click on AUTO button to perform the tasks youve enabled. The
following fig 5.31 shows the performance of the task enabled

FIG 5.31: DUMPING HEX FILE INTO THE CHIP


The status bar at the bottom indicates the progress of operation as shown in the below fig5.32.

FIG 5.32: PROGRES OF OPERTION


Finally the HEX is successfully loaded on to the target chip. The following fig5.33 will appear.

FIG: 5.33 HEX FILE IS LOADED

CHAPTER 6
RESULT

THEFT ALERTING AND NOTIFICATION SYSTEM USING GPS AND GSM

DRK INSTITUTE OF SCIENCE AND TECHNOLOGY

64

CHAPTER 7
CONCLUSION AND FUTURE SCOPE
CONCLUSION:
The implementation of Theft Alerting and Notification System Using GSM and GPS is
done successfully. The communication is properly done without any interference between different
modules in the design. Design is done to meet all the specifications and requirements. Software tools
like Keil U vision Simulator, Prog-isp to dump the source code into the micro controller, Proteus for
the schematic diagram have been used to develop the software code before realizing the hardware.

Circuit is implemented in Proteus and implemented on the micro controller board. The
performance has been verified both in software simulator and hardware design. The total circuit is
completely verified functionally and is following the application software.
It can be concluded that the design implemented in the present work provide portability,
flexibility and the data transmission is also done with low power consumption.

FUTURE SCOPE:
1.We can monitor some parameters of vehicle like overheat or LPG gas leakage.

2.We can dial an emergency call if the vehicle goes out of a certain track.

3.We can use our kit for detection of bomb by connecting to the bomb detector.

DRK INSTITUTE OF SCIENCE AND TECHNOLOGY

65

APPENDIX
#include<reg52.h>

//P1^5,P1^6,P1^7 are connected to phases by converting r y b to dc 5v

individually.
#include<string.h>

#define lcd_data P2

sbit lcd_rs

= P2^0;

sbit lcd_en

= P2^1;

sbit relay

= P1^0;

sbit sw

= P1^6;

sbit therm

= P1^4;

sbit voice = P1^5;


sbit voice1=P1^6;

sbit relay1 = P1^1;

sbit relay2 = P1^2;


sbit relay3 = P1^3;

unsigned char pastnumber[11],count=0,q;


unsigned char rcv,r;

idata unsigned char rcv1,rcv2,rcv3,rcv4,rcv5,msg1[10],msg2[11];


idata unsigned char ql;
idata unsigned char msga[10],msgb[11];

unsigned convert(unsigned int);


unsigned convert1(unsigned int);
unsigned char rcg,pastnumber[11],pastnumber1[11];
unsigned char chr='x',chr1='x';
void gpssignalgain();

void delay(unsigned int v)


{
unsigned int i,j;
for(i=0;i<=v;i++)
for(j=0;j<=275;j++);
}

void MSDelay(unsigned int value)


{
unsigned int x,y;
for(x=0;x<1275;x++)
for(y=0;y<value;y++);
}

void lcdcmd(unsigned char value)


{

// LCD COMMAND

lcd_data=value&(0xf0); //send msb 4 bits


lcd_rs=0;
lcd_en=1;

//select command register


//enable the lcd to execute command

delay(3);
lcd_en=0;
lcd_data=((value<<4)&(0xf0)); //send lsb 4 bits
lcd_rs=0; //select command register
lcd_en=1;

//enable the lcd to execute command

delay(3);
lcd_en=0;

}
void lcd_init(void)
{
lcdcmd(0x02);
lcdcmd(0x02);
lcdcmd(0x28); //intialise the lcd in 4 bit mode*/
lcdcmd(0x28); //intialise the lcd in 4 bit mode*/

lcdcmd(0x0e); //cursor blinking


lcdcmd(0x06); //move the cursor to right side
lcdcmd(0x01); //clear the lcd

}
void lcddata(unsigned char value)

lcd_data=value&(0xf0); //send msb 4 bits


lcd_rs=1;

//select data register

lcd_en=1;

//enable the lcd to execute data

delay(3);
lcd_en=0;
lcd_data=((value<<4)&(0xf0)); //send lsb 4 bits
lcd_rs=1;

//select data register

lcd_en=1;

//enable the lcd to execute data

delay(3);
lcd_en=0;

delay(3);
}

void msgdisplay(unsigned char b[]) // send string to lcd


{
unsigned char s,count=0;
for(s=0;b[s]!='\0';s++)
{
count++;
if(s==16)
lcdcmd(0xc0);

if(s==32)
{ lcdcmd(1
); count=0;
}
lcddata(b[s]);
}
}

unsigned char receive()


{
unsigned char rx;
while(RI == 0);
rx=SBUF;
RI=0;
return rx;
}

void tx(unsigned char *tx)


{
//

unsigned char v;
for(;*tx != '\0';tx++)
{
SBUF=*tx;
while(TI == 0);
TI=0;
//v= receive();

//delay(2);

}
}

void tx1(unsigned char tx)


{
//

unsigned char v;
SBUF=tx;
while(TI == 0);
TI=0;
// v= receive();
//

delay(2);

void okcheck()
{

unsigned char rt;


do{
rt = receive();
}while(rt != 'K');

void sie()
{
// ET0 = 0;
ES

= 1;

EA

= 1;

/* allow serial interrupts */

void sid()
{
// ET0 = 1;
ES

= 0;

EA

= 0;

/* allow serial interrupts */

void slow()
{
relay2=0;relay3=0;delay(450);
}

void speed()
{
relay2=1;relay3=0;delay(450);
}

void stop()
{
relay2=1;relay3=1;delay(450);
}

void gsmmode()
{

relay=0;delay(500);
}

void gpsmode()
{
relay=1;delay(500);
}
void lcdbasic()
{
lcdcmd(1);msgdisplay("Vib: OFF");
}

void main(void)
{
unsigned char sws='x';

relay=0;
sw=1; therm=1;
voice=1;
relay1=relay2=relay3=0;
P2=0xff;
lcd_init();
//VEHICLE MONITORING AND TRACKING SYSTEM USING GPS
AND GSM
msgdisplay("Vehicle Monitoring"); //83
lcdcmd(0xc0);

msgdisplay("Tracking GSM-GPS");
stop();relay1=0;

TMOD=0x20;
TH1=0xfd; //9600
SCON=0x50;
TR1=1;

tx("AT\r\n");okcheck();
tx("ATE0\r\n");okcheck();
tx("AT+CMGF=1\r\n");okcheck();
tx("AT+CNMI=1,2,0,0\r\n");okcheck();

lcdcmd(0x01);
msgdisplay("SEND A MSG TO

STORE MOBILE NUM");

do{
rcg=receive();
}while(rcg != '+');

for(count=0;count<9;count++)
{
rcg=receive();
}

for(count=0;count<10;count++)
{
pastnumber[count]=receive();
} lcdcmd(0x01);
msgdisplay(pastnumber);

tx("AT+CMGS=\"");
tx(pastnumber);
tx("\"\r\n");
do{
rcg = receive();
}while(rcg != '>');
tx("Mobile no. registered\r\n");
tx1(0x1A);
okcheck();

lcdcmd(0x01);
msgdisplay("MOBILE NUMBER REGISTERED");
delay(3000);

//

loop:
//lcdbasic();
//

lcdcmd(1);msgdisplay("Emergency:");//085,8,9
gpsmode();

while(1)
{

if(sw == 0)
{

sws='s';

speed();

relay2=1;

lcdcmd(1);
msgdisplay("Loacked coordinators");
gpssignalgain();
delay(600);
strcpy(msga,msg1);
strcpy(msgb,msg2);

lcdcmd(1);

msgdisplay(msga);

lcdcmd(0xc0);msgdisplay(msgb);
delay(600); //while(1);
}

if(sws == 's')
{

//

slow();

relay2=0;

gpssignalgain();
lcdcmd(1);msgdisplay(msg1);
lcdcmd(0xc0);msgdisplay(msg2);
delay(600);
if((msg1[5] != msga[5]) ||msg1[6] != msga[6] || (msg2[6] != msgb[6]) ||msg2[7] !=
msgb[7])
{
lcdcmd(1);msgdisplay("Coordinates Varying");

slow();

relay1=0;
relay2=1;

tx("AT+CMGS=\"");
tx(pastnumber);
tx("\"\r\n"); delay(450);
tx("Vehicle Theft@");tx(msg1);tx(" long:");tx(msg2);
tx1(0x1A); delay(1000);

tx("AT+CMGS=\"");
tx(pastnumber);
tx("\"\r\n"); delay(450);
tx("School Zone@");tx(msg1);tx(" long:");tx(msg2);
tx1(0x1A); delay(700);
voice1=0;delay(900);voice1=1;
}

}
if(therm == 0)
{

lcdcmd(1);msgdisplay("High Temp");
voice=0;delay(900);//voice=1;

tx("AT+CMGS=\"");
tx(pastnumber);

tx("\"\r\n"); delay(450);
tx("High temp@");tx(msg1);tx(" long:");tx(msg2);
tx1(0x1A); delay(500);
}

/* lcdcmd(0xc0);msgdisplay("ON ");

gpsmode();gpssignalgain();gsmmode();
lcdcmd(1);msgdisplay(msg1);lcdcmd(0xc0);msgdisplay(msg2);
tx("AT+CMGS=\"");
tx(pastnumber);
tx("\"\r\n");
do{
rcg = receive();
}while(rcg != '>');
tx("Emergency Alert @ lat:");tx(msg1);tx(" long:");tx(msg2);
tx1(0x1A);
okcheck();

lcdcmd(1); msgdisplay(msg1); lcdcmd(0xc0);msgdisplay(msg2);


delay(1500);
goto loop;

}
// else
if(sw == 1)
{

//lcdcmd(0x85);msgdisplay("OFF");
lcdcmd(0xc0);msgdisplay("OFF
while(sw == 1);
}

*/

}
}

unsigned convert(unsigned int value)


{
unsigned int a,b,c,d,e,f,g,h;

a=value/10000;
b=value%10000;
c=b/1000; d=b
%1000; e=d/100;
f=d%100;
g=f/10;
h=f%10;

a=a|0x30;
c=c|0x30;
e=e|0x30;
g=g|0x30;
h=h|0x30;

");

lcddata(a);
lcddata(c);
lcddata(e); lcddata(g);lcddata(h);//lcddata(' ');lcddata(' ');

return 1;
}

unsigned convert1(unsigned int value)


{
unsigned int a,b,c,d,e,f,g,h;

a=value/10000;
b=value%10000;
c=b/1000; d=b
%1000; e=d/100;
f=d%100;
g=f/10;
h=f%10;

a=a|0x30;
c=c|0x30;
e=e|0x30;
g=g|0x30;

h=h|0x30;

tx1(a);
tx1(c);
tx1(e); tx1(g);tx1(h);//lcddata(' ');lcddata(' ');

return 1;
}

void gpssignalgain()
{
ag:
for(q=0;q<10;q++)
msg1[q] = '\0';

for(q=0;q<11;q++)
msg2[q] = '\0';
do{
rcv=receive();
}while(rcv != '$');

rcv1=receive();
rcv2=receive();

rcv3=receive();
rcv4=receive();
rcv5=receive();

if((rcv1 == 'G') && (rcv2 == 'P') && (rcv3 == 'G') && (rcv4 == 'G') && (rcv5 == 'A'))
{

for(r=0;r<12;r++)

//14

{
rcv=receive();
}

for(r=0;r<9;r++)
{
msg1[r]=receive();

//lat

}
rcv=receive(); rcv=receive(); rcv=receive();
for(r=0;r<10;r++)
{
msg2[r]=receive();

//long

}
rcv=receive(); rcv=receive(); rcv=receive();
ql=receive();

for(r=0;r<8;r++)
{

rcv=receive();
}

}
else
{
goto ag;
}

void serial_int (void) interrupt 4


{

if (RI == 1)
{
chr = SBUF;
RI = 0;
if(chr == '+')
{
for(count=0;count<9;count++)
{
rcg=receive();
}

for(count=0;count<10;count++)
{

pastnumber1[count]=receive();
}

for(count=0;count<29;count++)
{
rcg=receive();
}

chr1 = receive();
}
}
}

REFERENCES
1. B Webb Steering Column Locks and Motor Vehicle Theft: Evaluations From Three Countries
Situational crime prevention: Successful case studies, 1997

2. Shang-Hung Lin, An Introduction to Face Recognition Technology, Informing Science special


issue on multimedia Informing technology-Part 2, volume 3, No 1,2000

3. Jian Yang, David Zhang, Alejandro F. Frangi, and Jing-yu Yang Two-Dimensional PCA: A New
Approach to Appearance-Based Face Representation and RecognitionIEEE Transactions on Pattern
Analysis and Machine Intelligence, Vol. 26, no. 1, January 2004

4. Pang-Chieh Wang, Ting-Wei Hou, Jung-Hsuan Wu, and Bo-Chiuan Chen A Security Module
for Car Appliances International Journal of Aerospace and Mechanical Engineering 2007

5. H Song, S Zhu, G Cao SVATS: A Sensor network based Vehicle INFOCOM The 27th
Conference on Computer Communications. 2008

6. Lili Wan, Tiejun Chen Automobile Anti-theft System Design based on GSM International
Conference on Advanced Computer Control 2008

7. H Guo, HS Cheng, YD Wu, JJ Ang An Automotive Security System for Anti-Theft "
International Conference on networks 2009

8. Montaser N. Ramadan, Mohammad A. Al-Khedher, and Sharaf A. Al-Khede Intelligent


Anti-Theft and Tracking System for Automobiles International Journal Machine Learning and
Computing, Vol. 2, No. 1, February 2012

9. Varsha Goud, V.Padmaja, Vehicle Accident Automatic Detection and Remote Alarm Device
International Journal of Reconfigurable and Embedded Systems (IJRES ) Vol. 1, No. 2, July 2012

10. Faizan Ahmad, Aaima Najam and Zeeshan Ahmed Image-based Face Detection and
Recognition State of the Art IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 6,
No 1, November 2012

11. D.Narendar Singh, K.Tejaswi, Real Time Vehicle Theft Identity and Control System Based on
ARM 9 International Journal of Latest Trends in Engineering an Technology (IJLTET),Vol. 2 ,Issue
1, January 2013

12. Arun Sasi, Lakshmi Nair Vehicle Anti-theft System Based on an Embedded Platform IJRET
Volume: 02 Issue: 09 Sep-2013

13. Maminul Islam, Rabiul Hasan, Imran Chowdhury, Towhid Chowdhury Internet of Car:
Accident Sensing, Indication and Safety with Alert system American Journal of Engineering
Research (AJER) Volume-02, 2013

You might also like