Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Accident detection system

Chapter 1

INTRODUCTION
Transportation has great importance in our daily life and its development has made
many of our chores much easy. But it can cause disaster to us and even can kill us
through accidents. During 2008, Road Traffic Injuries ranked fourth among the leading
causes of death in the world. Nearly 1.3 million people die every year on the world‟s
roads and 20 to 50 million people suffer non-fatal injuries, with many sustaining a
disability as a result of their injury. Road traffic injuries are the leading cause of death
among young people aged 15-29 years and cost countries 1-3% of the gross domestic
product (GDP). If no action is taken, road traffic crashes are predicted to result in the
deaths of around 1.9 million People annually by 2020. A Report on Road Accident in
India published by Transport Research wing recorded at least 4, 80,652 accident in 2016,
leading to 1, 50,785 d deaths. The number suggests that at least 413 people died every
day in 1317 road accident Thus accident detection system using GPS and GSM has
gained attention. This system automatically informs accident to the presaved numbers. In
this system Accelerometer and GPS tracking system are used for accident detection.
When accident occurs, this system sends short message to mobile number via GSM
modem. Message will give longitude and latitude values. From these values location of
accident can be determined. This alert message is sent to the rescue team in a short time,
which will help in saving the valuable lives. A Switch is also provided in order to
terminate the sending of a message in rare case where there is no casualty, this can save
the precious time of the concerned person. The message is sent through the GSM module
and the location of the accident is detected with the help of the GPS module. The accident
can be detected precisely with the help Micro electro mechanical system (MEMS) sensor.
The Angle of the rolls over of the car can also be known by the message through the
MEMS sensor. This application provides the optimum solution to poor emergency
facilities provided to the roads accidents in the most feasible way.

D.O.S IN MECH ENGINEERING, UBDTCE Page 1


Accident detection system

Chapter 2

LITERATURE SURVEY
At present criteria, we cannot detect where the accident has occurred leading to
the delaying time which may results in death of individual. Some of the authors who have
worked on the similar project are as follows

 Rathinakumar and Manivannan [1] have seen that the accident occurs due to a
drunken driver and improper use of belt. The main cause of accident is due to the
driver drowsy and tired condition, which will be noticed by the help of eyes
sensor which will not start and also informs the status of the driver to the base
station along with the vehicle ID. Their system includes three modules; automatic
speed control module, accident detection and information sending module and
security enabling module. In case of any accident, the vibration in vibration sensor
increases beyond the limit and information is sent to GSM module, The GSM can
send message to respective authority,Rathinakumar and Manivannan.
 Kumar and Jayasree [2] main concentration of this project is to find out the
vehicle which is met with an accident by using MEMS sensor and GPS, GSM
.This system will be placed in a moving vehicle. The ARM controller will poll
GPS module in prefixed intervals and sends the vehicle location information
(Latitude & Longitude) to central station over GSM network .This module
provides information about the accident to the hospital and police station, Kumar
and Jayasree.
 Pingle and Ahirrao [3] in this papper tried to save people life from car accidents
by using GSM and GPS model. They designed a system has accuracy which can
detect accidents in significantly less time and sends the location information to
medical center within a fraction of seconds covering the time, geographical
coordinates and angle in which a vehicle accident had occurred. The message is
sent through the Internet Dongle and the location of the accident is detected using
GPS module. When the accident occurs the alert message is sent automatically to
the rescue team and to the police station & family members, Pingle, et al.
 Sonika, Sathiyasekar [4] invented a new vivid scheme called Intelligent
Transportation System (ITS). The objective of this scheme is to minimize the
delay caused by traffic congestion and to provide the smooth flow of emergency

D.O.S IN MECH ENGINEERING, UBDTCE Page 2


Accident detection system

vehicles. The concept of the scheme is to green the traffic signal in the path of
ambulance automatically with the help of RF module. The main server finds the
nearest ambulance to the accident zone and sends the exact accident location to
the emergency vehicle. The control unit monitors the ambulance and provides the
shortest path to the ambulance at the same time it controls the traffic light
according to the ambulance location and thus arriving at the hospital safely.,
Sonika, et al.
 Prabha, Sunitha [5] are design a project will provide an optimum solution for save
the people lives when they meet with an accident. An accelerometer can be used
in a car alarm application, when a vehicle meets with an accident immediately
Vibration sensor will detect the signal or if a car rolls over, and Micro electro
mechanical system (MEMS) sensor will detects the signal and sends it to ARM
controller. Microcontroller sends the alert message through the GSM MODEM
including the location to police control room or a rescue team. So that police can
immediately trace the location through the GPS MODEM, after receiving the
information. Then after conforming the location necessary action will be taken,
they add a wireless webcam for capturing the images which will help in providing
driver`s assistance, Prabha, et al.
2.1 PROBLEM DEFENATION

 According to Save Life Foundation nearly 74% of Indians were unlikely to help
accident victims, weather alone or with other bystanders. Apart from being falsely
implicated people also worried about becoming trapped as a witness in a court
case legal proceeding can be notoriously protracted in India. If they helped the
victims to get into hospitals, they feared coming under pressure to stump up fee
for medical treatment. In some cases victims may meet with minor accident but
lacks communication with others because of damage of their mobile phones.
 Considering above works by several authors we have come up with solution to use
arguing instead of microprocessor along with GPS and GSM module. Aurduino
board is built around the at Mega 328 microcontroller.it have been simplified for
the beginners .it also having on board crystal, program loader and GPIO pins .it
also provided with IDE to write code and run it. Also having 14 digital and along
pins which made it is easy to programming

D.O.S IN MECH ENGINEERING, UBDTCE Page 3


Accident detection system

Chapter 3

COMPONENTS USED
In our project we have used both hardware and software components for effective
working of the system.

HARDWARE COMPONENTS

Hardware components consist of electronic components which perform analog or


logic operation on received and locally stored information to produce as output or store
resulting new information or to provide control for output actuator mechanisms.

3.1 GSM

Fig 3.1.1: GSM SYSTEM

GSM is a standard developed by the European Telecommunications Standards


Institute (ETSI) to describe the protocols for second-generation digital cellular networks
used by mobile devices such as tablets, first deployed in Finland in December 1991. As of
2014, it has become the global standard for mobile communications – with over 90%
market share, operating in over 193 countries and territories.

D.O.S IN MECH ENGINEERING, UBDTCE Page 4


Accident detection system

2G networks developed as a replacement for first generation (1G) analog cellular


networks, and the GSM standard originally described as a digital, circuit-switched
network optimized for full duplex voice telephony. This expanded over time to include
data communications, first by circuit-switched transport, then by packet data transport via
GPRS (General Packet Radio Services) and EDGE (Enhanced Data rates for GSM
Evolution, or EGPRS).

Subsequently, the 3GPP developed third-generation (3G) UMTS standards,


followed by fourth-generation (4G) LTE Advanced standards, which do not form part of
the ETSI GSM standard.

In our project we used GSM SIM900A Module. Its working and specification is
as follows

FIG 3.1.2: GSM SIM900A MODULE

SIM900A Modem is built with Dual Band GSM/GPRS based SIM900A modem
from SIMCOM. It works on frequencies 900/ 1800 MHz. SIM900A can search these two
bands automatically. The frequency bands can also be set by AT Commands. The band
rate is configurable from 1200-115200 through AT command. The GSM/GPRS Modem
is having internal TCP/IP stack to enable you to connect with internet via GPRS.

D.O.S IN MECH ENGINEERING, UBDTCE Page 5


Accident detection system

SIM900A is an ultra-compact and reliable wireless module. This is a complete


GSM/GPRS module in a SMT type and designed with a very powerful single-chip
processor integrating AMR926EJ-S core, allowing you to benefit from small dimensions
and cost-effective solutions.

SPECIFICATION

1. Dual-Band 900/ 1800 MHz


2. GPRS multi-slot class 10/8GPRS mobile station class B
3. Compliant to GSM phase 2/2+
4. Dimensions: 24*24*3 mm
5. Weight: 3.4g
6. Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT
Commands)
7. Supply voltage range : 5V
8. Low power consumption: 1.5mA (sleep mode)
9. Operation temperature: -40°C to +85 °

3.2 GPS

GPS is used in vehicles for both tracking and navigation. Tracking systems
enable a base station to keep track of the vehicles without the intervention of the driver
where, as navigation system helps the driver to reach the destination. Whether navigation
system or tracking system, the architecture is more or less similar. When an accident
occurred in any place then GPS system tracks the position of the vehicle and sends the
information to the particular person through GSM by alerting the person through SMS or
by a call.

GPS satellites circle the Earth twice a day in a precise orbit. Each satellite
transmits a unique signal and orbital parameters that allow GPS devices to decode and
compute the precise location of the satellite. GPS receivers use this information and
trilateration to calculate a user's exact location. Essentially, the GPS receiver measures
the distance to each satellite by the amount of time it takes to receive a transmitted signal.
With distance measurements from a few more satellites, the receiver can determine a
user's position and display it.

D.O.S IN MECH ENGINEERING, UBDTCE Page 6


Accident detection system

To calculate your 2-D position (latitude and longitude) and track movement, a
GPS receiver must be locked on to the signal of at least 3 satellites. With 4 or more
satellites in view, the receiver can determine your 3-D position (latitude, longitude and
altitude). Generally, a GPS receiver will track 8 or more satellites, but that depends on the
time of day and where you are on the earth.

Once your position has been determined, the GPS unit can calculate other information,
such as:

 Speed
 Bearing
 Track
 Trip dist
 Distance to destination

In our project we used NEO-6MV GPS Module

FIG 3.2.1: NEO – 6MV GPS MODULE

The NEO-6 module series is a family of stand-alone GPS receivers featuring the
high performance u-blox 6 positioning engine. These flexible and cost effective receivers
offer numerous connectivity options in a miniature 16 x 12.2 x 2.4 mm package. Their
compact architecture and power and memory options make NEO-6 modules ideal for
battery operated mobile devices with very strict cost and space constraints. The 50-
channel u-blox 6 positioning engine boasts a Time-To-First-Fix0 (TTFF) of less than 1
second. The dedicated acquisition engine, with 2 million correlates, is capable of massive
parallel time/frequency space searches, enabling it to find satellites instantly. Innovative
design and technology suppresses jamming sources and mitigates multipath effects,
giving NEO-6 GPS receivers excellent navigation performance even in the most
challenging environments. For more details check the datasheet here

D.O.S IN MECH ENGINEERING, UBDTCE Page 7


Accident detection system

SPECIFICATIONS
1. Supply Voltage: 2.7 to 3.6V

2. Supply current: 67 mA

3. Antenna gain: 50 dB

4. Operating temperature:-40 to 85°C

5. Antenna Type: Passive and active antenna

6. Interfaces: UART, USB, SPI, DDC

7. Sensitivity-

 Tracking & Navigation:-160 dBm


 Reacquisition:-160 dBm
 Cold Start (Autonomous):-146 dBm

PIN DESCRIPTION
 Vcc-Supply Voltage
 Gnd-Ground pin
 TX and RX-These 2 pins acts as an UART interface for communication

3.3 MEMS SENSOR

Fig 3.3.1: MEMS SENSOR

In April, Jewell Instruments launched its MEMS accelerometer and inclinometer


product lines. Now that the company encompasses force balanced, electrolytic and
MEMS technologies, there are very few tilt applications that a Jewell sensor cannot serve.

D.O.S IN MECH ENGINEERING, UBDTCE Page 8


Accident detection system

First, what goes on inside that little sensor? It is a chip-based technology, known
as a Micro Electro-Mechanical System that is composed of a suspended mass between a
pair of capacitive plates.

When tilt is applied to the sensor, the suspended mass creates a difference in electric
potential which is measured as a change in capacitance. That signal is then amplified to
produce a stable output signal in digital, 4-20mA or VDC.

These sensors are fine solutions to applications that do not demand the highest
accuracy such as industrial automation, platform levelling, position control and pitch and
roll measurement. Since they are low cost, the project will be economical.

The greatest resolution you can get with a MEMS inclinometer is 0.0005° (DMP
series). That‟s a different story from the highly accurate electrolytic line whose most

D.O.S IN MECH ENGINEERING, UBDTCE Page 9


Accident detection system

sensitive tilt meter (LILY borehole tilt meter) boasts a 0.005 µrad resolution. However,
MEMS has some advantages of its own.

A MEMS sensor provides the convenient features that you can get with any other
sensor line such as analog voltage, current and digital output options. You don‟t need to
concern yourself with space constraints as MEMS utilizes very compact micro machine
components so that each sensor can fit into the palm of your hand. They have an IP67 seal
and since the operating temperature range is -40° to +85°C, they will withstand some
intense conditions. While electrolytic sensors have much higher accuracy, some of them
can be sensitive to temperature.

In our project we used MPU-6050 sensor contains a MEMS accelerometer and a


MEMS gyro in a single chip. It is very accurate, as it contains 16-bits analog to digital
conversion hardware for each channel. Therefor it captures the x, y, and z channel at the
same time. The sensor uses the I2C-bus to interface with the Arduino.

SPECIFICATION

 Input Voltage: 2.3 - 3.4V


 Integrated 16-bit ADCs enable simultaneous sampling of gyros and
accelerometers
 nternal Digital Motion Processing TM (DMPTM) engine supports 3D Motion
Processing and gesture recognition algorithms
 Tri-Axis angular rate sensor (gyro) with a sensitivity up to 131 LSBs/dps and a
full-scale range of ±250, ±500, ±1000, and ±2000dps Tri-Axis accelerometer with
a programmable full scale range of ±2g, ±4g, ±8g and ±16g

PIN DESCRIPTION OF ACCELEROMETER:

 Vcc 5 volt supply should connect at this pin.


 X-OUT This pin gives an Analog output in x direction
 Y-OUT This pin give an Analog Output in y direction
 Z-OUT This pin gives an Analog Output in z direction
 GND Ground
 ST This pin used for set sensitivity of sensor

D.O.S IN MECH ENGINEERING, UBDTCE Page 10


Accident detection system

3.4 JUMPER WIRES

FIG 3.4.1: JUMPER WIRES

A jump wire (also known as jumper, jumper wire, jumper cable, DuPont wire, or
DuPont cable – named for one manufacturer of them) is an electrical wire, or group of
them in a cable, with a connector or pin at each end (or sometimes without them – simply
"tinned"), which is normally used to interconnect the components of a breadboard or
other prototype or test circuit, internally or with other equipment or components, without
soldering.

Individual jump wires are fitted by inserting their "end connectors" into the slots
provided in a breadboard, the header connector of a circuit board, or a piece of test
equipment.

3.5 BUZZER

FIG 3.5.1: BUZZER

A buzzer or beeper is an audio signalling device,[1] which may be mechanical,


electromechanical, or piezoelectric (piezo for short). Typical uses of buzzers and beepers

D.O.S IN MECH ENGINEERING, UBDTCE Page 11


Accident detection system

include alarm devices, timers, and confirmation of user input such as a mouse click or
keystroke.

PIEZOELECTRIC DISK BEEPER

a. A piezoelectric element may be driven by an oscillating electronic circuit


or other audio signal source, driven with a piezoelectric audio amplifier.
Sounds commonly used to indicate that a button has been pressed are a
click, a ring or a beep.

Piezo buzzers are used for making beeps alarms and tones. They can be used in
alarm systems, for keypad feedback, or some games. Light weight, simple construction
and low price make it usable in various applications like car/truck reversing indicator,
computers, call bells etc. Also they are fun to play around with.

3.6 ARDUINO UNO BOARD

FIG 3.6.1: ARDUINO UNO BOARD

The Arduino Uno R3 is a microcontroller board based on the ATmega328


(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP
header, and a reset button. It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter
or battery to get started. UNO means one in Italian and was chosen to release of arduino
software (IDE) 1.0. The UNO board is the first in series of USB arduino boards, and
reference model for the arduino platform

D.O.S IN MECH ENGINEERING, UBDTCE Page 12


Accident detection system

SPECIFICATION
Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM output)

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB (ATmega328) of which 0.5 KB used by boot


loader

SRAM 2 KB (ATmega328)

EEPROM 1 KB (ATmega328)

Clock Speed 16 MHz

POWER
The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-
wart) or battery. The adapter can be connected by plugging a 2.1mm centre-positive plug
into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the
board. The recommended range is 7 to 12 volts.

D.O.S IN MECH ENGINEERING, UBDTCE Page 13


Accident detection system

The power pins are as follows:

 VIN. The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated power
source). You can supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin.
 5V. the regulated power supply used to power the microcontroller and other
components on the board. This can come either from VIN via an on-board
regulator, or be supplied by USB or another regulated 5V supply.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
 GND. Ground pins.

MEMORY
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2
KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).

INPUT AND OUTPUT


Each of the 14 digital pins on the Uno can be used as an input or output, using pin
Mode (), digital Write (), and digital Read () functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 ohms. In addition, some pins have specialized
functions:

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2
USB-to-TTL Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value. See the attach
Interrupt () function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite ()
function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.

D.O.S IN MECH ENGINEERING, UBDTCE Page 14


Accident detection system

 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labelled A0 through A5, each of which provide 10
bits of resolution (i.e. 1024 different values). By default they measure from ground to 5
volts, though is it possible to change the upper end of their range using the AREF pin and
the analogReference () function.

Additionally, some pins have specialized functionality:

TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.

There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analogReference ().

Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.

AUTOMATIC (SOFTWARE) RESET

Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running on a
connected computer. One of the hardware flow control lines (DTR) of
theATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100
nanofarad capacitor. When this line is asserted (taken low), the reset line drops long
enough to reset the chip. The Arduino software uses this capability to allow you to upload
code by simply pressing the upload button in the Arduino environment. This means that
the boot loader can have a shorter timeout, as the lowering of DTR can be well-
coordinated with the start of the upload.

This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software
(via USB). For the following half-second or so, the boot loader is running on the Uno.
While it is programmed to ignore malformed data (i.e. anything besides an upload of new
code), it will intercept the first few bytes of data sent to the board after a connection is
opened. If a sketch running on the board receives one-time configuration or other data

D.O.S IN MECH ENGINEERING, UBDTCE Page 15


Accident detection system

when it first starts, make sure that the software with which it communicates waits a
second after opening the connection and before sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on
either side of the trace can be soldered together to re-enable it. It's labelled "RESET-EN".
You may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V
to the reset line; see this forum thread for details.

COMMUNICATION
The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The '16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is
required. The Arduino software includes a serial monitor which allows simple textual
data to be sent to and from the Arduino board. The RX and TX LEDs on the board will
flash when data is being transmitted via the USB-to-serial chip and USB connection to
the computer (but not for serial communication on pins 0 and 1).

USB OVERCURRENT PROTECTION


The Arduino Uno has a resettable polyfuse that protects your computer's USB
ports from shorts and overcurrent. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is applied
to the USB port, the fuse will automatically break the connection until the short or
overload is removed

PHYSICAL CHARACTERISTICS
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches
respectively, with the USB connector and power jack extending beyond the former
dimension. Four screw holes allow the board to be attached to a surface or case. Note that
the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the
100 mil spacing of the other pins.

D.O.S IN MECH ENGINEERING, UBDTCE Page 16


Accident detection system

SOFTWARE COMPONENTS

A program for Arduino hardware may be written in any programming language


with compilers that produce binary machine code for the target processor. Atmel provides
a development environment for their 8-bit AVR and 32-bit ARM Cortex-M based
microcontrollers: AVR Studio (older) and Atmel Studio (newer).

3.7 ARDUINO IDE

The Arduino integrated development environment (IDE) is a cross-platform


application (for Windows, macOS, Linux) that is written in the programming language
Java. It originated from the IDE for the languages Processing and Wiring. It includes a
code editor with features such as text cutting and pasting, searching and replacing text,
automatic indenting, brace matching, and syntax highlighting, and provides simple one-
click mechanisms to compile and upload programs to an Arduino board. It also contains a
message area, a text console, a toolbar with buttons for common functions and a hierarchy
of operation menus. The source code for the IDE is released under the GNU General
Public License, version 2.

The Arduino IDE supports the languages C and C++ using special rules of code
structuring. The Arduino IDE supplies a software library from the Wiring project, which
provides many common input and output procedures. User-written code only requires two
basic functions, for starting the sketch and the main program loop, that are compiled and
linked with a program stub main() into an executable cyclic executive program with the
GNU tool chain, also included with the IDE distribution. The Arduino IDE employs the
program AVRDUDE to convert the executable code into a text file in hexadecimal
encoding that is loaded into the Arduino board by a loader program in the board's
firmware.

SKETCH

A program written with the Arduino IDE is called a sketch. Sketches are saved on
the development computer as text files with the file extension.ino. Arduino Software
(IDE) pre-1.0 saved sketches with the extension.pde.

D.O.S IN MECH ENGINEERING, UBDTCE Page 17


Accident detection system

A minimal Arduino C/C++ program consist of only two functions:

 setup (): This function is called once when a sketch starts after power-up or reset.
It is used to initialize variables, input and output pin modes, and other libraries
needed in the sketch.
 loop (): After setup () has been called, function loop() is executed repeatedly in
the main program. It controls the board until the board is powered off or is reset.

3.8 PROGRAM USED

#include <Wire.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
const int buzzerPin = 8;
int flag = 0;
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object


TinyGPSPlus gps;

// The serial connection to the GPS device


SoftwareSerial ss(RXPin, TXPin);

SoftwareSerial mySerial(10, 11);


const int MPU_addr=0x68; int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;

int minVal=265; int maxVal=402;

double x,x1; double y,y1; double z,z1;

void setup() {
Serial.begin(9600);
mySerial.begin(9600);
ss.begin(GPSBaud);
pinMode(buzzerPin, OUTPUT);
Wire.begin();
Wire.beginTransmission(MPU_addr);
Wire.write(0x6B);
Wire.write(0);
Wire.endTransmission(true);

}
void loop() {
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
D.O.S IN MECH ENGINEERING, UBDTCE Page 18
Accident detection system

Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6);
delay(10000);
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 6);
delay(5000);
go();

}
}

void go(){
Serial.print("WElcome");

Wire.beginTransmission(MPU_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true);
AcX=Wire.read()<<8|Wire.read();
AcY=Wire.read()<<8|Wire.read();
AcZ=Wire.read()<<8|Wire.read();
int xAng = map(AcX,minVal,maxVal,-90,90);
int yAng = map(AcY,minVal,maxVal,-90,90);
int zAng = map(AcZ,minVal,maxVal,-90,90);

x= RAD_TO_DEG * (atan2(-yAng, -zAng)+PI);


y= RAD_TO_DEG * (atan2(-xAng, -zAng)+PI);
z= RAD_TO_DEG * (atan2(-yAng, -xAng)+PI);

Serial.print("AngleX= "); Serial.println(x);

Serial.print("AngleY= "); Serial.println(y);

Serial.print("AngleZ= "); Serial.println(z);


Serial.println("-----------------------------------------");
delay(400);
if(x<105 || x>230 ){
while(flag==0){
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true);
AcX=Wire.read()<<8|Wire.read();
AcY=Wire.read()<<8|Wire.read();
AcZ=Wire.read()<<8|Wire.read();
int xAng = map(AcX,minVal,maxVal,-90,90);
int yAng = map(AcY,minVal,maxVal,-90,90);
int zAng = map(AcZ,minVal,maxVal,-90,90);

D.O.S IN MECH ENGINEERING, UBDTCE Page 19


Accident detection system

x1= RAD_TO_DEG * (atan2(-yAng, -zAng)+PI);


y1= RAD_TO_DEG * (atan2(-xAng, -zAng)+PI);
z1= RAD_TO_DEG * (atan2(-yAng, -xAng)+PI);
int i=0;
while(i<=75){
tone(buzzerPin,500,50);
delay(50);
noTone(buzzerPin);

i=i+1;
}
if(x1<=x){
hello();
delay(7000);
DialCall();
flag=1;
}
}
}

}
void hello(){
Serial.print("hello msg");
double latitude,longitude;

mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode

delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+917676809108\"\r"); // Replace x with mobile number

delay(1000);
mySerial.print("Your friend met with an aciident or fall down :");
mySerial.print(" to see the location click below link ");
mySerial.print("http://www.google.com/maps/place");
mySerial.print("/");
mySerial.print(gps.location.lat(),6);// The SMS text you want to send
mySerial.print(",");
mySerial.print(gps.location.lng(),6);
mySerial.println((char)26);

delay(5000);

mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode

delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+919206716365\"\r"); // Replace x with mobile number

D.O.S IN MECH ENGINEERING, UBDTCE Page 20


Accident detection system

delay(1000);
mySerial.print("Your friend met with an aciident or fall down :");
mySerial.print(" to see the location click below link ");
mySerial.print("http://www.google.com/maps/place");
mySerial.print("/");
mySerial.print(gps.location.lat(),6);// The SMS text you want to send
mySerial.print(",");
mySerial.print(gps.location.lng(),6);

delay(100);

mySerial.println((char)26);// ASCII code of CTRL+Z

delay(3000);
}

void DialCall()

mySerial.println("ATD+917676809108;"); // ATDxxxxxxxxxx; -- watch out here for


semicolon at the end!!

delay(100);

D.O.S IN MECH ENGINEERING, UBDTCE Page 21


Accident detection system

Chapter 4

WORKING

FIG 4.1 ARDUINO-VEHICLE-ACCIDENT-ALERT-SYSTEM-BLOCK-DIAGRAM

In this project, Arduino is used for controlling whole the process with a GPS
Receiver and GSM module. GPS Receiver is used for detecting coordinates of the
vehicle, GSM module is used for sending the alert SMS with the coordinates and the link
to Google Map. Accelerometer namely ADXL335 is used for detecting accident or
sudden change in any axis. And an optional 16x2 LCD is also used for displaying status
messages or coordinates. We have used GPS Module SIM28ML and GSM Module
SIM900A.

When we are ready with our hardware after programming, we can install it in our
vehicle and power it up. Now whenever there is an accident, the car gets tilt and
accelerometer changes his axis values. These values read by Arduino and checks if any
change occurs in any axis. If any change occurs then Arduino reads coordinates by
extracting $GPGGA String from GPS module data (GPS working explained above) and
send SMS to the predefined number to the police or ambulance or family member with
the location coordinates of accident place. The message also contains a Google Map link

D.O.S IN MECH ENGINEERING, UBDTCE Page 22


Accident detection system

to the accident location, so that location can be easily tracked. When we receive the
message then we only need to click the link and we will redirect to the Google map and
then we can see the exact location of the vehicle.

FIG 4.2 FLOW CHART

D.O.S IN MECH ENGINEERING, UBDTCE Page 23


Accident detection system

CHAPTER 5

CIRCUIT EXPLANATION

FIG 5.1 CIRCUIT CONNECTION TO ARDUINO UNO

Circuit Connections of this Vehicle Accident Alert System Project is simple. Here
Tx pin of GPS module is directly connected to digital pin number 10 of Arduino. By
using Software Serial Library here, we have allowed serial communication on pin 10 and
11, and made them Rx and Tx respectively and left the Rx pin of GPS Module open. By
default Pin 0 and 1 of Arduino are used for serial communication but by using the
Software Serial library, we can allow serial communication on other digital pins of the
Arduino. 12 Volt supply is used to power the GPS Module.

GSM module‟s Tx and Rx pins of are directly connected to pin D2 and D3 of


Arduino. For GSM interfacing, here we have also used software serial library. GSM
module is also powered by 12v supply. An optional LCD‟s data pins D4, D5, D6, and D7
are connected to pin number 6, 7, 8, and 9 of Arduino. Command pin RS and EN of LCD
are connected with pin number 4 and 5 of Arduino and RW pin is directly connected with
ground. A Potentiometer is also used for setting contrast or brightness of LCD.

An Accelerometer is added in this system for detecting an accident and its x,y, and
z-axis ADC output pins are directly connected to Arduino ADC pin A1, A2, and A3.

D.O.S IN MECH ENGINEERING, UBDTCE Page 24


Accident detection system

5.1 INTERFACING GSM WITH ARDUINO UNO

Fig 5.1.1: INTERFACING WITH ARDUINO UNO

STEP 1: MATERIAL PREPARATION

1. GSM SIM900A (MINI V3.9.2)

2. Arduino Uno Board and USB

3. Jumper Wire

4. Power adapter 5V

5. SIM card

STEP 2: BOOTING UP SIM900A

1. Insert your SIM card to GSM module and lock it.

2. power up your GSM by connecting it to Arduino's 5V and GND

3. Connect the Antenna

D.O.S IN MECH ENGINEERING, UBDTCE Page 25


Accident detection system

4. Now wait for some time (say 1 minute) and see the blinking rate of „status LED‟ or
„network LED‟ (D6, refer picture 5) //GSM module will take some time to establish
connection with mobile network//

5. Once the connection is established successfully, the status/network LED will blink
continuously every 3 seconds. You may try making a call to the mobile number of the sim
card inside GSM module. If you hear a ring back, the GSM module has successfully
established network connection.

STEP 3: PIN CONNECTION

You can see a TTL pin with 3VR, 3VT, 5Vr, 5VT, VCC and GND on your sim900a near
your power supply pin. You have to connect GSM's 5VT to Arduino D9 and GSM's 5VR
to Arduino's D10 for serial communication between arduino and sim900a module.

STEP 4: BASIC AT COMMAND

1. To change sms sending mode : AT+CMGF=1

mySerial.println ("AT+CMGF=1");

2. To read SMS in text mode: AT+CNMI=2, 2,0,0,0

mySerial.println ("AT+CNMI=2, 2, 0,0,0");

3. To make a call: ATD+60XXXXXXXXX; //replace X with number you want to call,


change +60 to your country code

mySerial.println("ATD+60XXXXXXXXX;");

D.O.S IN MECH ENGINEERING, UBDTCE Page 26


Accident detection system

4. To disconnect / hang-up call: ATH

mySerial.println("ATH");

5. To redial: ATDL

mySerial.println ("ATDL");

6. To receive a phone call: ATA

mySerial.println ("ATA");

STEP 5: LIBRARY

Software Serial is a library of Arduino which enables serial data communication


through other digital pins of Arduino. The library replicates hardware functions and
handles the task of serial communication. To be able to interface GSM module with
arduino, you will have to download this library and extract it into your Arduino's
libraries.

5.2 INTERFACING GPS WITH ARDUINO UNO

Hardware and software required


 NEO6MV2 GPS Module
 Arduino UNO
 Arduino IDE(1.0.6V)

FIG 5.2.1: INTERFACING GPS WITH ARDUINO UNO

D.O.S IN MECH ENGINEERING, UBDTCE Page 27


Accident detection system

HARDWARE CONNECTIONS
The connections are made as follows

 Vcc to 3.3V
 Gnd to Gnd
 TX to Digital pin 11
 RX to Digital pin 10
5.3 INTERFACING BUZZER WITH ARDUINO UNO

STEP 1: ALL THAT YOU NEED

A Piezo Buzzer.

Arduino Uno.

Resistor 100ohm.

Jumper Wires.

STEP 2: THE CONNECTIONS

Connect the Supply wire (RED) of the buzzer to the Digital Pin 9 of the Arduino through
a 100 ohm resistor.

Connect the Ground wire (BLACK) of the buzzer to any Ground Pin on the Arduino.

FIG 5.3.1: INTERFACING BUZZER TO ARDUINO UNO

D.O.S IN MECH ENGINEERING, UBDTCE Page 28


Accident detection system

COST ANALYSIS

Components Quantity Cost/Unit Total


Used (Rupees) (Rupees)
GPS SIM 900A 1 1399 1399
MODULE
GPS NEO 6M 1 818 818
MODULE
MPU6050 MEMS 1 320 320
SENSOR
BUZZER 1 40 40
JUMPER WIRES 40 2.075 83
ARDUINO UNO 1 425 425
BOARD
ARDUINO - 2500 2500
PROGRAMMING
TOTAL 7 - 5585

D.O.S IN MECH ENGINEERING, UBDTCE Page 29


Accident detection system

CHAPTER 6

CONCLUSION
This project presents vehicle accident detection and alert system with SMS to the
user defined mobile numbers. The GPS tracking and GSM alert based algorithm is
designed and implemented with LPC2148 MCU in embedded system domain. The
proposed Vehicle accident detection system can track geographical information
automatically and sends an alert SMS regarding accident. Experimental work has been
carried out carefully. The result shows that higher sensitivity and accuracy is indeed
achieved using this project. EEPROM is interfaced to store the mobile numbers
permanently. This made the project more user-friendly and reliable. The proposed method
is verified to be highly beneficial for the automotive industry.

6.1 FUTURE SCOPE

We may add some modules which will also let the system know about the traffic
details and then find out which node will take less time to reach from the accident spot.
Another thing which we may add is “first aid kit” for emergency medical treatment at the
scene itself. We can also add some modules which will measure the injuries level or some
additional information like blood group, heart beats, current glucose level which may be
send to the hospitals in advance before the victims reaches the hospitals hence improvise
the performance of the proposed system. We can also implement webcam for this system
for capturing the images which will help in providing drivers assistance

D.O.S IN MECH ENGINEERING, UBDTCE Page 30


Accident detection system

REFERANCES

[1] R. Rathinakumar and D. Manivannan, "Wireless accident information system using


GSM and GPS," Research Journal of Applied Sciences, Engineering and Technology,
vol. 4, pp. 33233326, 2012.

[2] R. Kumar and K. Jayasree, "GSM & GPS Integrated With ARM Based Event Data
Recorder for Accident Detection," IJSEAT, vol. 2, pp. 468-473, 2014.

[3] P. P. Pingle, A. S. Marathe, and P. R. Ahirrao, "Intelligent Vehicle Accident Detection


& Notification System (VADANS) Using Smart Sensor and GPS Technologies," Imperial
Journal of Interdisciplinary Research, vol. 2, 2016.

[4] S. Sonika, K. Sathiyasekar, and S. Jaishree, "Intelligent accident identification system


using GPS, GSM modem," International Journal of Advanced Research in Computer and
Communication Engineering, vol. 3, 2014.

[5] C. Prabha, R. Sunitha, and R. Anitha, "Automatic vehicle accident detection and
messaging system using GSM and GPS modem," International Journal of Advanced
Research in Electrical, Electronics and Instrumentation Engineering, vol. 3, pp. 10723-
10727, 2014.

D.O.S IN MECH ENGINEERING, UBDTCE Page 31

You might also like