Python-Programmed Embedded ECU for Drowsiness-Responsive Dynamic Braking in Electric Vehicles
DOI:
https://doi.org/10.47852/bonviewAIA62027474Keywords:
electric vehicles, driver drowsiness detection, fuzzy braking, Raspberry Pi Pico, Micro-Python, embedded ECUAbstract
Electric vehicles (EVs) are increasingly central to sustainable mobility, but braking control remains a safety-critical challenge. EVs must balance regenerative braking, which recovers kinetic energy, with dynamic braking, which ensures rapid deceleration in emergency situations. At the same time, driver drowsiness contributes to nearly one-fifth of serious accidents worldwide, underscoring the importance of systems that respond to external conditions and human states. This study presents a Python-programmed electronic control unit (ECU) on a Raspberry Pi Pico, integrating real-time driver drowsiness detection with adaptive braking control. Inputs from ultrasonic sensors, wheel encoders, and a camera-based drowsiness detection module are transmitted via the Message Queuing Telemetry Transport (MQTT) protocol. At the same time, a fuzzy inference engine processes driver condition, vehicle speed, and obstacle distance to generate proportional pulse width modulation (PWM) signals for motor braking. Experimental validation using a laboratory-scale prototype demonstrated distinct braking profiles under three conditions: slightly drowsy states produced proportional speed reductions as early warnings, drowsy states resulted in smooth full stops with consistent deceleration between 0.042 and 0.050 m/s², and emergency braking delivered rapid stops with shorter distances of 0.116 to 0.204 meters. While a 1-second latency was observed in some slightly drowsy runs, the system consistently adapted braking behavior and restored regular operation when drowsiness signals ceased. These findings validate that a Micro-Python-based ECU can reliably integrate behavioral monitoring with adaptive braking, offering a low-cost, scalable solution for future EV safety systems.
Received: 30 August 2025 | Revised: 15 December 2025 | Accepted: 3 January 2026
Conflicts of Interest
The authors declare that they have no conflicts of interest to this work.
Data Availability Statement
Data sharing is not applicable to this article as no new data were created or analyzed in this study.
Author Contribution Statement
Kalaivanan Kumaran: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Resources, Data curation, Writing – original draft, Writing – review & editing. Muhammad Nadzmi Razlan: Software, Validation, Investigation, Data curation, Writing – review & editing. Ahmad Safwan Abd Shukor: Software, Validation, Investigation, Data curation, Writing – review & editing. Mohamad Tarmizi Abu Seman: Conceptualization, Methodology, Resources, Writing – review & editing, Supervision, Project administration.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Authors

This work is licensed under a Creative Commons Attribution 4.0 International License.