Arduino Based Accident Alert System
Arduino Based Accident Alert System
ABSTRACT:
In our busy life most of the fatal accidents occur due to over speeding. Faster vehicles are more prone
to accident than the slower one’s and the severity of accident will also be more in case of faster
vehicles. Thus we have prepared a device to reduce accidents and sends the information to the
registered number and police station.
Our device is fixed for every vehicle that should control speed , speed limit and alert us when
accident takes place.
On daily basis we are listening that , an unknown person has been hit by an unknown vehicle at the
city outskirts or on the roadside. In case the vehicle hits any obstacle like dividers or an unfortunate
accident occurs this device gives a beep sound and sends the location with exact lattitude and
longitude in the form of google maps URL to registered number. When we install this on the vehicle ,
GPS location is automatically sent to registered numbers and police station for help Then the
person’s concerned family members would be knowing the information that so and so person met
with an accident at this particular place , by this information we hope we can save that person as well
as find the vehicle’s location also .
And if proper action is not taken to reach out to victims on time when an accident takes place can
lead to severe circumstances one of the reason could be that we don’t know the exact location of the
accident spot.
Hence , as a solution for this problem we made this project which sends an SMS and location to
registered mobile number which guides us to the spot where the accident took place so that proper
help could be provided on time.
COMPONENTS REQUIRED:
1. Arduino UNO board
2. GSM SIM800C module
3. GPS NEO6Mv2 sensor
4. Vibration Sensor (SW-420)
5. Connecting wires
6. Bread Board
7. Charging adaptor
DESCRIPTION:
1. Arduino UNO Board:
It is a microcontroller where the program is uploaded.
It acts as the brain of the project which connects and enables all the sensors and
modules
All the connections are to be made to this Arduino Board itself.
PROGRAM:
#include <Wire.h>
#include <TinyGPS.h>
#include <SoftwareSerial.h>
SoftwareSerial GSM(2,3);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;
long measurement;
char inchar; // Will hold the incoming character from the GSM shield
int vs = A0;
int buz = 13;
int stop = 0;
void setup(){
pinMode(vs, INPUT);
Serial.begin(9600);
Wire.begin();
pinMode(buz, OUTPUT);
GSM.begin(9600);
Serial.begin(9600);
Serial.println("Initializing....");
initModule("AT","OK",1000);
initModule("ATE1","OK",1000);
initModule("AT+CPIN?","READY",1000);
initModule("AT+CMGF=1","OK",1000);
initModule("AT+CNMI=2,2,0,0,0","OK",1000);
Serial.println("Initialized Successfully");
GSM.print("AT+CMGS=\"");GSM.print(phone_no[1]);GSM.println("\"\r\n");
delay(1000);
GSM.println("Welcome to Arduino Based Vehicle Accident Alert System using GPS, GSM,
Shock Sensor.");
delay(300);
GSM.write(byte(26));
delay(3000);
getGPS();
}
void loop(){
long measurement = vibration();
delay(1000);
Serial.println(measurement);
if(GSM.available() >0){inchar=GSM.read();
if(inchar=='R'){inchar=GSM.read();
if(inchar=='I'){inchar=GSM.read();
if(inchar=='N'){inchar=GSM.read();
if(inchar=='G'){
GSM.print("ATH\r");
delay(1000);
getGPS();
GSM.print("AT+CMGS=\"");GSM.print(phone_no[1]);GSM.println("\"\r\n");
delay(1000);
GSM.println("RING Reply");
GSM.print("http://maps.google.com/?q=loc:");
GSM.print(LAT/1000000,7);
GSM.print(",");
GSM.println(LON/1000000,7);
delay(300);
GSM.write(byte(26));
delay(5000);
}
}
}
}
long vibration(){
long M = pulseIn(vs,HIGH);
return M;
}
void sms(){
getGPS();
GSM.print("AT+CMGS=\"");GSM.print(phone_no[1]);GSM.println("\"\r\n");
delay(1000);
GSM.println("Emergency.Please reach out to this location right away...");
GSM.print("http://maps.google.com/?q=loc:");
GSM.print(LAT/1000000,7);
GSM.print(",");
GSM.println(LON/1000000,7);
delay(300);
GSM.write(byte(26));
delay(5000);
}
void getGPS(){
bool newdata = false;
unsigned long start = millis();
// Every 1 seconds we print an update
while (millis() - start < 1000){
if (feedgps ()){
newdata = true;
}
}
if (newdata){
gpsdump(gps);
}
}
bool feedgps(){
while (Serial.available()){
if (gps.encode(Serial.read()))
return true;
}
return 0;
}
GSM SIM800C
SW -420
Vcc Tx Rx GND
VCC(+5V)
Vcc A0 GND
GND
ARDUINO UNO GPS 6Mv2
A0
Vcc Tx Rx GND
3
TX
RX