Automatic Detection of Driving Distractions

GIF of a car dashboard

Enhancing Road Safety

GIF of a Raspberry Pi

Embedded Systems in Action

Introduction

This project, developed for the "Embedded System Modelling" course, implements an embedded system for the Automatic Detection of Driving Distractions. The primary goal is to enhance road safety by identifying signs of driver inattention through various sensors and responding with appropriate alerts or actions to re-engage the driver and mitigate potential risks.

GIF of a road

System Architecture

The system is comprised of sensors for data acquisition, a central processing unit for analysis, and actuators for driver feedback and intervention.

Sensors

Actuators

Processing Unit

A Raspberry Pi serves as the central processing unit, running the C code responsible for reading sensor data, implementing detection algorithms, and triggering actuators.

GIF of a warning light
GIF of computer code

Symptom Detection Logic

The system analyzes sensor data to identify distraction symptoms based on specific thresholds and polling intervals.

Symptom Sensor(s) Used Detection Criteria
Head Tilt Gyroscope X-axis or Y-axis tilt > ±30° for at least two consecutive readings.
Safety Distance Distance Sensor, Speedometer The actual distance is compared to a recommended safety distance calculated from speed. Three risk levels are defined: INSECURE, IMPRUDENT, and DANGER COLLISION.
Sharp Turn Steering Wheel Sensor, Speedometer Difference > 20° between two consecutive steering wheel readings while speed is > 40 km/h.

System Actions Logic

Every 200ms, the detected symptoms are analyzed to determine the necessary actions, creating a graduated alert system.

Condition Triggering Action Action(s) Undertaken
(S1 or S2) and D0 Turn on Yellow Light
(S1 and S2) and D0 Turn on Red Light
(S1 or S2) and D1 Turn on Yellow & Red Lights, Activate Brake Level 1
(S1 or S2) and D2 Turn on Yellow & Red Lights, Activate Brake Level 2
D3 Activate Brake Level 3

Conclusion

This project is a practical application of embedded systems to solve a real-world problem. By combining multiple data sources with reactive logic, it endeavors to make our roads safer by proactively detecting and mitigating risks associated with driver distraction.The project's source code is available here: GitHub - Automatic Detection of Driving Distractions.

GIF Problem solved