Driver Distraction Detection under Active Infrared Illumination on the ESP32: Hardware Customization and Geometric Optimization
Abstract
Driver distraction is the leading cause of traffic accidents, demanding driver assistance systems accessible to aging fleets in developing countries. This paper presents the development and performance evaluation of a low-cost edge computing node (Edge AI) for distraction detection based on the ESP32-CAM microcontroller. Configured as an applied and experimental research under the engineering method, this work proposes a solution for severe resource-constrained scenarios: physical customization of the optical sensor was performed for operation under active infrared illumination, and a geometric heuristic based on trigonometric thresholds was developed for attention state classification, acting as a low-latency and computationally lightweight alternative to traditional machine learning models. Additionally, the electronic design project (schematic and layout) of a customized aftermarket board is detailed. Empirical trials validated the feasibility of the proposed heuristic with an accuracy of 80.19% and mapped the absolute physical boundaries of the hardware, revealing a 30% failure rate in vertical tilts under the infrared spectrum, alongside local memory writing bottlenecks and RAM scarcity under Wi-Fi module concurrency. The work establishes a quantified baseline, demonstrating that the ESP32 ecosystem is viable for single-function road safety devices, while delineating the technological ceiling that requires a transition to platforms with dedicated neural coprocessing in multitask systems.