Accident Alert System ABSTRACT This project aims to develop a device that informs the control station if the vehicle in which the device is fitted, met with a severe accident. This project is implemented using an accelerometer sensor, which works using MEMS technology along with GSM and GPS.The device has a micro controller connected to an Accelerometer sensor, GPS module and GSM module. The software that is embedded in the micro controller controls the various operations of the device. The micro controller monitors the waveform from the accelerometer sensor.The GPS module calculates the geographical position of the module. This helps in detecting the location/longitude of the module. The GPS system functions on the basis of NEMA protocol. The device monitors the vibrations due to impact from the sensors that are received as analog values. The user can feed the tolerance level of impact. If the level is above the tolerance level (in case of accident), the device sends alert messages (SMS) along with the location data from GPS module to the control station or to hospital using the GSM module.The control station or hospital receives the message from the vehicle through the GSM module, which helps to initiate the appropriate action. ASIET, Kalady Page 1 of 100 Dept. of Electronics and Communication Engg.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Accident Alert System
ABSTRACT
This project aims to develop a device that informs the control station if the
vehicle in which the device is fitted, met with a severe accident. This project is
implemented using an accelerometer sensor, which works using MEMS technology along
with GSM and GPS.The device has a micro controller connected to an Accelerometer
sensor, GPS module and GSM module. The software that is embedded in the micro
controller controls the various operations of the device.
The micro controller monitors the waveform from the accelerometer
sensor.The GPS module calculates the geographical position of the module. This helps in
detecting the location/longitude of the module. The GPS system functions on the basis of
NEMA protocol.
The device monitors the vibrations due to impact from the sensors that are
received as analog values. The user can feed the tolerance level of impact. If the level is
above the tolerance level (in case of accident), the device sends alert messages (SMS)
along with the location data from GPS module to the control station or to hospital using
the GSM module.The control station or hospital receives the message from the vehicle
through the GSM module, which helps to initiate the appropriate action.
ASIET, Kalady Page 1 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
1. INTRODUCTION
In search of our project we plan to do something, which is ye to be established and must
be useful to day to day life. We analyzed the current situation and realized that if there
may be system that informs the accidents at the right time, we will be able to save
thousands of precious life. So we decided to develop such a system that informs the
accidents to a station or the right person.
It is implemented using an accelerometer sensor which works using MEMS technology
along with GPS and GSM. The various operations of the device are controlled by the
software that is embedded in the microcontroller.
ASIET, Kalady Page 2 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
1.1 MICROCONTROLLERS AND MICROPROCESSORS
The contrast between a Microprocessor and Microcontroller is best exemplified
by the fact that most Microprocessors have many opcodes for moving data from external
memory to CPU; Microcontroller have one or two.
Microprocessor may have one or two types of bit handling instructions;
Microcontrollers will have many. Microprocessors are concerned with rapid movement
of code and data from external address to the chip. Microprocessor must have many
additional parts to be optional. Microcontrollers can function as a computer with addition
of no external digital parts.
Microprocessors are intended to be general purpose digital computer where as
Microcontroller are intended to be special purpose digital controllers. Microprocessors
contain a CPU, memory, addressing circuits and interrupt handling data. Microcontrollers
have these features as well as timers, parallel and serial I/O internal RAM and ROM.
1.2 INTRODUCTION TO EMBEDDED SYSTEMS
Embedded System is any electronic equipment with built in intelligence and
dedicated software. All embedded Systems use either a microprocessor or a micro
controller. The application of these controllers makes user-friendly cheaper solutions and
enables to add features otherwise impossible to provide by other means.
Embedded devices can be defined as any device with a microprocessor or
micro controller embedded in it that has a relatively focused functionality. The software
for the Embedded System is called firmware. The firmware is written in Assembly
language for time or resource critical operations or using higher-level languages like C or
Embedded C. The software will be simultaneously micro code simulations for the largest
processor. Since they are supported to perform only specific task, these programs are
stored in Read Only Memories (ROMs). Moreover they may need no or minimal inputs
from the user, hence the user interface like monitor, mouse & large keyboard etc. may be
absent.
ASIET, Kalady Page 3 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
Embedded Systems are also known as Real time Systems since they respond to an input
or event and produce the result within the guaranteed time period. This time period can
be a few microseconds to days or months.
Embedded Systems Development:
In the development of Embedded System application the hardware and software
must go in hand in hand. The software created by the software engineers must be burnt
into or micro coded into the hardware or the micro controller produced by the VLSI
engineers. The micro controller and the software micro coded in it together form the
system for the particular application.
The software program for real time system is written either in assembly or high-
level language such as C. The assembly language is used in the case of tome critical
applications. Now day’s high-level languages replace most of the assembly language
constructs.
ASIET, Kalady Page 4 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
1.3 ADVANTAGES OF EMBEDDED SYSTEM
Higher performance: The integration of various ICs shortens the traveling rout and
time of data to be transmitted resulting in higher performance.
Lower power consumption: The integration of various ICs eliminates buffers and
other interface circuits. As the number of components is reduced, less power will be
consumed.
Slimmer and more compact: Housed in a single separate package, the chip is
smaller in size and therefore occupies less space on the PCB. Hence products using
embedded system are slimmer and more compact.
Reduced design and development system: The system on a chip provides all
functionality required by the system. System designers need not worry about the basic
function of the system-right from the beginning of the design phase, they can focus on the
development features. As a result, the time spends on research and development is
reduced and this in turn reduces the time to market of their products.
Lower system costs: In the past, several chips in separate packages were required to
configure a system. Now, just one system on-chip can replace all of these, dramatically
reducing the packaging cost.
ASIET, Kalady Page 5 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
2. OVERVIEW
2.1 PROJECT IDEA
The device monitors the vibrations due to impact from the sensors that are
received as analog values. The response level of the systems developed using MEMS
technology is very high say a few milliseconds. The tolerance level of impact can be fed
by the user to the system. If the level is above the tolerance level (in case of accidents),
the device sends alert messages (SMS) along with the location data from GPS module to
the control station or to hospital using the GSM module The control station or hospital
receives the message from the vehicle through the GSM module which helps to initiate
the appropriate action.
2.2 IMPORTANCE OF THIS SYSTEM
We are witnessing several accidents and severe injuries and deaths taking place
on road accidents in our day to day life. Most deaths due to accidents are caused by the
unavailability of sufficient treatments and medicine at the right time. If the vehicle is got
accident on a place where sufficient communication devices and resources are not
available, the problem will become more serious.
If we are able to inform the accident at the right time to right persons we may save many
valuable lives. There comes the importance of this project accident messaging system,
which detects the accident and informs it to the right person with sufficient details about
the place where accident occurred.
ASIET, Kalady Page 6 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
2.3 GENERAL BLOCK DIAGRAM
<<<< >>>>
<<<< >>>>
Vehicle Control Station
Figure:2.1 General block diagram.
2.4 HOW DOES IT WORK
The prime use of the accident messaging system is to track the location of the
vehicle and inform the occurrence of accident with sufficient details like the exact
location and time at which accident happened. The system continuously tracks the exact
location of the vehicle on earth. A GPS receiver in the system helps to locate the
latitudinal and longitudinal position of the vehicle. An accelerometer sensor, connected
to the device helps to identify whether an accident occurred. For this the sensor value is
continuously compared with some safe value given by the user with the help of a
programmed microcontroller. If the accident is sensed, the microcontroller transfers the
GPS data along with a message of accident to the GSM module connected to the device.
ASIET, Kalady Page 7 of 72Dept. of Electronics and Communication Engg.
Mobile Tower
GSM Embedded System
WithGPS Module, GSM Module and MEMS Accelerometer
Sensor
Satellite
Accident Alert System
The GSM module then sends this message to another GSM mobile phone whose number
is given by the user in the software.
ASIET, Kalady Page 8 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
3. BLOCK DIAGRAM
ASIET, Kalady Page 9 of 72Dept. of Electronics and Communication Engg.
MEMS
IC
MMA 2260D
PIC
16F877LCD
LOGIC
NAND
GATES
USART
MAX232
GSM
GPS
Accident Alert System
4. REQUIREMENTS
Basic requirements for the project are hardware components and software to
control the overall functioning.
4.1 HARDWARE REQUIREMENTS
Hardware requirements includes,
A GPS device to locate the vehicle on earth
An accelerometer sensor to detect the occurrence of the accident
A GSM modem to transmit the message to the rescuer’s handset
A microcontroller which controls the overall working of the device incorporating all
these components.
4.2 SOFTWARE REQUIREMENTS
For the proper functioning of the device, the microcontroller is programmed using
MPLAB IDE v5.2 Compiler software. The software for the device according to the
program flow is written, compiled and simulated on C in MPLAB C-compiler.
ASIET, Kalady Page 10 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
5. CIRCUIT DIAGRAM
ASIET, Kalady Page 11 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
5.1 CIRCUIT DESCRIPTION
The circuit operations are controlled by the PIC 16F877 microcontroller. It also consists
of an accelerometer which is the MMA 2260D MEMS. The tracking is done by the GPS
receiver and a GSM module is also connected in order to send and receive messages. The
MAX 232 is the interfacing IC used in this circuit. Also an LCD controller and driver
HD44780U is used for the Display purposes. All these sections are explained below. The
power supply section consists of LM7805, diodes and capacitors. The GPS section is
powered with separate input. All the other ICs are powered from the same power supply
unit.
5.1.1 Micro-machined Accelerometer
To monitor the vibrations in the body of the vehicle we use a Micro-machined
Accelerometer- MMA 2260D. A 0.1 µF capacitor (C14) is connected to VDD to
decouple the power source. Place a ground plane beneath the accelerometer to reduce
noise, the ground plane should be attached to all internal VSS terminals. An RC filter of 1
kΩ (R5)and 0.1 µF(C13) is used on the output of the accelerometer to minimize clock
noise (from the switched capacitor filter circuit). Any external power supply switching
frequency should be selected such that they do not interfere with the internal
accelerometer sampling frequency. This will prevent aliasing errors.
ASIET, Kalady Page 12 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
Accelerometer with Recommended Connection Diagram
5.1.2 PIC 16F877 Microcontroller
The PIC 16F877 uses a 20MHz crystal. The PIC16F87X can be operated in four different
oscillator modes. The user can program two configuration bits (FOSC1 and FOSC0) to
select one of these four modes
• LP Low Power Crystal
• XT Crystal/Resonator
• HS High Speed Crystal/Resonator
• RC Resistor/Capacitor
In XT, LP or HS modes a crystal or ceramic resonator is connected to the OSC1/CLKIN
and OSC2/CLKOUT pins to establish oscillation. The PIC16F87X Oscillator design
requires the use of a parallel cut crystal. Use of a series cut crystal may give a frequency
out of the crystal manufacturers specifications. When in XT, LP or HS modes, the device
can have an external clock source to drive the OSC1/CLKIN pin.The VDD pin is
connected to +5V. the capacitor C1 is used bypass ac to ground.
The PIC has used in half duplex synchronous mode since the reception and transmission
are not done at the same baud rate. It receives data continuously from GPS receiver at a
baud rate of 9600 and data is transmitted to GSM at a baud rate 115200 if required. Both
of these are connected to the PIC through pin no.26 (RC7) using MAX 232 as interfacing
IC. Therefore to switch from reception (GPS) to transmission (GSM) we use a logic
circuit made of 4 NAND gates. Depending on the state of pin no. 37(RB4) any one of
these are connected and data transfer takes place. The GSM and the GPS receiver is
connected to the interfacing IC.
5.1.3 G- mouse GPS Receiver
ASIET, Kalady Page 13 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
G-Mouse is a total solution GPS receiver (G-Mouse instead below), designed based on
most high sensitivity. This positioning application meets strict needs such as car
navigation, mapping, surveying, security, agriculture and so on. Only clear view of sky
and certain power supply are necessary to the unit. It communicates with other electronic
utilities via compatible dual-channel through MAX-232 or TTL and saves critical
satellite data by built–in backup memory. With low power consumption, the G-Mouse
tracks up to 8 satellites at a time, re-acquires satellite signals in 1 sec and updates position
data every second. 4 power saving mode allows the unit operates with ultra low power
request.
Advantage GPS module has is :-
The module got high performance CPU Inside, allow users to design different
applications, store in the module, to provide the most economic solution for
anybody.
High performance receiver tracks up to 8 satellites while providing first fast fix and
low power consumption.
Compact design ideal for applications with minimal space.
A rechargeable battery sustains internal clock and memory. The battery is
recharged during normal operation.
5.1.4 GSM Module
ASIET, Kalady Page 14 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
The GSM Module is a simple internal circuit of a mobile which can insert a sim in itself
and send messages. In this particular project the usage can be with a GSM module or
even a mobile handset. For convenience we are using a mobile handset with a data cable.
6. GPS
6.1 INTRODUCTION TO GPS
GPS, the Global Positioning System, is the only system today able to show you
your exact position on Earth at any time, any where, and in any weather. GPS satellites
orbit 11,000 nautical miles above Earth. They are monitored continuously at ground
stations located around the world. The satellites transmit signals that can be detected by
anyone with a GPS receiver.
The first GPS satellite was launched in 1978. The first 10 satellites launched were
developmental satellites, called Block I. From 1989 to 1997, 28 production satellites,
called Block II, were launched; the last 19 satellites in the series were updated versions,
called Block IIA. The launch of the 24th GPS satellite in 1994 completed the primary
system. The third-generation satellite, Block IIR, was first launched in 1997. These
satellites are being used to replace aging satellites in the GPS constellation. The next
generation, Block IIF, is scheduled for its first launch in late 2005.
6.2 ELEMENTS OF GPS
GPS has three parts: the space segment, the user segment, and the control
segment. The space segment consists of a constellation of 24 satellites plus some spares,
each in its own orbit 11,000 nautical miles above Earth. The user segment consists of
receivers, which user can hold in his hand or mount in a vehicle, like car, bus, etc. The
control segment consists of ground stations (five of them, located around the world) that
make sure the satellites are working properly. The master control station at Schriever Air
Force Base, near Colorado Springs, Colorado, runs the system.
ASIET, Kalady Page 15 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
Figure 6.1 Elements of GPS
6.3 CONSTELLATION OF SATELLITES
An orbit is one trip in space around Earth. GPS satellites each take 12 hours to
orbit Earth. Each satellite is equipped with an atomic clock so accurate that it keeps time
to within three nanoseconds—that’s 0.000000003 or three-billionths of a second—to let it
broadcast signals that are synchronized with those from other satellites.
The signal travels to the ground at the speed of light. Even at this speed, the signal
takes a measurable amount of time to reach the receiver. The difference between the time
when the signal is received and the time when it was sent, multiplied by the speed of
light, enables the receiver to calculate the distance to the satellite. To calculate its precise
latitude longitude, and altitude, the receiver measures the distance to four separate GPS
satellites.
ASIET, Kalady Page 16 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
6.4 RECEIVERS
GPS receivers can be carried in your hand or be installed on aircraft, ships, tanks,
submarines, cars, and trucks. These receivers detect, decode, and process GPS satellite
signals. More than 100 different receiver models are already in use. The typical hand-
held receiver is about the size of a cellular telephone, and the newer models are even
smaller. The commercial hand-held units distributed to U.S. armed forces personnel
during the Persian Gulf War weighed only 28 ounces (less than two pounds). Since then,
basic receiver functions have been miniaturized onto integrated circuits that weigh about
one ounce.
6.4.1 GROUND STATION
The GPS control segment consists of several ground stations located around the
world:
• A master control station at Schriever Air Force Base in Colorado
• Five unstaffed monitor stations: Hawaii and Kwajalein in the Pacific Ocean; Diego
Garcia in the Indian Ocean; Ascension Island in the Atlantic Ocean; and Colorado
Springs, Colorado.
• Four large ground-antenna stations that send commands and data up to the satellites
and collect telemetry back from them.
ASIET, Kalady Page 17 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
6.5 WORKING OF GPS
Figure 6.2 Working of GPS
The principle behind GPS is the measurement of distance (or “range”) between
the satellites and the receiver. The satellites tell us exactly where they are in their orbits.
It works something like this: If we know our exact distance from a satellite in space, we
know we are somewhere on the surface of an imaginary sphere with a radius equal to the
distance to the satellite radius. If we know our exact distance from two satellites, we
know that we are located somewhere on the line where the two spheres intersect. And, if
we take a third and a fourth measurement from two more satellites, we can find our
location. The GPS receiver processes the satellite range measurements and produces its
position.
GPS uses a system of coordinates called WGS 84, which stands for World
Geodetic System 1984. It produces maps like the ones you see in school, all with a
common reference frame for the lines of latitude and longitude that locate places and
things. Likewise, it uses time from the United States Naval Observatory in Washington,
D.C., to synchronize all the timing elements of the system, much like Harrison's
chronometer was synchronized to the time at Greenwich.
ASIET, Kalady Page 18 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
6.6 GPS IN THIS PROJECT
In this project GPS is used for locating and tracking the vehicle. The GPS module
calculates the geographical position of the module. This helps in detecting the
location/position of the module.
The GPS system we are using here is G-Mouse GPS Receiver, FGPXMSR01.
Figure: 6..3 G-Mouse GPS Receiver, FGPXMSR01.
G-Mouse is a total solution GPS receiver (G-Mouse instead below), designed
based on most high sensitivity FirstGPSTM kernel architecture. This positioning
application meets strict needs such as car navigation, mapping, surveying, security,
agriculture and so on. Only clear view of sky and certain power supply are necessary to
the unit. It communicates with other electronic utilities via compatible dual-channel
through RS-232 or TTL and saves critical satellite data by built–in backup memory. With
low power consumption, the G-Mouse tracks up to 8 satellites at a time, re-acquires
satellite signals in 1 sec and updates position data every second. 4 power-saving mode
allows the unit operates with ultra low power request.
The GPS system functions on the basis of NMEA protocol. The NMEA protocol has
output messages and input messages. The module outputs several datas like Global
ASIET, Kalady Page 19 of 72Dept. of Electronics and Communication Engg.
Accident Alert System
positioning system fixed data, Geographic position latitude/longitude, GNSS DOP and
active satellites, GNSS satellites in view and recommended minimum specific GNSS
data.
The protocol of G-Mouse is designed base on NMEA(National Marine Electronics
Association) 0183 ASCII format. The full protocol is defined in “NMEA 0183, Version
3.01” and “RTCM (Radio Technical Commission for Maritime Services). Through this
protocol, GPS gives the latitude and longitude position of the GPS module. Several
output messages are provided by the module in which we select Recommended Minimum
Specific GNSS Data (RMC).
An example format for the output message according to NMEA protocol will be as