Skip to content
 
 

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🚗 ESP32 Real-Time Accident Detection System

A compact IoT project using ESP32, MPU6050, GPS, and Piezo sensor for real-time crash detection with automatic fuel cutoff, buzzer alert, and Twilio SMS for alert reporting.


Hardware Setup

Component ESP32 Pin / Power Purpose
MPU6050 SDA → 21, SCL → 22 Detects acceleration, jerk, tilt
NEO-6M GPS TX → 16 (RX2), RX → 17 (TX2) Location & speed
Piezo Sensor Signal → 34 Detects seat vibration / presence
Buzzer + → 18 Sounds alarm
IRFZ44N MOSFET + LED Gate → 23 Simulates fuel cutoff
ESP32 USB Main controller & data processor

Core Logic

  1. MPU6050 samples acceleration & rotation at ~200 Hz.
  2. Removes gravity to extract pure linear motion.
  3. Piezo plate confirms driver presence before triggering.
  4. Accident triggers if:
    • a > 2 g, jerk > 8 g/s, or gyro > 300 °/s.
  5. Severity levels:
    • Minor: ≥ 2 g
    • Moderate: ≥ 3 g
    • Severe: ≥ 5 g
  6. On crash → buzzer ON, fuel OFF, SMS.

NOVELTY

  • Dual-layer crash validation using motion + seat-presence sensing (piezo sensor)
  • Physics-based crash modeling using acceleration, jerk, and angular rotation together
  • Gravity-compensated IMU processing at 200 Hz for true linear acceleration
  • Actual hardware safety action via MOSFET-based fuel cutoff simulation

image MOSFET

VERSION 2:

image image image

WEARABLE UNIT:

image image

VEHICLE UNIT:

WhatsApp Image 2026-05-01 at 2 53 38 PM

Working

The system consists of a wearable unit and a vehicle-mounted unit. Sensors like MPU6050, ADXL345, and piezo sensors capture motion and impact data. This data is processed using ESP32/Arduino to detect crash events and estimate severity. If a critical event is detected, GPS location is sent via alerts and a fuel cutoff mechanism is triggered.

Tech Stack

  • ESP32 / Arduino
  • MPU6050, ADXL345, GPS, Piezo Sensors
  • Embedded C++

How to Run

  1. Connect sensors to ESP32/Arduino
  2. Upload the firmware code
  3. Power the system
  4. Monitor output via serial console or alert system

Future Improvements

  • Cloud-based alert system
  • Mobile app integration
  • Improved crash classification models

Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.

About

Real-time ESP32 crash detector using MPU6050, GPS, piezo sensors, and MOSFET-based fuel cutoff for accurate severity alerts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages