Accident Detection System

Real-Time Alert System Powered by MPU6050 & A9G GPS

Accident Detection System

Project Overview

This project is a real-time accident detection and alert system designed for vehicle safety. It utilizes the MPU6050 motion sensor to detect unusual acceleration or impacts that might indicate a crash. Upon detection, it fetches the GPS location using the A9G module and sends an SMS alert with location data to predefined emergency contacts.

How It Works

▶️ Watch Video on Drive

Code Overview

📡 Code 1: A9G GPS Finder

Purpose: To validate GPS functionality and fetch real-time location data from the A9G module using AT+LOCATION=2.

// Initialize UART
Serial1.begin(115200);

// Enable GPS
Serial1.println("AT+GPS=1");

// Request location repeatedly
Serial1.println("AT+LOCATION=2");

Use Case: Standalone script to test GPS signal lock before deploying in main code.

📶 Code 2: A9G GSM Test & SMS Sender

Purpose: To test SIM communication, send SMS, and place calls through the A9G module.

// Set SMS to text mode
Serial1.println("AT+CMGF=1");

// Send test SMS
Serial1.print("AT+CMGS=\"+91XXXXXXXXXX\"\r");
Serial1.print("Hi Test Message From Ai Thinker A9 Module");
Serial1.write(0x1A); // End message (CTRL+Z)

// Make a call
Serial1.print("ATD+91XXXXXXXXXX;\r");

Use Case: Verify GSM-side functionality — calling, texting, and SIM readiness before full integration.

Tech Stack

MPU6050 A9G GPS/GSM Module Arduino Mega / ESP32 UART Arduino IDE
⬅ Back to Portfolio