Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Accident Detection and Alert System with GPS and GSM

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Accident Detection and Alert System with GPS and GSM

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to detect impacts and send alerts via SMS using a SIM800L module. The circuit includes various components such as an Arduino UNO, GPS module, Bluetooth module, accelerometer, motor driver, and more. The Arduino UNO serves as the central microcontroller, interfacing with all other components to perform the required tasks.

Component List

  1. Neo 6M GPS Module

    • Pins: GND, TX, RX, VCC
    • Description: GPS module used for obtaining location data.
    • Purpose: Provides GPS coordinates for alert messages.
  2. Sim800l

    • Pins: NET, RST, VCC, RXD, TXD, GND
    • Description: GSM module used for sending SMS and making calls.
    • Purpose: Sends alert messages and makes emergency calls.
  3. Buzzer

    • Pins: +, GND
    • Description: Audio alert device.
    • Purpose: Provides an audible alert when an impact is detected.
  4. Motor and Wheels

    • Pins: vcc, GND
    • Description: Motor and wheel assembly.
    • Purpose: Provides mobility to the system.
  5. Arduino UNO

    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
    • Description: Microcontroller board.
    • Purpose: Central control unit for the circuit.
  6. LED: Two Pin (red)

    • Pins: cathode, anode
    • Description: Red LED.
    • Purpose: Visual indicator.
  7. Resistor

    • Pins: pin1, pin2
    • Description: 200 Ohms resistor.
    • Purpose: Current limiting for the LED.
  8. MPU6050 Accelerometer + Gyroscope (Wokwi Compatible)

    • Pins: INT, AD0, XCL, XDA, SDA, SCL, GND, VCC
    • Description: Accelerometer and gyroscope module.
    • Purpose: Detects impacts and measures orientation.
  9. L298N DC Motor Driver

    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
    • Description: Dual H-Bridge motor driver.
    • Purpose: Controls the motors.
  10. HC-05 Bluetooth Module

    • Pins: Key, VCC, TXD, RXD, State, GND
    • Description: Bluetooth module.
    • Purpose: Wireless communication.
  11. Battery 18650

    • Pins: +, -
    • Description: Rechargeable lithium-ion battery.
    • Purpose: Power supply for the circuit.

Wiring Details

Neo 6M GPS Module

Sim800l

Buzzer

Motor and Wheels

Arduino UNO

LED: Two Pin (red)

Resistor

MPU6050 Accelerometer + Gyroscope (Wokwi Compatible)

L298N DC Motor Driver

HC-05 Bluetooth Module

Battery 18650

Documented Code

#include <AltSoftSerial.h>
#include <TinyGPS++.h>
#include <Wire.h>
#include <math.h>
#include <SoftwareSerial.h>

const String EMERGENCY_PHONE = "+91xxxxxxxxxx";
#define rxPin 2
#define txPin 3

SoftwareSerial sim800(rxPin, txPin);
AltSoftSerial neogps;
TinyGPSPlus gps;

// RX Pin To D9
// TX Pin To D8

String sms_status, sender_number, received_date, msg;
String latitude, longitude;
#define BUZZER 5
#define BUTTON 6
#define xPin A0
#define yPin A1
#define zPin A2

byte updateflag;

int xaxis = 0, yaxis = 0, zaxis = 0;
int deltx = 0, delty = 0, deltz = 0;
int vibration = 2;
int devibrate = 75;
int magnitude = 0;
int sensitivity = 20;

double angle;
boolean impact_detected = false;
unsigned long time1;
unsigned long impact_time;
unsigned long alert_delay = 30000;

void setup()
{
  Serial.begin(9600);
  sim800.begin(9600);
  neogps.begin(9600);
  pinMode(BUZZER, OUTPUT);
  pinMode(BUTTON, INPUT_PULLUP);

  sms_status = "";
  sender_number = "";
  received_date = "";
  msg = "";
  sim800.println("AT");
  delay(1000);
  sim800.println("ATE1");
  delay(1000);
  sim800.println("AT+CPIN?");
  delay(1000);
  sim800.println("AT+CMGF=1");
  delay(1000);
  sim800.println("AT+CNMI=1,1,0,0,0");
  delay(1000);
  time1 = micros();
  xaxis = analogRead(xPin);
  yaxis = analogRead(yPin);
  zaxis = analogRead(zPin);
}

void loop()
{
  if (micros() - time1 > 4999) Impact();