A Comparative Study of an STM32F103C8T6-Based FreeRTOS Smart Home System for Environmental Monitoring and Control - Gao, Ruimin (Informatica, 2025)
To meet the high-precision, fast-response, and low-energy requirements for environmental monitoring and device control in smart home scenarios, an intelligent control system based on the STM32F103C8T6 was designed. Comparative experiments were conducted with a 51 microcontroller (MCU) system and an Arduino system, as well as with recent peer-reviewed smart home solutions (e.g., IoT-based systems using Raspberry Pi Pico or ESP32-C3). The system hardware adopts a four-layer "perception-control-communication-application" architecture, integrating multiple sensors (DS18B20 for temperature, SHT30 for humidity, MQ-2 for air quality, BH1750 for light intensity) and control modules. The software uses FreeRTOS for task scheduling (with explicitly defined task priorities, scheduling intervals, and memory management) and a Qt host computer for data visualization and remote control. Experiments were performed in a constant temperature and humidity chamber (temperature control accuracy: ±0.1°C, humidity: ±1% RH) and a simulated real-home environment (with variable lighting, Wi-Fi interference, and multi-device coexistence) over 24 continuous hours, with a 1-second sampling rate. Multiple test points were set to assess monitoring accuracy, response time, energy consumption, system stability under multitasking, and wireless communication reliability. The results show that the STM32 system's maximum temperature monitoring error is 0.3°C and humidity error is 2% RH, 62.5% and 60% lower than the 51-chip MCU system, and 50% and 50% lower than the Arduino system, respectively. The automatic control response time is 0.8 s (mean ± 0.1 s) and remote control time is 1.0 s (mean ± 0.1 s), 55.6% and 54.5% shorter than the Arduino system. The total 24-hour energy consumption is 2.88 Wh, 40% lower than the 51-chip MCU system. Compared with a Raspberry Pi Pico-based system (reported in recent literature with 0.5°C temperature error and 3.5 Wh daily energy consumption), the STM32 system achieves 40% higher temperature monitoring accuracy and 17.7% lower energy consumption. Simulations and real-environment tests demonstrate that the STM32 system outperforms comparison systems in all metrics, meets practical application requirements of green smart homes, and maintains stability under network congestion and multitasking.