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

Arduino Based Accident Alert System

Uploaded by

Deepthi P
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Arduino Based Accident Alert System

Uploaded by

Deepthi P
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

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.

2. GSM SIM800C Module:


 GSM stands for “Global System for Mobiles”
 GSM SIM800C is a module in which the sim card is to be inserted
 The work of this module is to send /receive SMS .
 In this system it sends an SMS to the registered mobile number which has location of
the accident spot which is provided by GPS sensor.
 It has totally 4 pins : Vcc (+5V) , Tx , Rx ,GND.

3. GPS NEO6Mv2 Sensor:


 GPS stands for “Global Positioning System”.
 GPS NEO6Mv2 sensor is a sensor which senses the latitude and longitude of the
position of device through which the location can be extracted.
 In simple words this sensor gives us the location of the vehicle/device.
 It has totally 4 pins : Vcc (+5V) , Tx , Rx ,GND.

4. Vibration Sensor (SW-420):


 As the name suggests this sensor senses the vibration around the device.
 If the vibration value is greater than the threshold value then it triggers GPS and GSM
sensor to send the location as SMS .
 It has 3 pins : Vcc(+5V) , GND , A0(Analog output)

PROGRAM:

#include <Wire.h>
#include <TinyGPS.h>
#include <SoftwareSerial.h>

unsigned long fix_age;

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;

const char *phone_no[] = {


"+91XXXXXXXXX"
};

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(measurement > 2000){


sms();
Serial.println("SMS SENT SUCCESSFULLY");
}

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 lat, lon;


unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;
// retrieves +/- lat/long in 1000000ths of a degree
gps.get_position(&lat, &lon, &fix_age);

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;
}

void gpsdump(TinyGPS &gps){


//byte month, day, hour, minute, second, hundredths;
gps.get_position(&lat, &lon);
LAT = lat;
LON = lon;
{
feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get
checksum errors
}
}

void initModule(String cmd, char *res, int t){


while(1){
Serial.println(cmd);
GSM.println(cmd);
delay(100);
while(GSM.available()>0){
if(GSM.find(res)){
Serial.println(res);
delay(t);
return;
}else{Serial.println("Error");}}
delay(t);
}
}
CIRCUIT DIAGRAM :

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

You might also like