1. Acceleration Reading
The MPU6050 reads acceleration values on the X, Y, and Z axes.
Senior Project
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.
About The Project
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.
Python reads acceleration values, calculates total_accel, and runs the model.
Confirmed alerts include a Google Maps link only when GPS data is available.
System Workflow
The MPU6050 reads acceleration values on the X, Y, and Z axes.
Raspberry Pi 3 calculates total_accel from the live acceleration readings.
If total_accel is 1.8g or higher, the data is passed to the Decision Tree model.
An accident is confirmed only after two consecutive accident predictions.
After confirmation, the GPS module attempts to retrieve latitude and longitude.
Blynk sends an emergency alert with a Google Maps link if coordinates are available.
Hardware Components
Main processing unit running Python and the AI model.
Measures acceleration on X, Y, and Z axes.
Attempts to retrieve latitude and longitude after accident confirmation.
Sends emergency alerts to the user.
Classifies movement as Accident or No Accident.
AI System
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.
total_accel below 1.8g is considered normal movement
Features: accel_x, accel_y, accel_z, and total_accel
Values at 1.8g or higher are passed to the AI model
Decision Tree classifies movement as Accident or No Accident
Two consecutive accident predictions confirm the alert
Blynk Notifications
Blynk sends an emergency notification when the system confirms a possible accident.
If GPS coordinates are available, the alert includes a Google Maps location link.
If GPS is unavailable, the emergency alert is still sent without location details.
The Raspberry Pi connects the physical prototype to Blynk for user notifications.
Features
Future Enhancements