Design of an Indoor Environment Monitoring System Based on Multi-Sensor Fusion

Design of an Indoor Environment Monitoring System Based on Multi-Sensor Fusion

Abstract: With the rapid development of productivity, people’s requirements for environmental quality have gradually increased, especially the harmful gases left over from new home renovations pose a significant threat to human health. This paper designs a multi-sensor fusion indoor environment monitoring system based on the STM32F407VET6 microcontroller, suitable for indoor environment detection, real-time monitoring of air quality, ensuring respiratory health, and improving quality of life.

In indoor environment monitoring, real-time monitoring data is needed to reflect environmental quality, which is of great significance for improving the overall indoor air quality in our country. As people’s living standards improve and work patterns change, more and more production and life activities are completed indoors, with most people spending 80% of their time indoors. Therefore, the quality of indoor air has a significant impact on human health, which has also increased people’s attention to indoor air quality.

This design is based on a multi-sensor fusion indoor environment monitoring system, aiming to achieve real-time monitoring of indoor air quality. It consists of sensor circuits, microcontroller circuits, display circuits, alarm circuits, and other components to form an indoor air monitoring and alarm system. The system features simplicity, efficiency, and low cost, allowing for real-time and accurate monitoring of indoor air quality. On one hand, it helps improve indoor air quality, significantly reducing the loss of life and property caused by accidents such as fires due to gas leaks; on the other hand, it can reduce the potential harm of indoor air pollution to human health, thereby improving people’s health and quality of life. The system is highly applicable, playing an important role in homes, offices, and crowded indoor public places.

1. Overall System Block Diagram Design

This design uses the STM32F407VET6 development board, which has a higher processing speed and can achieve real-time data interaction. It also has an advantage in the number of I/O ports, providing enough communication ports for various sensors, with a maximum main frequency of 128MHz for high-speed data transmission processing. By integrating multiple types of sensors, wireless communication modules, and actuators, real-time perception, remote transmission, and dynamic regulation of environmental parameters are achieved. The system consists of a multi-dimensional data collection network formed by the DHT11 sensor, photoresistor, carbon monoxide sensor, smoke sensor, pressure sensor, and air quality sensor. The main control unit relies on the high-performance core and multiple interfaces of the STM32 to complete data parsing, threshold comparison (e.g., detecting smoke concentration exceeding the limit), and task scheduling. The system supports multi-task real-time processing and modular expansion, with high reliability, flexibility, and automation capabilities. The block diagram of the multi-sensor fusion indoor environment detection system is shown in Figure 1.

Figure 1: Block Diagram of the Multi-Sensor Fusion Indoor Environment Detection System

2. System Hardware Design

2.1 Sensor Circuit Modules

(1) The temperature and humidity module sensor uses the DHT11, which is a highly reliable and long-term stable integrated digital sensor for temperature and humidity detection, widely used in HVAC, automotive, and home appliance industries. (2) The MQ-7 gas sensor is a commonly used sensor for detecting carbon monoxide gas concentration in the air. Its working principle is based on the resistance change of semiconductor gas-sensitive elements. (3) The MQ-2 smoke gas sensor shows an increasing trend in conductivity as the concentration of combustible gases in the air increases. (4) The MQ-135 air quality sensor reacts chemically with the sensitive material on the surface of the gas-sensitive element when gas comes into contact, causing a change in its resistance value. By measuring the change in resistance, the concentration of pollutant gases can be inferred.

2.2 Alarm Circuit Module

The system uses a break-line type alarm. When the alarm is activated, the trigger terminal of the thyristor is grounded, putting it in a cutoff state. When the monitored value exceeds the threshold, the lead is broken, allowing the trigger terminal of the thyristor to receive a trigger voltage and turn on, causing the complementary oscillator to activate and emit a “beep” sound. At the same time, the LED also lights up due to the thyristor being powered. The flow of the alarm circuit module is shown in Figure 2.

Figure 2: Flow of the Alarm Circuit Module

2.3 Stepper Motor Circuit Module: The stepper motor is an open-loop control element that converts electrical pulse signals into angular or linear displacement. In this design, it is intended to be used for switching curtains.

2.4 ESP8266 Module

The ESP8266 is a serial Wi-Fi module with a high-performance SOC that can operate independently or as a slave on other hosts. The chip integrates a core CPU, power management converter, antenna switch balun, etc. It also has built-in high-speed cache memory, reducing memory requirements and improving system operating efficiency.

Figure 3: Flow of the ESP8266 Module

3. Software Design

This system constructs an indoor environment monitoring network using multi-modal sensor fusion technology, mainly consisting of the environmental perception layer, edge computing layer, cloud service platform, and user interaction terminal. When the system is powered on, the STM32 main control module polls each sensor node via the RS485 bus, collecting real-time environmental parameters such as temperature, humidity, PM2.5, VOC, CO2 concentration, and light intensity. When the detected values exceed the threshold, an audible and visual alarm is activated; if the light intensity is below the threshold, the lights are turned on and the curtains are closed. Wi-Fi pushes the real-time monitored parameter data to the mobile end, allowing users to check the indoor environment status anytime via a mobile app, enabling timely preventive measures and alarms in case of emergencies. When the detected parameter values fall below the threshold, the alarm is automatically deactivated. The main program flow of the system is shown in Figure 4.

Figure 4: Main Program Flow of the System

4. Test Results

4.1 Function Testing

The STM32F407 microcontroller and ESP32 dual-core coprocessor construct a hybrid computing architecture. The main control module uses a time-slice polling algorithm to achieve multi-task scheduling, polling the sensor network every 200ms, with the collection cycle dynamically adjustable (can be increased to 50ms in emergencies). The collected data is pre-processed using filtering algorithms, and local decisions are executed by the coprocessor. When the smoke concentration exceeds 10ppm or the CO concentration exceeds 10ppm, the GPIO-connected audible and visual alarm (buzzer frequency 2kHz, LED lights up) is triggered; if the light intensity is below 1000lux, the LED light is turned on, and the stepper motor is driven to close the blackout curtains at a speed of 0.5rpm. All alarm thresholds support key setting updates. Wi-Fi pushes the real-time monitored parameter data to the mobile end, allowing users to check the indoor environment status anytime via a mobile app, enabling timely preventive measures and alarms in case of emergencies. When the detected parameter values fall below the threshold, the alarm is automatically deactivated.

Simulated fire settings with smoke >20ppm and CO >10ppm simultaneously exceeding the limit trigger the audible and visual alarm within 1s (buzzer volume 85dB, LED light flashing). If the values are not within the threshold, the alarm continues, and Wi-Fi pushes data in real-time. The average delay time for mobile end reception is 0.8s, meeting real-time requirements. The system runs continuously for 72 hours without rebooting, with standby mode at 0.5W and full-load mode at 2.8W (in line with low-power design). The detected values are shown in Table 1, and the test physical diagram and mobile app interface are shown in Figure 5.

Table 1: Detected Values (Summer)

Figure 5: Test Physical Diagram and Mobile App Interface

4.2 Performance Testing

(1) Accuracy: Average sensor error <5% (higher error at low concentrations of CO and smoke, requiring later calibration and optimization). (2) Response speed: Alarm trigger time ≤1s, meeting fire warning standards (national standard requirement ≤10s). (3) Reliability: Wi-Fi transmission is stable, and the graded warning mechanism effectively reduces the false alarm rate.

5. Conclusion

This paper designs a multi-sensor fusion indoor environment monitoring system that integrates air quality detection and fire alarm functions, aiming to monitor indoor environmental parameters in real-time to ensure safety and health. The system constructs an efficient and intelligent indoor environment monitoring solution through multi-sensor collaborative data collection, combined with local display, audible and visual alarms, and remote communication functions. Using the high-performance STM32F407VET6 microcontroller as the main control unit, it relies on its low power consumption, high computing capability, and rich peripheral interfaces to achieve sensor data collection, processing, and multi-module collaborative control. This design employs a multi-parameter sensor network, including air sensors (PM2.5/VOC, etc.), carbon monoxide sensors, and smoke sensors, to monitor harmful gas concentrations in real-time. By linking the smoke sensor and carbon monoxide sensor with DHT11 temperature and humidity sensor data, fire risk can be accurately identified. The pressure sensor assists in environmental state analysis, while the DHT11 synchronously monitors temperature and humidity, covering all indoor environmental indicators. Human-computer interaction and communication are achieved through a display screen that presents environmental data in real-time, and the audible and visual alarm circuit triggers alarms at abnormal thresholds (e.g., CO exceeding the limit, sudden increase in smoke concentration). The Wi-Fi module uploads data to the cloud or mobile terminal, supporting users to remotely view detection data via a mobile app, enhancing response timeliness. The power circuit design is optimized to ensure stable power supply for the system, meeting the needs for long-term continuous operation. The system achieves multi-parameter integration through multi-type sensor fusion, allowing simultaneous monitoring of air quality and fire risk, with comprehensive functionality. Real-time and intelligent features include dynamic data refresh (≤1s), combined with threshold judgment and multi-sensor cross-validation to reduce false alarm rates. Low power consumption and scalability are supported by the energy-efficient design based on STM32, allowing for battery or adapter power supply; reserved interfaces facilitate functional expansion (e.g., adding other sensors). The Wi-Fi module enables cloud storage and analysis of data, providing a foundation for smart home integration.

This system is suitable for indoor places such as homes, offices, schools, and hospitals, effectively preventing safety hazards caused by air pollution or fires, assisting in health management and disaster prevention. Its low cost and high integration characteristics provide a practical reference solution for environmental monitoring in smart cities and green buildings. In the future, machine learning algorithms can be added to optimize warning accuracy and link with ventilation/firefighting systems to further enhance automation levels. This system combines environmental perception, data processing, and intelligent warning, reflecting the innovative application of embedded technology and the Internet of Things in the field of indoor safety, with high practical value and promotion potential. Additionally, this design also faces key technical issues that need to be addressed: intelligent high-precision identification technology. This design aims to achieve precise detection of various indices of indoor air, accurately analyze indoor air conditions, and display various index data on the screen, with the expectation of expanding the detection range to over 20m radius and maintaining high monitoring accuracy. If the detected values exceed the set parameter range, the alarm circuit is activated; remote and near-range control safety management technology. This design is mainly applied to indoor environment monitoring, such as when measured values exceed temperature and humidity ranges, PM2.5 is severely exceeded, or smoke is detected, the system will automatically alarm, and when the danger is eliminated, the alarm will be automatically canceled. Through wireless communication networks, it can be connected to the mobile end to display indoor air monitoring conditions on the WeChat mini-program.

In the future, through artificial intelligence technology, the system can achieve automated decision-making and early warning. For example, based on historical data and real-time monitoring data, the intelligent system can predict abnormal pollutant emissions or environmental risk events and issue early warnings. This helps to take control measures in a timely manner, reducing potential environmental damage. It enables the air detector to expand and upgrade its functions based on the platform, adding new application modules such as air purifiers, connecting for information exchange to realize intelligent switches for air purifiers, reducing functional loss of air purifiers, while allowing remote viewing and control of device operating status via mobile.

References:

[1] Zhang Zhijun. Research on Indoor Environment Design Based on Indoor Air Quality. Environmental Science and Management, 2017, 42(2): 81-84.

[2] Shang Yuanyuan, Dong Shuai, Liu Xiaoyu, et al. Analysis and Comparison of Indoor Air Quality Standards. Clean and Air Conditioning Technology, 2023(4): 45-48.

[3] Tan Yufei, Qin Yunbo, et al. Design of Intelligent Car Tracking and Obstacle Avoidance Based on STM32F407ZET6. Electronic Production, 2023, 31(13): 19-21+29.

[4] Yang Hailong, Kou Jian, Wen Xiaodong, et al. Design of Intelligent Building Temperature and Humidity Detection System Based on ESP8266. Journal of Hebei University of Architecture, 2023, 41(3): 177-181+188.

[5] Zhang Junying, Wang Yuangen. Research on Improving the Positioning Accuracy of Stepper Motors. Metallurgical Power, 2025(1): 32-34.

[6] Li Hongwei. Air Quality Monitoring System Based on STM32 and Alibaba Cloud. Electronic Production, 2022, 30(7): 8-12.

[7] Wu Shengqi. Advanced Applications and Future Prospects of IoT Technology in Environmental Monitoring and Pollution Control. In: Proceedings of the Fifth Academic Conference on Innovative Education and Development. Hangzhou Vocational and Technical College, 2023.

Funding Support: National College Student Innovation and Entrepreneurship Training Program Project of Guangxi University of Science and Technology (Project No: 202311546009); Research Fund Project of Guangxi University of Science and Technology (Project No: GXKS2024YB050);

Source: Huang Juanlan, Peng Dali, Wei Sihui. Design of a Multi-Sensor Fusion Indoor Environment Monitoring System. Science and Technology Innovation, 2025, (17): 1-4.

Design of an Indoor Environment Monitoring System Based on Multi-Sensor Fusion

Leave a Comment