Senior Project

AI-Based Smart Accident Detection and Emergency Alert System

A Raspberry Pi and IoT-based safety system that monitors vehicle acceleration in real time, uses a Decision Tree AI model to detect possible accidents, attempts to retrieve GPS coordinates, and sends emergency notifications through the Blynk mobile platform.

Real Time Acceleration monitoring
Python AI Decision Tree model
Blynk IoT Mobile emergency alerts
AI smart vehicle IoT alert illustration A futuristic vehicle connected to AI, GPS, Raspberry Pi, and Blynk IoT alert nodes. Blynk GPS IoT AI

About The Project

Smarter accident detection when every second matters.

This project uses AI and IoT technologies to detect possible vehicle accidents. The MPU6050 sensor collects acceleration data, the Raspberry Pi 3 processes the readings, the Decision Tree model classifies the movement, and Blynk sends emergency alerts. GPS coordinates are included only if available.

cpu

Raspberry Pi Processing

Python reads acceleration values, calculates total_accel, and runs the model.

pin

GPS + Blynk Alerts

Confirmed alerts include a Google Maps link only when GPS data is available.

System Workflow

From motion sensing to emergency notification in real time.

axis

1. Acceleration Reading

The MPU6050 reads acceleration values on the X, Y, and Z axes.

cpu

2. total_accel Calculation

Raspberry Pi 3 calculates total_accel from the live acceleration readings.

brain

3. Threshold + AI

If total_accel is 1.8g or higher, the data is passed to the Decision Tree model.

alert

4. Accident Confirmation

An accident is confirmed only after two consecutive accident predictions.

gps

5. GPS Attempt

After confirmation, the GPS module attempts to retrieve latitude and longitude.

sms

6. Blynk Alert

Blynk sends an emergency alert with a Google Maps link if coordinates are available.

Hardware Components

Core devices used to sense, process, locate, and notify.

chip

Raspberry Pi 3

Main processing unit running Python and the AI model.

axis

MPU6050 Sensor

Measures acceleration on X, Y, and Z axes.

gps

GPS Module

Attempts to retrieve latitude and longitude after accident confirmation.

sync

Blynk IoT Platform

Sends emergency alerts to the user.

brain

Decision Tree Classifier

Classifies movement as Accident or No Accident.

AI System

Hybrid detection reduces false positives.

The Decision Tree Classifier was trained using a CSV dataset containing acceleration readings and labels. The selected features are accel_x, accel_y, accel_z, and total_accel. The system uses threshold filtering first, then AI classification. To reduce false positives, two consecutive accident predictions are required before sending an emergency alert.

01

total_accel below 1.8g is considered normal movement

02

Features: accel_x, accel_y, accel_z, and total_accel

03

Values at 1.8g or higher are passed to the AI model

04

Decision Tree classifies movement as Accident or No Accident

05

Two consecutive accident predictions confirm the alert

Blynk Notifications

Real-time IoT alerts keep the user informed immediately.

sms

Mobile Emergency Alerts

Blynk sends an emergency notification when the system confirms a possible accident.

loc

Google Maps Link

If GPS coordinates are available, the alert includes a Google Maps location link.

gps

GPS Fallback

If GPS is unavailable, the emergency alert is still sent without location details.

sync

Blynk IoT Platform

The Raspberry Pi connects the physical prototype to Blynk for user notifications.

Features

Built for fast detection and clear emergency action.

brain

AI Accident Detection

live

Real-Time Acceleration Monitoring

axis

Total Acceleration Calculation

alert

Two-Step Accident Confirmation

track

GPS Location If Available

sms

Blynk Emergency Alerts

chip

Raspberry Pi 3 Integration

Future Enhancements

Next steps for expanding the project beyond the prototype.

V2V communication Cloud database Smartphone application Advanced AI models such as CNN/LSTM Improved GPS module or active GPS antenna Testing on an actual vehicle