Edge-based danger detection system using phrase recognition on STM32 microcontroller with FreeRTOS and GSM communication
Personal safety systems increasingly rely on artificial intelligence for hands-free distress detection, yet most existing solutions depend on cloud-based processing, raising privacy concerns and requiring stable internet connectivity. This paper presents a complete edge-based danger detection system implemented on the STM32 B-U585I-IOT2A microcontroller, which recognises a user-defined spoken phrase entirely on-device and triggers an emergency SMS alert via a GSM SIM900A module. The system employs a lightweight depthwise separable CNN (60.42 kB Flash, 144.66 kB RAM) that detects the keyword “happy” spoken three times within a 10-second window, achieving 73.3% keyword detection accuracy and 96.7% non-keyword rejection rate in real-world testing. Task scheduling is managed by FreeRTOS, with the idle task consuming 94% of CPU time, demonstrating high energy efficiency. Audio is captured via the onboard MEMS microphone using Direct Memory Access (DMA) and processed through a Log-Mel spectrogram pipeline implemented using ARM CMSIS-DSP. The system consumes only 0.708 W — just 4.6% of the power drawn by a PC running the same model and 45.7% of a higher-end STM32H747I-DISCO board running a commercial closed-source library. Voice recognition experiments using both i-vector and CNN approaches are also reported, revealing current limitations of speaker verification on memory-constrained devices. A Python-based graphical user interface (GUI) is developed to streamline deployment, serial monitoring, and SMS configuration. The proposed system demonstrates the feasibility of fully local, low-power phrase-based danger detection on microcontrollers without cloud dependency.
Paper
The full text of this publication is not hosted on 44B due to licensing.
Read it at OpenAlex