0% found this document useful (0 votes)
6 views

Accident Detection System

The Accident Detection System aims to enhance emergency response during vehicle accidents by using a push button and tilt sensor to detect crashes. Upon activation, the system utilizes a GPS module to send the accident location and alert messages to emergency contacts and services. This technology seeks to reduce response times and potentially save lives by automating accident detection and notification processes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Accident Detection System

The Accident Detection System aims to enhance emergency response during vehicle accidents by using a push button and tilt sensor to detect crashes. Upon activation, the system utilizes a GPS module to send the accident location and alert messages to emergency contacts and services. This technology seeks to reduce response times and potentially save lives by automating accident detection and notification processes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Accident Detection System

ABSTRACT
The Rapid growth of technology and infrastructure has made our lives easier. The advent of

technology has also increased the traffic hazards and the road accidents take place frequently which causes

huge loss of life and property because of the poor emergency facilities. Many lives could have been saved if

emergency service could get accident information and reach in time. Our project will provide an optimum

solution to this draw back. A push button can be used as a crash or rollover detector of the vehicle during and

after a crash. With signals from a push button, a severe accident can be recognized. According to this project

when a vehicle meets with an accident immediately after the push button is activated and the signal will be

detected by a microcontroller or if a car rolls over. Then with the help of GPS module, the location and the

alert message is sent and shown in the application. Then after conforming the location necessary action will

be taken. If the person meets with a small accident or if there is no serious threat to anyone’s life, then the

alert message can be terminated by the driver by a switch provided to avoid wasting the valuable time of the

medical rescue team.


Accident Detection System 1

CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
The development of a transportation system has been the generative power for human beings to have the

highest civilization above creatures in the earth. Automobile has a great importance in our daily life. We

utilize it to go to our work place, keep in touch with our friends and family, and deliver our goods. But it can

also bring disaster to us and even can kill us through accidents. Speed is one of the most important and basic

risk factors in driving. It not only affects the severity of a crash, but also increases risk of being involved in a

crash.

Despite many efforts taken by different governmental and non-governmental organizations all around

the world by various programs to aware against careless driving, yet accidents are taking place every now

and then. However, many lives could have been saved if the emergency service could get the crash

information in time. A study by Virtanen et al. shows that 4.6% of the fatalities in accidents could have been

prevented only if the emergency services could be provided at the place of accident at the proper time. As

such, efficient automatic accident detection with an automatic notification to the emergency service with the

accident location is a prime need to save the precious human life.

1.2 RELEVANCE OF THE PROJECT


 The accidental detection and alert system are designed to detect the accidents and alert rescue team in time.

 ESP8266 is major control unit to communicate between devices when an accident occurs, which helps in
transferring messages to different devices in the system.

 Push button and tilt sensor will be used as sensor to activate the alert message.

 GPS module will find the location of the vehicle and the received data is sent to ESP8266.

 Then the alert message and location is sent to the application and saved emergency contacts.
Accident Detection System 2

1.3 PURPOSE, SCOPE, AND APPLICABILITY


1.3.1 Purpose
This system is based on new technology, its main purpose is to detect an accident and send an alert to
the emergency contacts, so the victim can find some help. It can detect accident without presence of any
person.

1.3.2 Scope
The high demand of automobiles has also increased the traffic hazards and the road accidents, life of
the people is under high risk. This is because of the lack of best emergency facilities available in our country.
An automatic accident detection system for vehicle accidents is introduced in this project. This design is a
system which can detect accidents in significantly less time and sends the basic information to the emergency
contacts within a few seconds covering geographical coordinates. This alert message is sent to the emergency
contacts in a short time, which will help in saving the valuable lives.

1.3.3 Applicability
Applicability of the project accident detection system is the automobile industry. As many road accidents
happen around the world and many people lose the lives in it, this system can certainly help to decrease the
number of deaths that happen because of a road accident.

1.4 LITERATURE REVIEW


1. ACCIDENT DETECTION AND REPORTING SYSTEM USING GPS, GPRS AND GSM
TECHNOLOGY (@2012 IEEE):
This paper proposes to utilize the capability of a GPS receiver to monitor the speed of a vehicle and
detect an accident basing on the monitored speed and send the location and time of the accident from GPS
data processed by a micro-Controller by using the GSM network to the Alert Service Centre.

At high speeds the distance between starting to brake and a complete stand still is longer. The
braking distance is proportional to the square of speed. Therefore, the possibility to avoid a collision
becomes smaller.

There is a tabular column for predicting the maximum speed after considering the deceleration
factors. As such, if the speed is less than these maximum speeds, than it would be assumed that some other
deceleration force worked on the vehicle to reduce the speed and an accident has occurred.
Accident Detection System 3

Speedometer can also be used to find the speed drops in vehicles, but an analogue to digital converter
is required to acquire speed from it. So, a GPS is used to track the speed of vehicle every instance.

The vehicle speed is calculated at every instance by GPS. If there is decrease in new speed values
then it raises an ALARM for accident detection. Then 5 secs will be given to abort the emergency Else the
emergency is sent to Alert Service Centre and plot the location of accident by the GSM number received.
There after rescuing the individual.

2. REAL TIME DETECTION AND REPORTING OF VEHICLE COLLISION (@2017 IEEE):

This paper proposes to utilize the capability of Accelerometer and Gyroscope to obtain the data and
detect an accident basing on the orientation angle and orientation. Then send the location of the accident
from GPS data processed by a microController by using the GSM network to the nearest hospital provided
over the network and alerts their family members too.

The accelerometer detects the direction of vehicle collision by bi-directional axis and an axis towards
gravitational force with full scale +/-8g. The collision of a vehicle leads to a drastic change in vehicle speed
and shows a direct impact on acceleration force along that axis of crash. As the Z-axis is oriented along the
gravitational force direction, only X-axis and Y-axis of accelerometer is required to determine the happening
and direction of vehicle collision.

The gyroscope is used to calculate the tilt of collision vehicle and is given a full range of +/-500
degree/sec. Angle greater above 46 degree and below -46-degree results in rollover of car. Other than the
threshold f roll and pitch values, the weight and centre of gravity of vehicle plays an important role in
rollover. Once the threshold is reached, the notification system will be activated informing the family and
nearby hospital about the occurrence of vehicle rollover.

In addition, they use GPS tracker too for recording false assumptions from the GPS data acquired.

The notification system notifies the information to family emergency contacts and nearest hospital.
Notification system is activated once the threshold for detection is reached. Location is identified by GPS.

3. VEHICLE ACCIDENT DETECTION SYSTEM BY USING GSM, GPS AND SENSORS (@2019,
IRJET):

This paper proposes to utilize the capability of a Piezoelectric sensor to detect an accident basing on
the voltage produced by collision and send the location and time of the accident from GPS data processed by
a micro-Controller by using the GSM network to the Alert Service Centre.
Accident Detection System 4

The Piezoelectric sensor produces a DC voltage proportional to impacts on collision on vehicle.


When the voltage increases above threshold value the sensors get triggered.

The Latitude and Longitude are detected using GPS and it is sent as message to rescue team through
GSM module. The message is received by another GSM module. Google Map Module: It displays Google
map shows you exact location of accident and its details. It gets detail SMS from accident location. Hence
there is small variation in co-ordinates. An OFF switch is also provided at times of need to avoid false
message.
Accident Detection System 5

CHAPTER 2
PROJECT OVERVIEW

2.1 BLOCK DIAGRAM AND ITS DESCRIPTION

Push
Button

GPS
ESP826 ESP826 Module
6 6

Tilt
Sensor

Server

Fig 2.1 Block diagram

The above figure 2.1 represents the Application block diagram of accident detection
system consists of esp8266, GPS module, push button, tilt sensor and server to
transfer and access data and application.

2.2 SCHEMATIC DIAGRAM


Accident Detection System 6

Fig 2.2 Schematic the Diagram of the project

2.3 LOGIC DIAGRAM

Start
Accident Detection System 7

Initialization of
the system

Accident Occurs

If the push
button/ Tilt sensor No
detected

ESP8266 collects
GPS data

Alert message with GPS


sent to the application

Emergency contacts and


services notified

Fig 2.3 Logic diagram


End
2.4 USE CASE DIAGRAM
Accident Detection System 8

Fig 2.4 Use case diagram

2.5 SEQUENCE DIAGRAM


Accident Detection System 9

Fig 2.4 Sequence diagram

2.6 WORKING PRINCIPAL


Accident Detection System 10

The Accident Detection System works by using a combination of an ESP8266 controller, a push

button, a GPS module, and a tilt sensor to detect accidents and send real-time alerts. When a car is involved

in an accident, the push button placed at the front of the vehicle is likely to be pressed due to the impact. This

triggers the ESP8266 to collect the vehicle's location data from the GPS module. The system then sends an

alert message containing the accident location coordinates through the developed application to selected

emergency contacts and emergency services. In cases where the car experiences a rollover or tilt without the

push button being pressed, the tilt sensor activates. It detects the abnormal tilt and signals the ESP8266,

which again sends the alert message and GPS coordinates to the emergency contacts and services. The alert

is transmitted via the ESP8266’s Wi-Fi capability to the mobile application, which forwards the information

to ensure prompt assistance. This two-layered system ensures that accidents are detected and reported in

various scenarios, enabling quick response and potentially saving lives.

CHAPTER 3
Accident Detection System 11

HARDWARE DESCRIPTION

3.1 ESP8266 NODEMCU


Introduction
NodeMCU is an open-source LUA based firmware developed for the ESP8266 wifi chip. By
exploring functionality with the ESP8266 chip, NodeMCU firmware comes with the ESP8266 Development
board/kit i.e. NodeMCU Development board.

Fig 3.1 NodeMCU Development Board/kit v0.9 (Version1)


Since NodeMCU is an open-source platform, its hardware design is open for edit/modify/build.
NodeMCU Dev Kit/board consist of ESP8266 wifi enabled chip. The ESP8266 is a low-cost Wi-
Fi chip developed by Espressif Systems with TCP/IP protocol.

Fig 3.2 NodeMCU Development Board/kit v1.0 (Version2)


Accident Detection System 12

There is Version2 (V2) available for NodeMCU Dev Kit i.e. NodeMCU Development Board v1.0
(Version2), which usually comes in black colored PCB.
NodeMCU Dev Kit has Arduino like Analog (i.e. A0) and Digital (D0-D8) pins on its board.
It supports serial communication protocols i.e. UART, SPI, I2C, etc.
Using such serial protocols we can connect it with serial devices like I2C enabled LCD display,
Magnetometer HMC5883, MPU-6050 Gyro meter + Accelerometer, RTC chips, GPS modules, touch screen
displays, SD cards, etc.

Pin out of ESP8266

Fig 3.3 Pin out of ESP8266


Accident Detection System 13

Nodemcu GPIO pins

Fig 3.4 Nodemcu GPIO Pins

General-purpose input/output (GPIO) is a pin on an IC (Integrated Circuit). It can be either an input


pin or output pin, whose behavior can be controlled at the run time.

NodeMCU Development kit provides access to these GPIOs of ESP8266. The only thing to take care
of is that NodeMCU Devkit pins are numbered differently than internal GPIO notations of ESP8266 as
shown in the below figure and table. For example, the D0 pin on the NodeMCU Devkit is mapped to the
internal GPIO pin 16 of ESP8266.
Accident Detection System 14

Fig 3.5 NodeMCU DevKit GPIOs

The below table gives NodeMCU Dev Kit IO pins and ESP8266 internal GPIO pins mapping

Pin Names on NodeMCU ESP8266 Internal GPIO Pin


Development Kit number

D0 GPIO16

D1 GPIO5

D2 GPIO4

D3 GPIO0

D4 GPIO2

D5 GPIO14

D6 GPIO12
Accident Detection System 15

Pin Names on NodeMCU ESP8266 Internal GPIO Pin


Development Kit number

D7 GPIO13

D8 GPIO15

D9/RX GPIO3

D10/TX GPIO1

D11/SD2 GPIO9

D12/SD3 GPIO10

The GPIO’s shown in the blue box (1, 3, 9, 10) are not commonly used for GPIO
purpose on Dev Kit

ESP8266 is a system on a chip (SoC) design with components like the processor
chip. The processor has around 16 GPIO lines, some of which are used internally to
interface with other components of the SoC, like flash memory.

Since several lines are used internally within the ESP8266 SoC, we have about
11 GPIO pins remaining for GPIO purposes.

2 pins out of 11 are generally reserved for RX and TX in order to communicate


with a host PC from which compiled object code is downloaded.

Hence finally, this leaves just 9 general-purpose I/O pins i.e. D0 to D8.

As shown in the above figure of NodeMCU Dev Kit. We can see RX, TX, SD2, SD3
pins are not commonly used as GPIOs since they are used for other internal processes.
But we can try with SD3 (D12) pin which mostly likes to respond for
GPIO/PWM/interrupt like functions.

Note that the D0/GPIO16 pin can be only used as GPIO read/write, no special
functions are supported on it.

Note
Some of the GPIO pins are used while booting, so pulling this pin HIGH or LOW can prevent NODEMCU
from booting
 GPIO0: It oscillates and stabilizes HIGH after ~100ms. Boot Failure if pulled LOW
 GPIO1: LOW for ~50ms, then HIGH, Boot Failure if Pulled LOW.
Accident Detection System 16

 GPIO2: It oscillates and stabilize HIGH after ~100ms, Boot Failure if Pulled LOW.
 GPIO3: LOW for ~50ms, then HIGH.
 GPIO9: Pin is HIGH at Boot.
 GPIO10: Pin is HIGH at Boot.
 GPIO15: LOW, Boot failure if Pulled HIGH
 GPIO16: HIGH during Boot and Falls to ~1Volt.

GPIO Cautions:
 If the GPIO pin defines as an OUTPUT LOW then don’t connect this pin to VCC, it will get short
circuit and large current flow will damage your controller or GPIO pin.

 If the GPIO Pin defines as an OUTPUT HIGH then don’t connect this pin
to Ground, it will draw large current which will damage your controller or GPIO
pin.

 For switch connection always use a pull-up or pull-down (based on your coding
logic). Always use pull UP/pull down resistor inside the microcontroller or
connect an external resistor.
 Don’t connect the direct VCC pin to the GPIO pins, otherwise it will short the
power supply when you press the switch.
Accident Detection System 17

 Kindly check following scenarios:


Accident Detection System 18

 While interfacing the led always connect a series resistor to limit the current,
otherwise LED will burn.

3.2 Neo-6m GPS


The NEO-6M is a popular GPS (Global Positioning System) module manufactured by u-blox. It is
commonly used in various applications that require accurate positioning and navigation capabilities. The
module combines a GPS receiver with an integrated antenna, making it compact and easy to integrate into
different electronic devices.
Accident Detection System 19

Fig 3.6 Neo-6m GPS

Working Principle

 Satellite Signal Reception: The NEO-6M module receives signals from multiple GPS satellites, as
well as other satellite constellations like GLONASS, Galileo, and BeiDou. These satellites transmit
signals containing precise timing information and their own orbital data.
 Signal Processing: The module processes the received satellite signals to extract essential
information. It uses a combination of algorithms, including trilateration, to determine the distance
between the module and each satellite. By analyzing the time, it takes for the signals to travel from
the satellites to the module, the module can calculate the module’s position.
 Position Calculation: They take information from multiple satellites to calculate their precise
position on the Earth’s surface. Calculated distances from different satellites, the module can
determine the latitude, longitude, and altitude of its position.
 Data Output: Once the module has determined its position, it formats the information into NMEA
(National Marine Electronics Association) sentences. GPS parameters, such as latitude, longitude,
altitude, speed, and time.
 Host Device Integration: The host device can then utilize this data for various applications, such as
mapping, navigation, tracking, or any other functionality that requires accurate position information.
 Configuration and Control: The NEO-6M module can be configured using AT (Attention)
commands sent over the serial interface.
Accident Detection System 20

Specifications

 Operating temperature range: -40 TO 85°CUART TTL socket


 EEPROM to save configuration settings
 Rechargeable battery for Backup
 The cold start time of 38 s and the Hot start time of 1 s
 Supply voltage: 3.3 V
 Configurable Baud rates 115200 and Baud rates 9600
 SuperSense ® Indoor GPS: -162 dBm tracking sensitivity
 Support SBAS (WAAS, EGNOS, MSAS, GAGAN)
 Separated 18X18mm GPS antenna

Application Of GPS NEO-6m Module

 Vehicle Tracking: They are used in vehicle tracking systems, real-time monitoring of the vehicle’s
location, speed, and direction.
 Personal Navigation Devices: The module can be integrated into handheld navigation devices, such
as GPS receivers, smartphones, and smartwatches, providing users with accurate location
information.
 Outdoor Recreation: The module is employed in outdoor recreational devices like hiking GPS units,
cycling computers, and sports watches.
 Internet of Things (IoT): It enables devices like asset trackers, environmental sensors, and
agricultural equipment to transmit precise geographical data for monitoring and control purposes.
 Robotics and Drones: Accurate positioning. Drones, for instance, utilize GPS data to maintain stable
flights, follow predefined routes, and perform aerial surveys or inspections.

3.3 PUSH BUTTON


Accident Detection System 21

Push Buttons are normally-open tactile switches. Push buttons allow us to power the circuit or make
any connection only when we press the button. Simply, it makes the circuit connected when pressed and
breaks when released. A push button is also used for triggering of the SCR by gate terminal. These are the

most common buttons which we see in our daily life electronic equipment’s. Some of the applications of the
Push button are mentioned at the end of the article.

Fig 3.7 Push Button Switch

Push Button Features

 Prevent flux rise by the insert-molded terminal


 Snap-in mount terminal
 Contact Bounce: MAX 5mS
 Crisp clicking by tactile feedback
 Dielectric Withstanding Voltage 250V AC for 1 minute

Technical Specifications

 Mode of Operation: Tactile feedback


 Power Rating: MAX 50mA 24V DC
 Insulation Resistance: 100Mohm at 100v
 Operating Force: 2.55±0.69 N
 Contact Resistance: MAX 100mOhm
 Operating Temperature Range: -20 to +70 ℃
 Storage Temperature Range: -20 to +70 ℃
Accident Detection System 22

3.4 TILT SENSOR


Tilt sensors are devices that produce an electrical signal that varies with an angular movement. These
sensors are used to measure slope and tilt within a limited range of motion. Sometimes, the tilt sensors are
referred to as inclinometers because the sensors just generate a signal but inclinometers generate both
readout and a signal.

Fig 3.8 Tilt Sensor

Working Principle

Fig 3.9 Tilt Sensor Working

These sensors consist of a rolling ball with a conductive plate beneath them. When the sensor gets
power, the rolling ball falls to the bottom of the sensor to form an electrical connection. When the sensor is
Accident Detection System 23

tilted, the rolling ball doesn’t fall to the bottom so that the current cannot flow the two end terminals of the
sensor.

3.5 JUMPER WIRES

Jumper wires are simply wires that have connector pins at each end, allowing them to be used to
connect two points to each other without soldering. Jumper wires are typically used with breadboards and
other prototyping tools to make it easy to change a circuit as needed. Fairly simple. In fact, it doesn’t get
much more basic than jumper wires.

Fig 3.10 Jumper wires

Though jumper wires come in a variety of colors, the colors don’t actually mean anything. This
means that a red jumper wire is technically the same as a black one. But the colors can be used to your
advantage to differentiate between types of connections, such as ground or power.

Jumper wires typically come in three versions: male-to-male, male-to-female and female-to-female.
The difference between each is in the end point of the wire. Male ends have a pin protruding and can plug
into things, while female ends do not and are used to plug things into. Male-to-male jumper wires are the
Accident Detection System 24

most common and what you likely will use most often. When connecting two ports on a breadboard, a male-
to-male wire is what you will need.

CHAPTER 4
SOWFWARE DESCRIPTION
4.1 ARDUINO IDE
IDE stands for Integrated Development Environment‖: it is an official software introduced by
Arduino.cc, that is mainly used for editing, compiling and uploading the code in the Arduino Device. Almost
all Arduino modules are compatible with this software that is an open source and is readily available to
install and start compiling the code on the go.

Arduino Sketch

Arduino sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded to,
and run on an Arduino board. A basic Arduino sketch consists of two functions:

setup() loop()

Writing Sketch

Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the
text editor and are saved with the file extension.ino. The editor has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while saving and exporting and also displays
errors. The console displays text output by the Arduino Software (IDE), including complete error messages
and other information. The bottom righthand corner of the window displays the configured board and serial
port. The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open
the serial monitor.

The two required parts or functions enclose blocks of statements are: void setup()
Accident Detection System 25

statements;

void loop()

Statements;

Where setup() is the preparation, while loop() is the execution. Both functions are required for the
program to work. The setup function should follow the declaration of any variable at the very beginning of
the program. It is the first function to run in the program, it runs only once and is used to set pin Mode or
initialize serial communication. The loop function follows next and includes the code to be executed
continuously - reading inputs, triggering outputs, etc. This function is the core of all Arduino program and
does the bulk of the work
Accident Detection System 26

Fig 4.1: Arduino IDE Software

The Arduino Integrated Development or Arduino software contains a text editor for writing code. A
message area, a text console, a tool bar with buttons for common functions and a series of menus. It connects
to Arduino hardware to upload programs and communicate with them.

4.2 MIT APP INVENTOR

By using MIT app inventor, we build this application. MIT App Inventor is an intuitive, visual
programming environment that allows everyone even children to build fully functional apps for smartphones
and tablets. The main goal of MIT App Inventor is to make app development accessible to a wider audience,
including students, hobbyists, and non-programmers. It uses a block-based programming approach, where
users can drag and drop visual blocks that represent different programming concepts and components to
create their applications.
Some key features of MIT App Inventor include:
1. Visual Programming: The platform uses a visual programming language based on blocks, making it
easy for users to create apps by arranging and connecting blocks that represent different functions and
behaviors.
2. Emulator: MIT App Inventor provides an emulator that allows users to test their apps directly on
their computers without needing an Android device. This enables users to see how their apps will
behave on a mobile device before deploying them.
3. Component Library: The platform offers a wide range of pre-built components and features that
users can utilize in their apps. These components include buttons, text boxes, sensors, media players,
and more, allowing users to add functionality to their apps without needing to write code from
scratch.
Accident Detection System 27

4. Community and Support: MIT App Inventor has a vibrant community of users who share
resources, tutorials, and projects. Additionally, there are forums and documentation available to assist
users in learning and troubleshooting.

Fig 4.2 Designer Window

Fig 4.3 Block Coding Screen


Accident Detection System 28

CHAPTER 5
RESULTS AND DISCUSSIONS
Accident Detection System 29

Fig 5.1 Initial Set up of the project

The development of the accident detection system has been developed successfully. The ESP 8266
Receives data from tilt sensor or push button when an accident occurs. Then it gathers the location details
from GPS module successfully and sends it to the application. The application then sends it to the emergency
contacts and services
Accident Detection System 30

Fig 5.2 Application interface


If there is no accident then the app shows normal status and when an accident occurs it gets location
and alert message successfully from esp8266 and send it to the emergency services and contacts.
Accident Detection System 31

CHAPTER 6
ADVANTAGES AND LIMITATIONS

6.1 ADVANTAGES
1. Rapid Emergency Response: The system immediately sends alerts to emergency contacts and services,
significantly reducing the time taken for help to arrive after an accident
.
2. Automated Detection: The use of both the push button and tilt sensor ensures that accidents are
automatically detected, even if the driver is unable to manually alert others.

3. Accurate Location Sharing: The integration of a GPS module ensures that the exact location of the
accident is shared with emergency responders, allowing them to locate the vehicle quickly.

4. Increased Safety: The system enhances the safety of drivers by ensuring that someone is notified in case
of an accident, which can be life-saving in severe incidents.

5. Cost-Effective: By using affordable components like the ESP8266 and GPS module, the system is
relatively inexpensive to build, making it accessible for widespread use.

6.2 LIMITATIONS

1. False Positives: The system may occasionally trigger alerts in non-accident scenarios, such as sudden
braking or a minor bump, causing unnecessary notifications.

2. Limited Coverage in Remote Areas: If the accident occurs in areas with poor network coverage,
such as rural or mountainous regions, the system may struggle to send alert messages due to the
reliance on Wi-Fi or mobile networks.

3. Power Dependency: The system requires constant power to function. If the vehicle's power system is
compromised during an accident, the system might fail to operate, which could limit its reliability.
Accident Detection System 32

CHAPTER 7

CONCLUSION AND FUTURE SCOPE

7.1 CONCLUSION

A system to detect an event of accident has been developed. The proposed system deals with accident

alerting and detection. It reads the exact latitude and longitude of the vehicle involved in the accident and

sends this information to saved contacts and emergency services. ESP8266 helps in transferring the message

to application. Push button sends the accident alert and tilt sensor is used to determine rollover of the vehicle.

The information is transferred to application through ESP8266. Using GPS, the location can be sent through

tracking system to cover the geographical coordinates over the area.

7.2 FUTURE SCOPE

The future scope of this system can have some improvisation using a wireless webcam can be added in this

for capturing the images which will help in providing driver`s assistance. This can also be bettered by

locking all the brakes automatically in case of accident. Mostly in accidents, it becomes serious as the drivers

lose control and fails to stop the vehicle. In such cases, the vibration sensor will be triggered because of the

vibrations received and processed by the processor. The processor must be linked to the devices which can

lock the brakes when triggered. With this improvement, we can stop the vehicle and can weaken the impact

of the accident. This system can also be utilized in fleet management, food services, traffic violation cases,

rental vehicle services etc.


Accident Detection System 33

REFERENCES

[1] T Kalyani, S Monika, B Naresh,Mahendra Vucha, Accident Detection and Alert System, IJITEE, March

2019(Base paper).

[2] Parag Parmar, Ashok M.Sapkal, Real time detection and reporting of vehicle collision, IEEE,2017.

[3] Md. Syedul Amin, Jubayer Jalil, M.B.I.Reaz, Accident Detection and Reporting System using GPS,GPRS

and GSM Technology, IEEE,2012.

[4] Gowshika B, MadhuMitha, G,Jayashree,Vehicle accident detection system using GPS, GSM modem,

IRJET,2019.

5] Sayanee Nanda, Harshada Joshi, Smitha Khairnar, An IOT Based Smart System for Accident Prevention

and Detection,IEEE,2018.

[6] Norsuzila Yaacob, Ainnur Eiza Azhar, Azita Laily Yusofl, Suzi Seroja Sarnin, Darmawaty Mohd Ali and

Ammar Anuar, Real Time Wireless Accident Tracker using Mobile Phone,IEEE,2017.

[7] S.Sonika, Dr.K.Sathyasekhar, S.Jaishree, Intelligent accident identification system using GPS, GSM

modem,DARCCE,2014.

[8] Dhruvesh H.Patel, Parth Sadatiya, Dhruvbhai K. Patel, Prasann Barot, IoT based Obligatory usage of

Safety Equipment for Alcohol and Accident Detection,IEEE,2019.

[9] Ajith Kumar.A, Jaganivasan.V, Sathish.T, Mohanram.S,Accident detection and alert system using

GPS&GSM,IJOPAAM,2018.

[10] Shadman Sakib, Mohammad Sayem Bin Abdullah,GPS-GSM based Inland Vessel Tracking System for

Automatic Emergency Detection and Position Notification,IEEE,2016.


Accident Detection System 34

APPENDIX

SOURCE CODE

Collision System detection Code

#include <ESP8266WiFi.h>

#include <Firebase_ESP_Client.h>

#include "addons/TokenHelper.h"

#include "addons/RTDBHelper.h"

#define BUTTON_PIN D1 // GPIO pin where the button is connected

#define WIFI_SSID "123456789"

#define WIFI_PASSWORD "123456789"

#define API_KEY "AIzaSyBhsbCD3MOJt43Q0AV1-7_h89v3BKsDePU"

#define DATABASE_URL "https://smart-inhaler-32e40-default-rtdb.firebaseio.com/"

FirebaseData fbdo;

FirebaseAuth auth;

FirebaseConfig config;

unsigned long sendDataPrevMillis = 0;

bool signupOK = false;

void setup() {

Serial.begin(115200);

pinMode(BUTTON_PIN, INPUT_PULLUP); // Set button pin as input with internal pull-up resistor

WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Accident Detection System 35

Serial.print("Connecting to Wi-Fi");

while (WiFi.status() != WL_CONNECTED){

Serial.print(".");

delay(300);

Serial.println();

Serial.print("Connected with IP: ");

Serial.println(WiFi.localIP());

Serial.println();

config.api_key = API_KEY;

config.database_url = DATABASE_URL;

if (Firebase.signUp(&config, &auth, "", "")){

Serial.println("ok");

signupOK = true;

else{

Serial.printf("%s\n", config.signer.signupError.message.c_str());

config.token_status_callback = tokenStatusCallback; //see addons/TokenHelper.h

Firebase.begin(&config, &auth);

Firebase.reconnectWiFi(true);

void loop() {

int buttonState = digitalRead(BUTTON_PIN); // Read the button state


Accident Detection System 36

if (buttonState == LOW) { // Button is pressed (LOW because of INPUT_PULLUP)

Serial.println("Button pressed");

} else { // Button is not pressed

Serial.println("Button not pressed");

if (Firebase.ready() && signupOK && (millis() - sendDataPrevMillis > 1000 || sendDataPrevMillis == 0)){

sendDataPrevMillis = millis();

if (Firebase.RTDB.setInt(&fbdo, "mainbucket/status", buttonState == LOW ? 1 : 0)){

Serial.println("PATH: " + fbdo.dataPath());

Serial.println("TYPE: " + fbdo.dataType());

else {

Serial.println("Failed REASON: " + fbdo.errorReason());

delay(200); // Add a small delay for stability

Gps Location

#include <SoftwareSerial.h>

#include <ESP8266WiFi.h>

#include <TinyGPS++.h>
Accident Detection System 37

TinyGPSPlus gps;

SoftwareSerial SerialGPS(4, 5); //Tx=4, Rx=5

const int signal = D4;

const char* ssid = "123456789";

const char* password = "123456789";

float Latitude , Longitude;

int year , month , date, hour , minute , second;

String DateString , TimeString , LatitudeString , LongitudeString;

WiFiServer server(80);

void setup()

Serial.begin(9600);

SerialGPS.begin(9600);

Serial.println();

Serial.print("Connecting");

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED)

delay(500);

Serial.print(".");

Serial.println("");
Accident Detection System 38

Serial.println("WiFi connected");

server.begin();

Serial.println("Server started");

Serial.println(WiFi.localIP());

void loop()

Serial.println(signal);

while (SerialGPS.available() > 0)

if (gps.encode(SerialGPS.read()))

if (gps.location.isValid())

Latitude = gps.location.lat();

LatitudeString = String(Latitude , 6);

Longitude = gps.location.lng();

LongitudeString = String(Longitude , 6);

if (gps.date.isValid())

DateString = "";

date = gps.date.day();
Accident Detection System 39

month = gps.date.month();

year = gps.date.year();

if (date < 10)

DateString = '0';

DateString += String(date);

DateString += " / ";

if (month < 10)

DateString += '0';

DateString += String(month);

DateString += " / ";

if (year < 10)

DateString += '0';

DateString += String(year);

if (gps.time.isValid())

TimeString = "";

hour = gps.time.hour()+ 5; //adjust UTC

minute = gps.time.minute();

second = gps.time.second();
Accident Detection System 40

if (hour < 10)

TimeString = '0';

TimeString += String(hour);

TimeString += " : ";

if (minute < 10)

TimeString += '0';

TimeString += String(minute);

TimeString += " : ";

if (second < 10)

TimeString += '0';

TimeString += String(second);

WiFiClient client = server.available();

if (!client)

return;

//Response
Accident Detection System 41

String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n <!DOCTYPE html> <html> <head>


<title>NEO-6M GPS Readings</title> <style>";

s += "table, th, td {border: 1px solid blue;} </style> </head> <body> <h1 style=";

s += "font-size:300%;";

s += " ALIGN=CENTER>NEO-6M GPS Readings</h1>";

s += "<p ALIGN=CENTER style=""font-size:150%;""";

s += "> <b>Location Details</b></p> <table ALIGN=CENTER style=";

s += "width:50%";

s += "> <tr> <th>Latitude</th>";

s += "<td ALIGN=CENTER >";

s += LatitudeString;

s += "</td> </tr> <tr> <th>Longitude</th> <td ALIGN=CENTER >";

s += LongitudeString;

s += "</td> </tr> <tr> <th>Date</th> <td ALIGN=CENTER >";

s += DateString;

s += "</td></tr> <tr> <th>Time</th> <td ALIGN=CENTER >";

s += TimeString;

s += "</td> </tr> </table> ";

if (gps.location.isValid())

s += "<p align=center><a style=""color:RED;font-size:125%;"" href=""http://maps.google.com/maps?


&z=15&mrt=yp&t=k&q=";

s += LatitudeString;
Accident Detection System 42

s += "+";

s += LongitudeString;

s += """ target=""_top"">Click here</a> to open the location in Google Maps.</p>";

s += "</body> </html> \n";

client.print(s);

delay(100);

IP Address

#include <SoftwareSerial.h>

#include <ESP8266WiFi.h>

#include <TinyGPS++.h>

TinyGPSPlus gps;

SoftwareSerial SerialGPS(4, 5);

const int signal = D4;

const char* ssid = "123456789";

const char* password = "123456789";

float Latitude , Longitude;


Accident Detection System 43

int year , month , date, hour , minute , second;

String DateString , TimeString , LatitudeString , LongitudeString;

WiFiServer server(80);

void setup()

Serial.begin(9600);

SerialGPS.begin(9600);

Serial.println();

Serial.print("Connecting");

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED)

delay(500);

Serial.print(".");

Serial.println("");

Serial.println("WiFi connected");

server.begin();

Serial.println("Server started");
Accident Detection System 44

Serial.println(WiFi.localIP());

void loop()

Serial.println(signal);

while (SerialGPS.available() > 0)

if (gps.encode(SerialGPS.read()))

if (gps.location.isValid())

Latitude = gps.location.lat();

LatitudeString = String(Latitude , 6);

Longitude = gps.location.lng();

LongitudeString = String(Longitude , 6);

if (gps.date.isValid())

DateString = "";
Accident Detection System 45

date = gps.date.day();

month = gps.date.month();

year = gps.date.year();

if (date < 10)

DateString = '0';

DateString += String(date);

DateString += " / ";

if (month < 10)

DateString += '0';

DateString += String(month);

DateString += " / ";

if (year < 10)

DateString += '0';

DateString += String(year);

}
Accident Detection System 46

if (gps.time.isValid())

TimeString = "";

hour = gps.time.hour()+ 5; //adjust UTC

minute = gps.time.minute();

second = gps.time.second();

if (hour < 10)

TimeString = '0';

TimeString += String(hour);

TimeString += " : ";

if (minute < 10)

TimeString += '0';

TimeString += String(minute);

TimeString += " : ";

if (second < 10)

TimeString += '0';

TimeString += String(second);
Accident Detection System 47

WiFiClient client = server.available();

if (!client)

return;

//Response

String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n <!DOCTYPE html> <html> <head>

<title>NEO-6M GPS Readings</title> <style>";

s += "table, th, td {border: 1px solid blue;} </style> </head> <body> <h1 style=";

s += "font-size:300%;";

s += " ALIGN=CENTER>NEO-6M GPS Readings</h1>";

s += "<p ALIGN=CENTER style=""font-size:150%;""";

s += "> <b>Location Details</b></p> <table ALIGN=CENTER style=";

s += "width:50%";

s += "> <tr> <th>Latitude</th>";

s += "<td ALIGN=CENTER >";


Accident Detection System 48

s += LatitudeString;

s += "</td> </tr> <tr> <th>Longitude</th> <td ALIGN=CENTER >";

s += LongitudeString;

s += "</td> </tr> <tr> <th>Date</th> <td ALIGN=CENTER >";

s += DateString;

s += "</td></tr> <tr> <th>Time</th> <td ALIGN=CENTER >";

s += TimeString;

s += "</td> </tr> </table> ";

if (gps.location.isValid())

s += "<p align=center><a style=""color:RED;font-size:125%;"" href=""http://maps.google.com/maps?

&z=15&mrt=yp&t=k&q=";

s += LatitudeString;

s += "+";

s += LongitudeString;

s += """ target=""_top"">Click here</a> to open the location in Google Maps.</p>";

s += "</body> </html> \n";


Accident Detection System 49

client.print(s);

delay(100);

You might also like