This paper presents RSMS, a novel Real-Time Operating System (RTOS)-based safety monitoring architecture that introduces three key contributions to the field of embedded safety systems. First, it establishes a three-tier priority-scheduled framework on an ESP32 microcontroller running FreeRTOS, where four independent sensing tasks (flame, gas, IR obstacle, and Bluetooth SOS) are assigned differentiated priorities and pinned across two processor cores, ensuring that life-threatening hazards such as fire are serviced with deterministic preemption over lower-priority events. Second, it implements a decoupled producer-consumer model through a single FreeRTOS queue, which separates hazard detection from alert response, enabling modular expansion without modifying core logic and preventing resource conflicts during concurrent event handling. Third, the system integrates practical engineering solutions including a five-cycle debounce filter for IR sensors to suppress false positives, a hysteresis-based threshold for gas detection to prevent alert oscillation, and a Bluetooth-based emergency SOS channel—all realized at a total hardware cost of USD 4.23, making it accessible for resource-constrained deployments. Collectively, these contributions advance the state of the art by demonstrating that RTOS-based priority scheduling, when combined with structured inter-task communication, can reliably handle concurrent multi-hazard scenarios that conventional single-loop systems cannot guarantee, as validated through four independent serial and Bluetooth-terminal capture sessions.
