Hello everyone, we hope you all are doing well. In this article we will discuss a project named Accident Detection with Arduino UNO. We will discuss all points and concepts briefly in this article and also provide a Proteus Simulation to observe how it will work in the real world.
Complete fully explained code and simulation is also provided below as you go ahead in this article. You can download it from there.
For any queries and doubts, you can contact -
Email - firstname.lastname@example.org
Let’s start from Introduction.
Every day around the world, a large percentage of people die from traffic accident injuries. An influential indicator of survival rates after detecting the accident is the time between the occurrence of the accident and the arrival of emergency responders to the scene. Reductions in this time, in turn, may affect the numbers of fatalities, and this is achieved through using automatic traffic accident detection and notification systems which are either built-in the modern vehicles or available in the roads. In this system, it detects whether an accident occurs or not using an accelerometer and it notifies the phone with the Accident Location via SMS and Call through GSM Module.
We will do simulation on Proteus 8 Professional Software.
The working of this project is like, we will use a three axis accelerometer, which will detect the sudden change in acceleration in x, y and z axes. We will use ADXL335 in our project and Arduino UNO as the brains of this system.
First, we will take sample readings in a still position and take the average of them to get a reference value of x, y, and z axis accelerations, As explained in the void setup() section of code.
In the void loop() section we will continuously measure the change in acceleration in the x,y and z axis. If the value goes out of the range and crosses the threshold values, an accident would get detected.
In a used case, if the change in acceleration would be greater than a certain value(pre defined in the code), an accident would be detected. It would make a call to the registered mobile number(registered in the code) and send an SMS alert with the current location clickable link of google maps five times.
Block Diagram -
Requirements for Project -
- Arduino UNO
The Arduino Uno is a type of Arduino board that is provided as an open-source board that uses an ATmega328p microcontroller in the board. The Arduino Uno contains a set of analog and digital pins that are input and output pins which are used to connect the board to other components.
- GPS Module
This TinyShield is based on the Telit JF2 GPS Module, which uses the popular SiRFstar IV chipset. This module is configured by default to output GPS strings in the NMEA format at a 1Hz update rate (this can be changed to a 5HZ updated with a NMEA command).
- ADXL 335 Accelerometer
The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal conditioned voltage outputs. The product measures acceleration with a minimum full-scale range of ±3 g.
- GPRS Module
GSM GPRS Modules are one of the commonly used communication modules in embedded systems. A GSM GPRS Module is used to enable communication between a microcontroller (or a microprocessor) and the GSM / GPRS Network. Here, GSM stands for Global System for Mobile Communication and GPRS stands for General Packet Radio Service.
You can use Batteries, Adapter or any DC power source of 5v (most suggestable).
Circuit Diagram -
Since, we are making a prototype of this project, so we will make connections on the breadboard and avoid soldering the components. We will use male to male, male to female and female to female jumper wires.
These are the pin connections of all components.
X - A1 (Arduino)
Y - A2 (Arduino)
Z - A3 (Arduino)
- GPS Module
Tx - 10 (Arduino)
- GPRS Module
Rx - 3 (Arduino)
You can get the fully explained code for the link below.
Here is the link…
Paste code link here.
Note - Must Install the TinyGPS++ Library from the IDE.
We have added comments in code for better understanding so can be understood easily.
We will show you a demo of this project as a simulation,
We are using Proteus 8 Professional Software for the simulation.
Pre Requirements - Must install the Proteus Libraries of the required components from the given links below.
Proteus Software Download from here - Download Proteus - Try Proteus EDA Software - Labcenter Electronics
GPS Library for Proteus - GPS Library for Proteus - The Engineering Projects
GPRS Library for Proteus - GSM Library for Proteus - The Engineering Projects
Note - We will use three potentiometers instead of ADXL335 in simulation because the ADXL335 component is not available in this version. So we can alter the readings by potentiometer and it will work exactly like ADXL335.
Steps for Simulation-
These are the steps for simulation. Follow them to create a fully working simulation.
- Download the Zip Files which are given above.
- Extract them in the LIBRARY Folder. You will find it inside the Labcenter Electronics Folder.
- Go to Arduino IDE and open the code, go to Tools and select the board Arduino UNO.
- Go to Sketch and Click on Export Compiled Binary. It will create a compiled .hex file of the code which will be used as a main program in the simulation ahead.
- Open the Proteus Software and make a new project, select the project location and click on Next until the project is created.
- Click here to add components.
- Add components by searching Arduino, GPS Module and GSM Module respectively.
You can see the components listed here.
- Make connections according to the circuit diagram and add virtual terminals to Software serial and Hardware Serial to see the readings and Data.
- Paste the Program File here for both GPS and GPRS Module.
- Paste the Compiled Binary File as a Program file of Arduino UNO.
- Run the simulation and you can see the readings by opening virtual terminals.
- Increase or decrease any potentiometer and make the reading to cross the threshold values to observe the accident condition in the simulation.
You can see the AT commands sent to the GSM Module in the third terminal when the accident condition is satisfied.
That’s it in the simulation part.
You can download the complete project at the end of this article.
Observations and Results
In this simulation and project, you can see that first we get the readings of all the axis acceleration as an average of 10 samples in still case.
After that we are getting a change in acceleration readings of all the three axes continuously in real time.
We can see the real time NMEA Data which is continuously sent by GPS to Arduino.
Since we setted the minimum and maximum threshold values of change in acceleration in the code part, when we cross the threshold values, the accident condition is satisfied and AT commands are sent to the GSM Module which sends a SMS and call alert with Accident Location is sent to the user five times.
On clicking the location link in the SMS Alert, it redirects to Google Maps on which the accident location is shown.
That is the end of the project. We hope you liked it. Thanks for reading this article.
Contact - Tushar Gupta
Email - email@example.com
For any kind of queries and doubts.
You can go to the Full Article from here - Accident Detection System with Arduino UNO - Google DocsAccident Detection with Arduino UNO.rar (93.6 KB)