Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

GSM Based Security

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 43

GPS-GSM Based Security Alert System for Vehicle

CHAPTER 1
INTRODUCTION

GPS-GSM Based Security Alert System for Vehicle


1.1 Introduction:
In this Project it is proposed to design an embedded system which is used to find out the location
of any vehicle by using Global Positioning System (GPS) and Global system for mobile
communication (GSM). In this project 8051 microcontroller is used for interfacing to various
hardware peripherals. The current design is an embedded application, which will find out the
location of any vehicle and then send it to some particular mobile phones number through SMS,
whenever a situation of emergency occurs i.e. either an accident takes place or when the person
gets trapped.

1.2 Project Overview:


In this system we have used an 8051 microcontroller is interfaced serially to a GSM Modem and
GPS Receiver. A GSM modem is used to send the position (Latitude and Longitude) of the
vehicle from a remote place. The GPS modem will continuously give the data i.e. the latitude and
longitude indicating the position of the vehicle. The GPS modem gives many parameters as the
output, but only the NMEA data coming out is read and displayed on to the LCD. The same data
is sent to the mobile at the other end, where the location is to be shown in case of emergency.
The hardware interfaces to microcontroller are LCD display, GSM modem and GPS Receiver.
The design uses RS-232 protocol for serial communication between the modems and the
microcontroller.

When a condition of emergency occurs, i.e either the switch is pressed

manually or the pizeo sensor, senses vibration of high intensity, the system automatically sends a
message to those particular mobile numbers which are previously fed by the user, indicating the
position of the vehicle in terms of latitude and longitude. When the receiver enters that latitude
and longitude on Google Map, the exact location of the vehicle can be determined and also the
path to reach there.

1.3 Proposed System:


2

GPS-GSM Based Security Alert System for Vehicle


The proposed system is used for determining location of the vehicle with an accuracy of 10-20
m. The Exact location is indicated in the form of latitude and longitude along with the exact
Navigated track on Google map. The system tracks the location of particular vehicle and sends to
some mobile in form of data and also to microcontroller. The arrived data, in the form of latitude
and longitude is used to locate the Vehicle on the Google maps and also we can see the output on
the LCD.

1.4 Advantage of this system:


Immediate medication can be provided to the accident victims in remote areas.

1.5 Disadvantage of this system:


At some places where is no provision of GSM network it becomes difficult to communicate.

1.6 Working Principle:


The project consists of GPS receiver and GSM modem with a micro controller, along with a
LCD display. The whole system is attached to the vehicle. Some mobile numbers are to be fed
initially by the user on which the message of the location of the vehicle in case of emergency. So
the GPS system will send the longitudinal and altitude values corresponding to the position of
vehicle to microcontroller, then microcontroller provides this data to the GSM Modem. Through
which that data is sent to the mobile number given by the user. When the received value of

PowerMap
Supply
latitude and longitude is copied on Google
the location of the vehicle and path is obtained.

Switch

GPS
Micro controller
GSM

Vibration
Sensor
3

GPS-GSM Based Security Alert System for Vehicle

Fig 1.1 System block diagram

1.7 Layout of report:


1.7.1 Chapter 2:
This chapter we have briefly explained about the problems which used to occur generally and
how this system helps to overcome such situations. It also shows that what survey we have done
and how we got idea to work for this system.
1.7.2 Chapter 3:
This chapter contains details about what all components we have used and what is their
significance in our work.
1.7.3 Chapter 4:
In this chapter the programming and simulation is given, and what results the system gives is
shown.
1.7.4 Chapter 5:
This chapter shows that what conclusion we have drawn from our work and its future scope.

GPS-GSM Based Security Alert System for Vehicle

CHAPTER 2
Literature Survey and Problem Formulation

2.1 Survey about the problem:

GPS-GSM Based Security Alert System for Vehicle


Road accidents constitute the major part of the accident deaths all over the world. According to
the Insurance Institute for Highway Safety (IIHS), new cars and its high-tech safety features
have helped to lessen auto related deaths over the past 12 years. Though it credits technology for
lessening auto accidents, yet the IIHS cannot help accusing bad driving behavior like drunken
driving, speeding and not using seatbelts for still causing major traffic deaths. [1]
When some accident takes place, it became very difficult to know that an accident has occurred
and to locate the position where it has happened. Its very difficult for the lives of victims until
anyone noticed and informed it to the ambulance or to any hospital or to the police and if it
occurs in remote areas there will be no hope to survive.
Another emergency occurs when a person has gone out from his/her place and if in case gets
trapped by robbers or kidnapper at some unknown place, then it becomes very difficult to
overcome from that kind of situation. In this kind of situation getting help or informing anyone is
the most difficult task.
So from all these things we come to know that finding the spot or place where the accident has
been occurred or where a person got trapped, and then to inform that exact spot to respective
contact numbers as early as possible.
Hence we have taken this task as the main purpose of our project, i.e. GPS-GSM BASED
SECURITY ALERT SYSTEM FOR VEHICLE. This is an embedded intelligence implanted
into the automobile, which provide security to the vehicle in very reasonable cost.
For this purpose we have used basic microcontroller AT89S51 which is cost effective and also
easy to understand, along with GSM and GPS technologies. A vibration sensor is also
implemented in this system, when an accident occurs the vibration sensor gives the signal to the
microcontroller. So if any accident takes place this vibration sensor will inform the
microcontroller that there is some emergency. Apart from this a manually operated digital switch
is also present. If a person gets trapped then the only thing he have to do is to press that switch,
as soon as the switch is pressed the microcontroller will understand that there is an emergency.

GPS-GSM Based Security Alert System for Vehicle

Once when the microcontroller comes to know about an emergency either through vibration
sensor or from the switch, it takes information from the GPS receiver, which is used to trace the
vehicle anywhere on the globe. Now when the location is identified, then it is sent to our remote
devices (mobile phones) using GSM modem. The information which is sent to the remote
devices (mobile phones) is in the form of latitude and longitude, now when the receiver copies
that value of latitude and longitude on the Google Map the exact location is obtained. [2][3]

2.2 Survey about the components:


2.2.1 History of GSM:
During the early 1980s, analog cellular telephone systems were experiencing rapid growth in
Europe, particularly in Scandinavia and the United Kingdom, but also in France and Germany.
Each country developed its own system, which was incompatible with everyone else's in
equipment and operation. This was an undesirable situation, because not only was the mobile
equipment limited to operation within national boundaries, which in a unified Europe were
increasingly unimportant, but there was also a very limited market for each type of equipment, so
economies of scale and the subsequent savings could not be realized.
The Europeans realized this early on, and in 1982 the Conference of European Posts and
Telegraphs (CEPT) formed a study group called the Groupe Spcial Mobile (GSM) to study and
develop a pan-European public land mobile system. The proposed system had to meet certain
criteria:
1) Good subjective speech quality
2) Low terminal and service cost
3) Support for international roaming
4) Ability to support handheld terminals
5) Support for range of new services and facilities
6) Spectral efficiency
In 1989, GSM responsibility was transferred to the European Telecommunication Standards
Institute (ETSI), and phase I of the GSM specifications were published in 1990. Commercial
service was started in mid-1991, and by 1993 there were 36 GSM networks in 22 countries.

GPS-GSM Based Security Alert System for Vehicle


Although standardized in Europe, GSM is not only a European standard. Over 200 GSM
networks (including DCS1800 and PCS1900) are operational in 110 countries around the world.
In the beginning of 1994, there were 1.3 million subscribers worldwide, which had grown to
more than 55 million by October 1997. With North America making a delayed entry into the
GSM field with a derivative of GSM called PCS1900, GSM systems exist on every continent,
and the acronym GSM now aptly stands for Global System for Mobile communications.
The developers of GSM chose an unproven (at the time) digital system, as opposed to the thenstandard analog cellular systems like AMPS in the United States and TACS in the United
Kingdom. They had faith that advancements in compression algorithms and digital signal
processors would allow the fulfillment of the original criteria and the continual improvement of
the system in terms of quality and cost. The over 8000 pages of GSM recommendations try to
allow flexibility and competitive innovation among suppliers, but provide enough
standardization to guarantee proper interworking between the components of the system. This is
done by providing functional and interface descriptions for each of the functional entities defined
in the system. [4][5]
2.2.2 Services provided by GSM:
From the beginning, the planners of GSM wanted ISDN compatibility in terms of the services
offered and the control signaling used. However, radio transmission limitations, in terms of
bandwidth and cost, do not allow the standard ISDN B-channel bit rate of 64 kbps to be
practically achieved.
Using the ITU-T definitions, telecommunication services can be divided into bearer services,
teleservices, and supplementary services. The most basic teleservice supported by GSM is
telephony. As with all other communications, speech is digitally encoded and transmitted through
the GSM network as a digital stream. There is also an emergency service, where the nearest
emergency-service provider is notified by dialing three digits (similar to 911).
A variety of data services is offered. GSM users can send and receive data, at rates up to 9600
bps, to users on POTS (Plain Old Telephone Service), ISDN, Packet Switched Public Data
Networks, and Circuit Switched Public Data Networks using a variety of access methods and

GPS-GSM Based Security Alert System for Vehicle


protocols, such as X.25 or X.32. Since GSM is a digital network, a modem is not required
between the user and GSM network, although an audio modem is required inside the GSM
network to interwork with POTS.
Other data services include Group 3 facsimile, as described in ITU-T recommendation T.30,
which is supported by use of an appropriate fax adaptor. A unique feature of GSM, not found in
older analog systems, is the Short Message Service (SMS). SMS is a bidirectional service for
short alphanumeric (up to 160 bytes) messages. Messages are transported in a store-and-forward
fashion. For point-to-point SMS, a message can be sent to another subscriber to the service, and
an acknowledgement of receipt is provided to the sender. SMS can also be used in a cellbroadcast mode, for sending messages such as traffic updates or news updates. Messages can
also be stored in the SIM card for later retrieval.
Supplementary services are provided on top of teleservices or bearer services. In the current
(Phase I) specifications, they include several forms of call forward (such as call forwarding when
the mobile subscriber is unreachable by the network), and call barring of outgoing or incoming
calls, for example when roaming in another country. Many additional supplementary services
will be provided in the Phase 2 specifications, such as caller identification, call waiting, multiparty conversations. [4][5]
2.2.3 GPS Receivers:
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. Originally limited to four or five, this has progressively increased over the years
such that, as of 2006, receivers typically have between twelve and twenty channels.
Many GPS receivers can relay position data to a PC or other device using the NMEA 0183
protocol. NMEA 2000 is a newer and less widely adopted protocol. Both are proprietary and
controlled by the US-based National Marine Electronics Association. References to the NMEA
protocols have been compiled from public records, allowing open source tools like gpsd to read

GPS-GSM Based Security Alert System for Vehicle


the protocol without violating intellectual property laws. Other proprietary protocols exist as
well, such as the SiRF protocol. Receivers can interface with other devices using methods
including a serial connection, USB or Bluetooth. [4][5]
2.2.4

Frequencies used by GPS :

1) L1 (1575.42 MHz)-: Mix of Navigation Message, coarse-acquisition (C/A) code and


encrypted precision P(Y) code.
2) L2 (1227.60 MHz)-: P(Y) code, and a second C/A code on the Block II-R and newer
satellites.
3) L3 (1381.05 MHz)-: Used by the Defense Support Program to signal detection

of

missile launches, nuclear detonations, and other high-energy infrared events.


4) L4 (1841.40 MHz)-: Being studied for additional ionospheric correction.
5)

L5 (1176.45 MHz)-: Proposed for use as a civilian safety-of-life (SoL) signal. This
frequency falls into an internationally protected range for aeronautical navigation,
promising little or no interference under all circumstances. The first Block IIF satellite
that would provide this signal is set to be launched in 2008. [4][5]

2.2.5 Accuracy Of GPS Receiver:


The accuracy of a position determined with GPS depends on the type of receiver. Most hand-held
GPS units have about 10-20 meter accuracy. Other types of receivers use a method called
Differential GPS (DGPS) to obtain much higher accuracy. DGPS requires an additional receiver
fixed at a known location nearby. Observations made by the stationary receiver are used to
correct positions recorded by the roving units producing an accuracy greater than 1meter. When
the system was created, timing errors were inserted into GPS transmissions to limit the accuracy
of non-military GPS receivers to about 100 meters. This part of GPS operations called Selective
Availability, was eliminated in May 2000. [4][5]

10

GPS-GSM Based Security Alert System for Vehicle

CHAPTER 3
Relevant to Project

3.1 EMBEDDED SYSTEM:


An electronic device with a programmable component which is not easily accessible to user is
called Embedded System. Today, Embedded Systems are a part of human lives. We are
surrounded and being helped by this embedded systems in our day to day activities. Fields where

11

GPS-GSM Based Security Alert System for Vehicle


embedded systems are being used are Mobile communication, mobile computing devices, home
appliances, music Systems, automobiles etc.

Often the terms microcontroller and microprocessor are confusing. A microcontroller is actually
has more features than microprocessors. Besides the processor it also has I/O ports, internal
timers/counters, internal RAM and ROM. Microcontrollers are programmed using assembly and
high level languages. Assembly languages are controller specific and machine friendly but the
program written in assembly languages are quite lengthy. At the same time, high level languages
such as C and Java are also being used to program microcontrollers. High level languages are
user friendly and eliminate redundancy from the programs written in assembly languages.
Despite its relatively old age, the 8051 is one of the most popular microcontrollers in use today.
Many derivative microcontrollers have since been developed that are based on--and compatible
with--the 8051. Thus, the ability to program an 8051 is an important skill for anyone who plans
to develop products that will take advantage of microcontrollers. The 8051 has three very general
types of memory. To effectively program the 8051 it is necessary to have a basic understanding
of these memory types.
3.1.1 Properties of the embedded system:
1) Event driven system
2) Microcontroller/ microprocessor based
3) Application specific
4) Closed system
5) Battery operated
6) Portable

3.1.2 Types of Embedded System:


1) SMALL SCALE: 8 to 16 bit micro processor or micro controllers are used in this
category. Programming languages used are Assembly and C.
2) LARGE SCALE: 32 to 64 bit micro processor or micro controllers are used in this
category. Programming languages used are Assembly, C, J2ME and VC++.

12

GPS-GSM Based Security Alert System for Vehicle


3) SOPHISTICATED: 32 to 64 bit micro processor or micro controllers are used in this
category. It is supported by RTOS (Real Time Operating System).

3.2 About Keil:


3.2.1 Vision3 Overview:
The Vision3 IDE is a Windows-based software development platform that combines a robust
editor, project manager, and make facility. Vision3 integrates all tools including the C compiler,
macro assembler, linker/locator, and HEX file generator. Vision3 helps expedite the
development process of your embedded applications by providing the following:
1) Full-featured source code editor.
2) Device database for configuring the development tool setting.
3) Project manager for creating and maintaining your projects.
4) Integrated make facility for assembling, compiling, and linking your embedded
applications.
5) Dialogs for all development tool settings.
6) True integrated source-level Debugger with high-speed CPU and peripheral simulator.
7) Advanced GDI interface for software debugging in the target hardware and for
connection to Keil ULINK.
8) Flash programming utility for downloading the application program into Flash ROM.
9) Links to development tools manuals, device datasheets & users guides.
The Vision3 IDE offers numerous features and advantages that help you quickly and
successfully develop embedded applications. They are easy to use and are guaranteed to help you
achieve your design goals.
The Vision3 IDE and Debugger is the central part of the Keil development toolchain. Vision3
offers a Build Mode and a Debug Mode.
In the Vision3 Build Mode you maintain the project files and generate the application.
In the Vision3 Debug Mode you verify your program either with a powerful CPU and
peripheral simulator or with the Keil ULINK USB-JTAG Adapter (or other AGDI drivers) that
connect the debugger to the target system. The ULINK allows you also to download your
application into Flash ROM of your target system.

13

GPS-GSM Based Security Alert System for Vehicle

Feature

Benefit

The Vision3 Simulator is the only


Write and test application code before production
debugger that completely simulates all on- hardware is available. Investigate different hardware
chip peripherals.
configurations to optimize the hardware design.
Simulation capabilities may be expanded
using the Advanced Simulation Interface
(AGSI).

Sophisticated systems can be accurately simulated by


adding your own peripheral drivers.

The Code Coverage feature of the Vision3 Safety-critical systems can be thoroughly tested and
Simulator provides statistical analysis of
validated. Execution analysis reports can be viewed
your programs execution.
and printed for certification requirements.
The Vision3 Device Database
automatically configures the development
tools for the target microcontroller.

Mistakes in tool settings are practically eliminated and


tool configuration time is minimized.

The Vision3 IDE integrates additional


third-party tools like VCS, CASE, and
FLASH/Device Programming.

Quickly access development tools and third-party


tools. All configuration details are saved in the
Vision3 project.

The ULINK USB-JTAG Adapter supports


both Debugging and Flash programming
with configurable algorithm files.

The same tool can be used for debugging and


programming. No extra configuration time required.

Identical Target Debugger and Simulator


User Interface.

Shortens your learning curve.

Vision3 incorporates project manager,


editor, and debugger in a single
environment.

Accelerates application development. While editing,


you may configure debugger features. While
debugging, you may make source code modifications.

Table 3.1 Features and Benefits of Keil


The following block diagram illustrates the complete Vision/ARM software development cycle.
Each component is described below-:

14

GPS-GSM Based Security Alert System for Vehicle

Fig 3.1 Block Diagram for Keil Vision

3.3 Power supply:

15

GPS-GSM Based Security Alert System for Vehicle


The microcontroller and other devices get power supply from AC to Dc adapter through voltage
regulator. The adapter output voltage will be 12V DC non-regulated. The 7805 voltage regulators
are used to convert 12 V to 5VDC.

AC Power

AC/DC
Adapter

Regulator
(7805)

Filter
DC Output

Fig 3.2 Block diagram of power supply


3.3.1 Voltage Regulator (7805):
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output
voltages. They are also rated by the maximum current they can pass. Negative voltage regulators
are available, mainly for use in dual supplies. Most regulators include some automatic protection
from excessive current ('overload protection') and overheating ('thermal protection'). Many of the
fixed voltage regulator ICs have 3 leads and look like power transistors, such as the 7805 +5V
1A regulator shown on the right. They include a hole for attaching a heatsink if necessary.

Fig 3.3 Voltage regulator 7805


3.3.2 Features:
1) Internal thermal overload protection

16

GPS-GSM Based Security Alert System for Vehicle


2) No external components required
3) Output transistor safe area protection
4) Internal short circuit current limit
3.3.3 Voltage:
1) 7805..5V
2) 7812.12V
3) 7815.15V
3.3.4 Vital role of power supply in GPS-GSM based security alert system for vehicle:
The adapter output voltage will be 12V DC non-regulated. The 7805 voltage regulator is used to
convert 12 V to 5V DC. This will be a pulsated DC, so a capacitor is used which convert the
output from 7805 into pure DC of 5V.

17

GPS-GSM Based Security Alert System for Vehicle


3.4 Microcontroller:
The AT89C52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of
in-system programmable Flash memory. The device is manufactured using Atmels high-density
Non-volatile memory technology and is compatible with the industry- standard 80C51
instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed
in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit
CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89C52 is a
powerful microcontroller which provides a highly-flexible and cost-effective solution to many
embedded control applications. The AT89C52 provides the following standard features: 8K bytes
of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit
timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip
oscillator, and clock circuitry. In addition, the AT89C52 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 interrupt or hardware reset.

18

GPS-GSM Based Security Alert System for Vehicle

Fig 3.4 Pin Diagram of 8051


3.4.1 Features:
1) 8K Bytes of In-System Programmable (ISP) Flash Memory
2) Endurance: 1000 Write/Erase Cycles
3) 4.0V to 5.5V Operating Range
4) 256 x 8-bit Internal RAM
5) 32 Programmable I/O Lines
6) Full Duplex UART Serial Channel
7) Fully Static Operation: 0 Hz to 33 MHz
3.4.2 Vital role of Microcontroller-AT89C52 in GPS-GSM based security alert system for
vehicle:

19

GPS-GSM Based Security Alert System for Vehicle


The microcontroller will receive the acknowledgement (handshaking) signals from GSM, takes
data from the GPS receiver and also takes the signal given from the sensor and switch.

3.5 Liquid Crystal Display (LCD):


LCDs can add a lot to your application in terms of providing an useful interface for the user,
debugging an application or just giving it a "professional" look. The most common type of LCD
controller is the Hitatchi 44780, which provides a relatively simple interface between a processor

Fig 3.5 Pin diagram of LCD


and an LCD. Inexperienced designers do often not attempt using this interface and programmers
because it is difficult to find good documentation on the interface, initializing the interface can
be a problem and the displays themselves are expensive. LCD has single line display, Two-line
display, four line display. Every line has 16 characters.
The 2 line x 16 character LCD modules are available from a wide range of manufacturers. LCDs
have become very popular over recent years for information display in many smart appliances.
They are usually controlled by microcontrollers. They make complicated equipment easier to
operate.

20

GPS-GSM Based Security Alert System for Vehicle

LCDs come in many shapes and sizes but the most common is the 16 character x 2 line display
with no back light. It requires only 11 connections eight bits for data (which can be reduced to
four if necessary) and three control lines (we have only used two here). It runs off a 5V DC
supply and only needs about 1mA of current. The display contrast can be varied by changing the
voltage into pin 3 of the display, usually with a trimpot.

3.5.1 Vital role of LCD in GPS-GSM based security alert system for vehicle:
It is used to display the corresponding action in written form.

3.6 GSM modem (900/1800 MHz):


Semens GSM/GPRS Smart Modem is a multi-functional, ready to use, rugged unit that can be
embedded or plugged into any application. The Smart Modem can be controlled and customized
to various levels by using the standard AT commands. The modem is fully type-approved, it can
speed up the operational time with full range of Voice, Data, Fax and Short Messages (Point to
Point and Cell Broadcast), the modem also supports GPRS (Class 2*) for spontaneous data.

Fig 3.6 GSM Module


3.6.1 Description of the interfaces:
The modem comprises several interfaces-:
1) LED Function including operating Status
2) External antenna (via SMA)

21

GPS-GSM Based Security Alert System for Vehicle


3) Serial and control link
4) Power Supply (Via 2 pin Phoenix tm contact)
5) SIM card holder
3.6.2 LED Status Indicator:
The LED will indicate different status of the modem-:
1) OFF

Modem Switched off

2) ON

Modem is connecting to the network

3) Flashing Slowly

Modem is in idle mode

4) Flashing rapidly

Modem is in transmission/communication (GSM only)

3.6.3 AT Commands Used:


SIM Insertion, SIM Removal-:
SIM card Insertion and Removal procedures are supported. There are software functions relying
on positive reading of the hardware SIM detect pin. This pin state (open/closed) ispermanently
monitored.When the SIM detect pin indicates that a card is present in the SIM connector, the
product tries to set up a logical SIM session. The logical SIM session will be set up or not
depending on whether the detected card is a SIM Card or not.
Delivers the following responses-:
If the SIM detect pin indicates absent, the response to AT+CPIN? is +CME ERROR 10
(SIM not inserted).
If the SIM detect pin indicates present, and the inserted Card is a SIM Card, the

response to

AT+CPIN? is +CPIN: xxx depending on SIM PIN state.


If the SIM detect pin indicates present, and the inserted Card is not a SIM Card, the response
to AT+CPIN? is CME ERROR 10.
These last two states are not given immediately due to background initialization. Between the
hardware SIM detect pin indicating present and the previous results the AT+CPIN? sends
+CME ERROR: 515 (Please wait, init in progress).

22

GPS-GSM Based Security Alert System for Vehicle


When the SIM detect pin indicates card absence, and if a SIM Card was previously inserted, an
IMSI detach procedure is performed, all user data is removed from the product (Phonebooks,
SMS etc.). The product then switches to emergency mode.
3.6.4 Preferred Message Format +CMGF:
Description-:
The message formats supported are text mode and PDU mode.In PDU mode, a complete SMS
Message including all header information is given as a binary string (in hexadecimal format).
Therefore, only the following set of characters is allowed: {0,1,2,3,4,5,6,7,8,9,
A, B,C,D,E,F}. Each pair or character is converted to a byte (e.g.: 41 is converted to
the ASCII character A, whose ASCII code is0x41 or 65). In Text mode, all commands and
responses are in ASCII characters.
Syntax:
Command Syntax: AT+CMGF
COMMAND
AT+CMGF=0

POSSIBLE RESPONSES
OK

Set PDU mode


AT+CMGF=1

OK

Set TEXT mode


3.6.5 Send message +CMGS:
Description-:
The <address> field is the address of the terminal to which the message is sent. To send the
message, simply type, <ctrl-Z> character (ASCII 26). The text can contain all existing characters
except <ctrl-Z> and <ESC> (ASCII 27).
This command can be aborted using the <ESC> character when entering text.
In PDU mode, only hexadecimal characters are used (09,AF).
Syntax:

23

GPS-GSM Based Security Alert System for Vehicle


Command syntax in text mode:
AT+CMGS= <da> [ ,<toda> ] <CR>
text is entered <ctrl-Z / ESC >
COMMAND
AT+CMGS=+33146290800<CR>
Please call me soon, Fred. <ctrl-Z>
Note: Send a message in text mode

POSSIBLE RESPONSES
+CMGS: <mr>
OK
Note: Successful transmission

The message reference, <mr>, which is returned to the application is allocated by the product.
This number begins with 0 and is incremented by one for each outgoing message(successful and
failure cases); it is cyclic on one byte (0 follows 255).
3.6.6 Vital role of GSM MODEM in GPS-GSM based security alert system for vehicle:
It is used to transmit SMS containing information i.e. latitude and longitude of the location.

3.7 GPS RECEIVER:


The fully autonomous receiver provides high position and speed accuracy performances as well
as high sensitivity and tracking capabilities in urban conditions. The solutions enable small form
factor devices. The deliver major advancements in GPS performances, accuracy, integration,
computing power and flexibility. They are designed to simplify the embedded system integration
process. The NMEA commands used for controlling the basic ITRAX operations. The accuracy
of the receiver is 50 to 100 meters.
ITRAX02 receiver produces and interprets messages in accordance with the NMEA (National
Marine Electronics association) standard (its with licence).

24

GPS-GSM Based Security Alert System for Vehicle

Fig 3.7 GPS Module


3.7.1 Applications:
1) Car navigation
2) Fleet management/tracking
3) Location Based Services enabled devices
The Global Positioning System (GPS), is the only fully-functional satellite navigation system.
More than two dozen GPS satellites orbit the Earth, transmitting radio signals which allow GPS
receivers to determine their location, speed and direction. GPS has become indispensable for
navigation around the world and an important tool for map-making and synchronization of
telecommunications networks.

25

GPS-GSM Based Security Alert System for Vehicle

Fig 3.8 Satellite


3.7.2 How it works - simple introduction:
A GPS receiver calculates its position by measuring the distance between itself and three or more
GPS satellites. Measuring the time delay between transmission and reception of each GPS radio
signal gives the distance to each satellite, since the signal travels at a known speed. The signals
also carry information about the satellites' location. By determining the position of, and distance
to, at least three satellites, the receiver can compute its location using tri-lateration. Receivers do
not have perfectly accurate clocks, and must track one extra satellite to correct their clock error.
3.7.3 Technical Description:
Satellites and Ground Control-:
The GPS design calls for 24 satellites to be distributed equally among six circular orbital planes
with 55 declination (tilt relative to the equator) and separated by 60 right ascension (angle
along the equator). Orbiting at an altitude of 10,988 nautical miles (approximately 20,200
kilometers or 12,600 statute miles), each satellite passes over the same location on Earth twice a
day. The orbits are arranged so that at least four satellites are always within line of sight from
almost anywhere on Earth.
The satellites also broadcast two forms of clock information, the Coarse / Acquisition code, or
C/A which is freely available to the public, and the restricted Precise code, or P-code, usually

26

GPS-GSM Based Security Alert System for Vehicle


reserved for military applications. The C/A code is a 1,023 bit long pseudo-random code
broadcast at 1.023 MHz, repeating every millisecond. Each satellite sends a distinct C/A code,
which allows it to be uniquely identified. The P-code is a similar code broadcast at 10.23 MHz,
but it repeats only once a week. In normal operation, the so-called "anti-spoofing mode", the P
code is first encrypted into the Y-code, or P(Y), which can only be decrypted by units with a
valid decryption key.
3.7.4 General NMEA commands:
START Start Navigation-:
Commands iTrax to start navigation. The command has no effect if called while iTrax is already
navigating. After the start command has been given, it takes some time from iTrax to acquire
satellites, acquire required navigation data from the signal and calculate a first fix.
$PFST,START,<startmode>
Examples:
$PFST,START<CR><LF>
Starts navigation using the fastest possible start mode.
$PFST,START,2<CR><LF>
Starts navigation using warm start mode if possible.
STOP Stop Navigation-:
Commands iTrax to stop navigation and enter idle state. At idle state iTrax receiverdoesnt
navigate but still accepts commands. Idle state consumes less power than navigation state, but
remarkably more than in the power-down mode. This command also stores the
LastKnownGood fix, ephemeris and almanac data acquired during navigation to flash memory.

$PFST,STOP,<1|0>
NMEA MESSAGES:

27

GPS-GSM Based Security Alert System for Vehicle


This is one of the NMEA messages.
GGA Global Positioning System Fix Data
Time, position and fix related data for a GPS receiver.
$GPGGA,hhmmss.dd,xxmm.dddd,<N|S>,yyymm.dddd,<E|W>,v, ss,d.d,h.h
,M,g.g,M,a.a,xxxx*hh<CR><LF>

Table 3.2 GPS Data


Example:
$GPGGA,111200.02,6016.3092,N,02458.3841,E,1,09,0.8,30.6,M,18.1
,M,,*5D

28

GPS-GSM Based Security Alert System for Vehicle

3.7.5 Vital role of GPS RECEIVER in GPS-GSM based security alert system for vehicle:
It is used for finding the longitude and latitude values.

3.8 Vibration sensor:


The DFRobot Vibration Sensor buffers a piezoelectric transducer that responds to strain changes
by generating a measurable output voltage change which is proportional with the strength of
vibration.

Fig 3.9 Vibration Sensor

3.8.1 Specification:
1) Power supply: 5V
2) Interface: Analog

29

GPS-GSM Based Security Alert System for Vehicle

3.8.2 Vital role of Vibration sensor in GPS-GSM based security alert system for vehicle:
It detects that an accident had taken place by sensing vibrations, and then sends signal to the
microcontroller.

30

GPS-GSM Based Security Alert System for Vehicle

CHAPTER 4
Simulation, Result and Discussion

4.1 Coding:
#include<reg51.h>

31

GPS-GSM Based Security Alert System for Vehicle


sfr ldata = 0x80;
sbit rs = P2^5;
sbit rw = P2^6;
sbit en = P2^7;
sbit rx = P3^0;
sbit tx = P3^1;
sbit s1 = P1^0;
sbit s2 = P1^1;
sbit r1 = P2^0;
void disparray(unsigned char d[]);
void comdarray(unsigned char d[]);
void command(unsigned char);
void display(unsigned char);
void msdelay(unsigned int);
unsigned char code bcomm[]={0x38,0x0e,0x06,0x01,0x80,0x00};
unsigned char code da1[]={"GPS GSM BASED~"};
unsigned char code da2[]={"SECURITY ALERT~"};
unsigned char code da1A[]={"WELCOME TO~"};
unsigned char code da2A[]={"ACROPOLIS INDORE~"};
unsigned char code da1B[]={"~"};
unsigned char code da2B[]={"~"};
unsigned char code da3[]={"LT:~"};
unsigned char code da4[]={"LG:~"};
unsigned char code da5[]={"send~"};
unsigned char code da6[]={"AT"};
unsigned char code da7[]={"AT+CMGF=1"};
unsigned char code da8[]={"AT+CMGS="};
unsigned char code da9[]={"+919981823085"};
unsigned char code da10[]={"send"};
unsigned char da11[45];
// unsigned char da8[40];
void main(void)
{ unsigned char ALK;
comdarray(bcomm);
msdelay(10);

32

GPS-GSM Based Security Alert System for Vehicle


command(0x80);
msdelay(50);
disparray(da1);
msdelay(50);
command(0xC0);
msdelay(50);
disparray(da2);
msdelay(500);
command(0x01);
command(0x80);
msdelay(50);
disparray(da1A);
msdelay(50);
command(0xC0);
msdelay(50);
disparray(da2A);
msdelay(500);
command(0x01);
command(0x80);
msdelay(50);
disparray(da1B);
msdelay(50);
command(0xC0);
msdelay(50);
disparray(da2B);
msdelay(500);
command(0x01);
TMOD=0X20;
TH1=-3;
SCON=0X50;
TR1=1;
rx=tx=1;
command(0x80);
msdelay(50);
while(1)
{
unsigned int i=0,z=0;
s1=1;
s2=1;
r1=0;
while(!RI);

33

GPS-GSM Based Security Alert System for Vehicle


RI=0;
ALK=SBUF;
if(ALK=='R')
{
for(i=0;i<45;i++)
{
while(!RI);
RI=0;
da11[i]=SBUF;
}
command(0x80);
msdelay(50);
disparray(da3);
command(0x83);
for(i=16;i<28;i++)
{
display(da11[i]);
}
command(0xc0);
msdelay(50);
disparray(da4);
command(0xc3);
for(i=28;i<42;i++)
{
display(da11[i]);
}

if(s1==1)
{

r1=1;
for(z=0;z<2;z++)
{
SBUF=da6[z];
while(TI==0);

34

GPS-GSM Based Security Alert System for Vehicle


TI=0;
}
SBUF=0x0d;
while(TI==0);
TI=0;
msdelay(500);
for(z=0;z<9;z++)
{
SBUF=da7[z];
while(TI==0);
TI=0;
}
SBUF=0x0d;
while(TI==0);
TI=0;
msdelay(500);
for(z=0;z<8;z++)
{
SBUF=da8[z];
while(TI==0);
TI=0;
}
SBUF=0x22;
while(TI==0);
TI=0;
for(z=0;z<13;z++)
{
SBUF=da9[z];
while(TI==0);
TI=0;
msdelay(10);
}

SBUF=0x22;
while(TI==0);
TI=0;

35

GPS-GSM Based Security Alert System for Vehicle


SBUF=0x0d;
while(TI==0);
TI=0;
msdelay(500);
for(i=16;i<42;i++)
{
SBUF=da11[i];
while(TI==0);
TI=0;
msdelay(10);
}
SBUF=0x1a;
while(TI==0);
TI=0;
msdelay(50);
command(0x01);
msdelay(50);
command(0x80);
msdelay(50);
disparray(da10);
msdelay(500);
command(0x01);
}
if(s2==0)
{
r1=1;
for(z=0;z<2;z++)
{
SBUF=da6[z];
while(TI==0);
TI=0;
}
SBUF=0x0d;
while(TI==0);
TI=0;
msdelay(500);

for(z=0;z<9;z++)
{
SBUF=da7[z];
while(TI==0);
TI=0;

36

GPS-GSM Based Security Alert System for Vehicle


}
SBUF=0x0d;
while(TI==0);
TI=0;
msdelay(500);
for(z=0;z<8;z++)
{
SBUF=da8[z];
while(TI==0);
TI=0;
}
SBUF=0x22;
while(TI==0);
TI=0;
for(z=0;z<13;z++)
{
SBUF=da9[z];
while(TI==0);
TI=0;
msdelay(10);
}
SBUF=0x22;
while(TI==0);
TI=0;
SBUF=0x0d;
while(TI==0);
TI=0;
msdelay(500);
for(i=16;i<42;i++)
{
SBUF=da11[i];
while(TI==0);
TI=0;
msdelay(10);
}
SBUF=0x1a;
while(TI==0);

37

GPS-GSM Based Security Alert System for Vehicle


TI=0;
msdelay(50);
command(0x01);
msdelay(50);
command(0x80);
msdelay(50);
disparray(da10);
msdelay(500);
command(0x01);
}
}
}
}
void disparray(unsigned char d[])
{
unsigned char x=0;
while(d[x]!='~')
{
display(d[x]);
x++;
}
}
void comdarray(unsigned char d[])
{
unsigned char x=0;
while(d[x]!=0x00)
{
command(d[x]);
x++;
}
}
void command(unsigned char valu)
{
ldata =valu;
rs =0;
rw =0;
en =1;
msdelay(1);

38

GPS-GSM Based Security Alert System for Vehicle


en =0;
return;
}
void display(unsigned char valu)
{
ldata =valu;
rs =1;
rw =0;
en =1;
msdelay(1);
en =0;
return;
}
void msdelay(unsigned int value)
{
unsigned int i,j;
for(i=0;i<value;i++)
for(j=0;j<1275;j++);
}

4.2 Result:
Whenever the switch is pressed or the vibration sensor senses vibration then signal is sent to the
microcontroller. Then the microcontroller takes data coming from GPS receiver, and from those
data filter out the data containing latitude and longitude. This data is displayed on LCD and
given to GSM module from which it is sent to the remote location (mobile number). The receiver
gets the value of latitude and longitude,, when this value is copied on Google map the location of
vehicle is determined with the accuracy of 10-15m.

39

GPS-GSM Based Security Alert System for Vehicle

CHAPTER 5
Conclusion and Future Scope

5.1 CONCLUSION:
The Project titled GPS-GSM based security alert system for vehicle is a model for
determining the location of Vehicle with the help of Google maps and also with the help of GPS
receivers and GSM modem.

40

GPS-GSM Based Security Alert System for Vehicle


The system is used for determining the location of the vehicle with an accuracy of 10-15 m.
The positioning is done in the form of latitude and longitude along with the exact location of the
place, by making use of Google maps.
The GPS system will send the longitudinal and altitude values corresponding to the position of
vehicle to microcontroller, then the microcontroller provides this data to the GSM Modem.
Through which that data is sent to the mobile number given by the user and also we can see the
output on the LCD. When the received value of latitude and longitude is copied on Google Map
the location of the vehicle and path is obtained.
Finally the aim of the project i.e. to find out the Position of the vehicle and inform about it to
some remote device (mobile phone), in case of emergency i.e. either in the case of accident or in
the case when user got trapped, has been achieved successfully by using Microcontroller, GPS
receiver, GSM modem, vibration sensor, LCD and some other components.

5.2 FUTURE SCOPE:


1) We can reduce the size of the kit by using GPS+GSM on the same module.
2) We can increase the accuracy up to 3m by increasing the cost of the GPS receivers.
3) We can use our kit for detection of bomb by connecting to the bomb detector.
4) With the help of high sensitivity vibration sensors, smoke detector and proximity sensor
we can detect the accident with more accuracy, and can make our project more smart.

41

GPS-GSM Based Security Alert System for Vehicle


5) By saving emergency contact numbers such as number of Ambulance service and Police
control room it can be made more helpful to the user.

References:
1) Vehicle Accident Alert and Locator (VAAL) Department of Electrical & Information
Engineering, College of Science and Technology, Covenant University,Ota, Nigeria.
2) Application Notes[Online], Available:

http://www.maximic.com/an1490

42

GPS-GSM Based Security Alert System for Vehicle


3) E-OTD,

Enhanced

Observed

Time

Difference[Online],

Available:

http://www.phonescoop.com/glossary/term.php?gid=188
4) Wang Wei, Fan Hanbo Traffic Accident Automatic Detection And Remote Alarm
Device 978-1-4244-8039-5/11/2011 IEEE.
5) The 8051 Microcontroller and Embedded Systems by Muhammad Ali Mazidi and Janice
Gillispie Mazidi, Pearson Education.

43

You might also like