Abstract: This paper aims to improve road safety by detecting vehicle accidents in real time and sending immediate alerts. It uses the STM32F446RE microcontroller to collect data from the MPU6050 sensor, which tracks motion and orientation, and the NEO-6M GPS module, which provides the vehicle’s exact location. When a sudden impact or unusual movement is detected, the system sounds a buzzer, stops the vehicle’s engine using a relay, and sends important details such as impact level, time, and location to the RuggedBoard A5D2X. The A5D2X then forwards this information to the ThingsBoard cloud using the MQTT protocol, enabling emergency services to be notified quickly. This project integrates sensors, microcontrollers, and cloud technology to reduce response time and improve accident location accuracy. It provides a reliable and scalable solution for intelligent transportation, with future scope for predictive analysis and GSM/GPRS-based connectivity.
Keywords: Accident Detection System, IoT, STM32F446RE, MPU6050, NEO-6M
GPS, RuggedBoard A5D2X, Real-Time Monitoring, ThingsBoard, MQTT Protocol,
Emergency Alert System, Cloud Connectivity, Intelligent Transportation.
I. INTRODUCTION
Road accidents continue to be a major global
concern, causing a significant number of fatalities and severe injuries each
year. Delayed detection and response times often exacerbate the impact of these
accidents, resulting in increased casualties. Traditional accident reporting
methods, such as relying on eyewitnesses or manual alerts, can be inefficient
and unreliable in critical situations. The need for an automated, real-time
accident detection system has never been more pressing.
To address this, this paper presents an
IoT-Based Intelligent Vehicle Accident Detection and Alert System designed to
enhance road safety. By leveraging the capabilities of modern embedded systems,
sensors, and cloud computing, the system aims to reduce response time and
improve the efficiency of emergency operations.
The system integrates the STM32F446RE
microcontroller with an MPU6050 accelerometer and gyroscope for motion
tracking, and a NEO-6M GPS module for real-time location detection.
When an accident occurs, the system
automatically activates a buzzer for immediate audio notification, cuts off the
vehicle's engine to prevent further movement, and sends accident data such as
impact intensity, timestamp, and GPS coordinates via UART to the RuggedBoard
A5D2X. The board processes the data and transmits it to the ThingsBoard cloud
platform using the MQTT protocol for real-time monitoring and emergency
notifications.
This integrated approach not only improves
emergency response times but also ensures accurate accident location tracking.
The system represents a significant step toward smarter transportation safety,
with future potential for machine learning-based predictive analysis and
extended communication using GSM/GPRS technology.
II. LITERATURE SURVEY
This literature review explores previous
research and advancements in IoT-based vehicle accident detection systems. The
focus is on sensor technologies, communication protocols, GPS-based tracking,
and emergency alert mechanisms. These studies help in identifying technological
gaps and in shaping the proposed system design.
1. Accident Detection and Reporting Using GPS, GPRS, and GSM (2012,
IEEE)
This study utilizes GPS to monitor vehicle
speed and detect accidents based on sudden speed drops. When a significant
deceleration is identified, the system assumes a potential crash and sends the
GPS location and time via GSM to an alert service center. A 5-second window is
provided to cancel false alarms. This system eliminates the need for
speedometers by directly calculating speed from GPS data.
2. Real-Time Detection and Reporting of Vehicle Collisions (2017, IEEE)
This work uses an accelerometer and gyroscope
to detect orientation changes and impacts. When a threshold angle or
acceleration force is exceeded, the system identifies a collision or vehicle
rollover. Alerts are then sent via GSM to family members and the nearest
hospital. GPS data is used to confirm location accuracy and eliminate false
positives.
3. Vehicle Accident Detection Using GSM, GPS, and Sensors (2019, IRJET)
This paper employs a piezoelectric sensor to
detect collisions based on voltage spikes generated during impact. When the
voltage exceeds a set threshold, the system captures GPS coordinates and
transmits them via GSM to the rescue team. A Google Maps module is used to
visualize accident locations. An emergency switch is included to prevent false
alerts.
Table.1. Comparison Between
Research Papers
III. METHODOLGY
The intelligent vehicle accident detection and alert system is
designed using STM32F446RE as the main controller along with MPU6050 sensor,
NEO-6M GPS module, DC motor, buzzer, 16x2 I2C LCD, RuggedBoard A5D2X, and
Ethernet cable. The system is explained using a block diagram. The STM32 board
is the main focus for sensor data and control. For accident detection, we used
the MPU6050 sensor which detects acceleration and angular motion in different
directions like front, back, left, right, and upside-down. Threshold values are
set to identify accidents from regular motion. The NEO-6M GPS module gets the
location of the vehicle and sends it when an accident is detected. The DC motor
is connected and used to simulate vehicle movement. A buzzer is connected to
STM32 pins PA5 and PA6 to give sound alerts during an accident. The LCD shows
messages like "Vehicle Running - No Accident" and "Vehicle
Stopped - Accident Detected". The data is sent from STM32 to RuggedBoard
A5D2X through UART. The RuggedBoard sends accident alerts and GPS data to the
cloud using MQTT over Ethernet. This system helps in real-time accident
detection and cloud-based alerting.Power is supplied to the components through
a regulated source to ensure stable operation.The firmware includes logic to
continuously compare motion data against set thresholds.This integration of
hardware and software ensures a compact, responsive, and intelligent embedded
system.
Figure.1. Block Diagram of Vehicle accident
detection and alert system
IV. MODELLING OF THE SYSTEM
Firmware is a computer program embedded into
hardware and plays a vital role in controlling the behavior of embedded
systems. In our project, the embedded firmware is developed for the STM32F446RE
microcontroller, which is responsible for reading sensor data, detecting
accidents, and controlling other components. This firmware acts as the bridge
between hardware and software, similar to how an operating system functions in
a computer. It runs continuously to monitor data from connected modules and
make real-time decisions based on pre-defined conditions.
The STM32 executes the logic that controls the
MPU6050 sensor, which detects abnormal motion such as sudden impact, tilting,
or flipping. Based on acceleration and gyroscope data, the system identifies
whether an accident has occurred. Once an accident is detected, the STM32
triggers the buzzer connected to PA5 and PA6 for alerting, updates the message
on the 16x2 I2C LCD, and stops the motor to simulate vehicle shutdown. At the
same time, the GPS NEO-6M module fetches the location data (latitude and longitude).
This information is transmitted through UART to
the RuggedBoard A5D2X, which sends the accident data to the ThingsBoard cloud
via MQTT using Ethernet. This enables remote monitoring and real-time alerts
for emergency response. The overall flow of the system is continuous: STM32
reads data from the MPU6050 in a loop. If no accident is detected, the vehicle
continues to run normally. If an accident is detected, the motor is stopped,
alerts are triggered, and location data is sent to the cloud.To ensure robustness,
error-checking mechanisms are included in the UART communication.
The firmware is optimized for low-latency response, ensuring immediate reaction
during critical events.
Modular code design also allows easy firmware updates and scalability for
future enhancements.
Figure.2.
Flowchart of the overall system.
V. DATA COLLECTION
Efficient data collection and processing are
essential for accurate decision-making and enhanced system performance in
vehicle safety applications. In the proposed Intelligent Automatic Vehicle
Accident Detection System, sensor data is collected using the STM32F446RE
microcontroller, which interfaces with critical components such as the MPU6050
accelerometer/gyroscope, NEO-6M GPS module, relay module, and buzzer.
The system employs a polling technique, where
the microcontroller continuously reads sensor values to monitor sudden changes
in movement or orientation. Although effective, this method could be optimized
in future versions by incorporating interrupt-based techniques, which would
improve responsiveness and reduce power consumption by reacting only to
significant events.
This paper addresses a significant real-world
issue: reducing fatalities and injuries from road accidents due to delayed
emergency responses. According to the World Health Organization (WHO), millions
of lives are lost each year in traffic-related incidents. By enabling real-time
accident detection and transmitting alerts with precise location data, the
system supports the United Nations Sustainable Development Goal (UN SDG) 3.6,
which aims to halve the number of global road traffic deaths and injuries.
When the MPU6050 detects unusual movement or an
impact exceeding a defined threshold, the STM32F446RE immediately activates a
buzzer, cuts off the engine via a relay, and transmits critical data including
acceleration, gyroscope readings, and GPS coordinates via UART communication to
the RuggedBoard A5D2X. The RuggedBoard then forwards this information to the
ThingsBoard IoT platform.
In future enhancements, the system could
integrate machine learning algorithms to predict risky driving behavior and
biometric sensors to monitor the driver’s physical condition after an accident.
This intelligent and connected architecture highlights the transformative
potential of embedded IoT in building smarter, safer transportation ecosystems.
Table.2. Data log
VI. PROPOSED SYSTEM
The proposed system is an IoT-enabled,
real-time Intelligent Vehicle Accident Detection and Alert System designed to
automatically detect vehicle collisions and promptly notify emergency services
and relevant stakeholders. This system aims to minimize the delay between the
occurrence of an accident and the emergency response, thereby reducing
fatalities and the severity of injuries. At the core of the system is the
STM32F446RE microcontroller, which manages data acquisition, processing, and
control logic. The system interfaces with the following key components:
a. STM32F446RE
The STM32F446RE microcontroller serves as the central processing
unit of the system, handling critical tasks such as data acquisition,
processing, and communication. It continuously monitors data from the MPU6050
sensor and the NEO-6M GPS module. When sensor data indicates a potential
accident such as a sudden impact, extreme tilt, or abrupt movement exceeding
predefined threshold values, the STM32F446RE initiates the accident response
mechanism. This includes activating the buzzer, shutting down the engine via
the relay, and transmitting crucial data, such as location and movement
details, to the RuggedBoard A5D2X for further processing and cloud integration.
The STM32F446RE features high-performance ARM Cortex-M4
architecture, enabling fast and efficient signal processing. It supports
multiple UART interfaces, allowing seamless communication with peripherals like
GPS and other external boards. Its low-power consumption and integrated timers
make it suitable for real-time embedded applications in automotive safety
systems.
b. MPU6050 SENSOR
The MPU6050 sensor is essential for the
accident detection mechanism of the system. This 6-axis motion sensor
integrates a 3-axis accelerometer and a 3-axis gyroscope, enabling it to
continuously monitor the vehicle’s motion and orientation. In the event of a
collision, rapid deceleration, or abnormal tilt, the sensor sends data to the
STM32F446RE microcontroller. If the data surpasses predefined thresholds, the
system interprets this as an accident. Upon detection, the system triggers
immediate actions, including activating the buzzer, shutting down the engine,
and sending critical data to the cloud for further analysis. The sensor’s
precision ensures reliable real-time detection of various accident scenarios,
including frontal collisions, side impacts, and rollovers.
c. RUGGED BOARD A5D2X
The RuggedBoard A5D2X acts as an intermediary
between the STM32F446RE microcontroller and the cloud platform. It receives
accident-related data such as acceleration, orientation, and GPS coordinates
from the microcontroller via UART communication. The RuggedBoard subsequently
transmits this data to a cloud-based platform, such as ThingsBoard, for
real-time monitoring and further analysis. The cloud integration allows
emergency responders to access critical information promptly, enhancing
response time and coordination.
d. CLOUD MONITORING
Cloud monitoring is a key feature of the
system, enabling remote access to both real-time and historical accident data.
After the STM32F446RE microcontroller processes data from the MPU6050 sensor
and the NEO-6M GPS module, the data is transmitted to the RuggedBoard A5D2X for
forwarding to a cloud platform. Cloud platforms, such as ThingsBoard, allow for
secure storage, visualization, and analysis of the data, providing emergency
services with immediate access to important accident information, including vehicle
status, location, and impact details. This cloud-based solution ensures
efficient monitoring, faster response times, and seamless coordination with
emergency teams.
e. ALERTING AND CONTROL MECHANISMS
In the event of an accident, the system
activates a series of alerting and control mechanisms. A buzzer emits an
audible alert to notify passengers and bystanders of the detected collision,
while a relay module, in conjunction with a DC motor, is used to shut down the
vehicle’s engine and prevent further damage or hazards. Simultaneously, a 16x2
I2C LCD display provides real-time status updates, displaying messages such as
"Vehicle Running - No Accident" or "Vehicle Stopped - Accident
Detected." These mechanisms ensure that both vehicle occupants and nearby
individuals are immediately alerted, and the vehicle is safely brought to a
stop.
Figure.3. Connection diagram of Accident
detection and Alert system
VII. IMPLEMENTATION
a.
Sensor
and GPS Module Connections
The MPU6050 accelerometer and gyroscope sensor
is connected to the STM32 via I2C (PB6 and PB7) to detect movements,
vibrations, or crashes. The same I2C lines are shared with the 16x2 LCD
display, which shows system messages. The NEO-6M GPS module connects to the
STM32 via UART (PA3 for RX and PA2 for TX) to provide real-time location data,
including latitude and longitude, which are crucial for determining the
accident location.
b.
Relay,
DC Motor, and Buzzer Connections
The relay module, connected to STM32 pin PA6,
controls the DC motor, simulating the vehicle engine. In case of an accident,
the STM32 deactivates the relay to stop the motor. The buzzer, connected to
PA5, sounds an alert during an accident.
c.
UART
Communication with RuggedBoard
The STM32 communicates with the RuggedBoard
A5D2X via UART. The TX (PA9) and RX (PA10) pins of the STM32 send sensor data
and GPS coordinates (latitude and longitude) to the RuggedBoard, which then
sends the data to the ThingsBoard Cloud using MQTT over Ethernet.
d.
Working
of the System
The STM32 monitors the MPU6050 sensor for any
abnormal motion. If an accident occurs, the system stops the motor (PA6),
activates the buzzer (PA5), and shows "Accident Detected – Vehicle
Stopped" on the LCD. The system also sends the GPS location (latitude and
longitude) to the RuggedBoard via UART. If no accident occurs, the vehicle runs
normally, and the LCD shows "Vehicle Running – No Accident."
Figure.4.Interfacing controller with all other module
VIII. RESULTS AND DISCUSSION
This chapter presents the methodology adopted
for the design, development, and implementation of the IoT-Based Intelligent
Automatic Vehicle Accident Detection System. It details the research design,
data collection techniques, system development, testing procedures, and
performance evaluation criteria to ensure system accuracy and reliability. The
study follows an experimental research approach, where a prototype was
developed and tested under real-world conditions.
1. Reading Data from MPU-6050 Module
The MPU-6050 is a combined 3-axis gyroscope and
3-axis accelerometer based on MEMS (Micro-Electro-Mechanical Systems)
technology. It is connected to the STM32F446RE microcontroller using the I2C
communication protocol. To verify the connection, I2C communication was tested
by writing code that initializes the I2C and UART, and reads data from the
relevant registers.
Figure.5. MPU 6050 Data reading
2. Validating UART Communication Between STM32
and RuggedBoard
UART (Universal Asynchronous Receiver/Transmitter) communication is
established between the STM32F446RE microcontroller and the RuggedBoard A5D2X
for transferring sensor and GPS data. The STM32 uses two UART channels: UART1
for GPS data and UART2 for communication with the RuggedBoard.The data sent
includes gyroscope and accelerometer values, as well as GPS coordinates.This
real-time data is processed and displayed on the RuggedBoard, which further
enables cloud connectivity.The use of dual UART channels ensures efficient and
parallel handling of both sensor and location data streams.
Figure.6. UART Communication
3. Cloud Data Logging and Visualization
Cloud data logging and visualization play a
crucial role in monitoring the IoT-Based Intelligent Vehicle Accident Detection
System. The system transmits real-time sensor data, including vehicle status
and location, to the ThingsBoard Cloud for remote monitoring and analysis.
Figure.7. Cloud Data logging
4. Location Data Reading from GPS Module
The U-blox NEO-6M GPS module is used to acquire
real-time location data. It communicates with the STM32F446RE microcontroller
over UART and sends data in NMEA sentence format, which includes latitude,
longitude, and time. The onboard LED provides visual feedback, blinking rapidly
when searching for satellites and once per second when a position fix is
acquired. The STM32 parses this data, extracts the GPS coordinates, and
transmits the information to the RuggedBoard A5D2X for further processing and
remote visualization through the ThingsBoard Cloud.
Figure.8. GPS Data reading.
5. Verifying LCD Display Output
The system includes a 16x2 LCD connected via an
I2C module, which minimizes pin usage. The LCD displays system messages based
on real-time sensor input. During normal operation, it shows "Vehicle
Running – No Accident." In case of an accident, the LCD displays
"Accident Detected – Vehicle Stopped."
Figure.7. LCD Display Output Testing
6. Full System Integration Testing
After individual module testing, the entire
system was integrated and tested for operation. This included the MPU-6050
sensor, GPS module, buzzer, relay, LCD display, and UART communication
interface. When an accident was simulated by shaking or tilting the sensor, the
system responded by activating the buzzer, stopping the motor through the
relay, updating the LCD display, and sending all sensor and location data to
the RuggedBoard for remote monitoring.
Figure.9. Full System Integration Test
7. Scalability and Future Enhancement
Thank for Information about project
ReplyDelete