计算机科学 ›› 2026, Vol. 53 ›› Issue (11): 376-386.doi: 10.11896/jsjkx.251000131

• 计算机网络 • 上一篇    下一篇

基于边缘计算的教室空气质量智能监测与控制算法研究

王以恒1, 张齐贤2, 苗夺谦2   

  1. 1 西澳大学工程学院 珀斯 6009
    2 同济大学计算机科学与技术学院 上海 201804
  • 收稿日期:2025-10-27 修回日期:2026-02-08 出版日期:2026-11-15 发布日期:2026-11-10
  • 通讯作者: 苗夺谦(dqmiao@tongji.edu.cn)
  • 作者简介:(ygt3dk@163.com)
  • 基金资助:
    国家自然科学基金(62376198)

Intelligent Monitoring and Control Algorithm for Classroom Air Quality Based on Edge Computing

WANG Yiheng1, ZHANG Qixian2, MIAO Duoqian2   

  1. 1 School of Engineering,The University of Western Australia,Perth WA 6009,Australia
    2 School of Computer Science and Technology,Tongji University,Shanghai 201804,China
  • Received:2025-10-27 Revised:2026-02-08 Published:2026-11-15 Online:2026-11-10
  • About author:WANG Yiheng,born in 2003,postgra-duate.His main research interests include automation technology and computer technology.
    MIAO Duoqian,Ph.D supervisor.His main research interests include artificial intelligence,machine learning,granular computing and rough sets.
  • Supported by:
    National Science Foundation of China(62376198).

摘要: 针对传统教室空气质量(IAQ)监测系统响应延迟高、成本高、依赖云端计算的问题,提出了一种基于STM32F103C8T6微控制器的边缘智能监测与混合控制系统。所提系统在端侧集成多传感信息采集、空气质量评估与闭环控制,实现本地决策与远程可视化的协同运行。硬件设计包括MQ-135空气质量传感器、DHT22温湿度传感器、BH1750照度传感器与PWM控制风扇模块;软件上在Keil5环境下以C语言实现数据采集与控制逻辑,并通过多次采样平均与滞回判定机制提高数据稳定性。控制策略上,系统采用混合控制方案:风扇部分基于PID(Proportional-Integral-Derivative)算法的PWM(Pulse Width Modulation)调节实现平滑降温控制,加热部分通过双阈值滞回策略实现稳定升温与启停抑制,从而在保障舒适度的同时提升系统稳定性与控制精度,并有效抑制超调与频繁启停。实验结果表明,所设计的系统在响应速度与控制精度方面表现良好。结合系统的低成本与本地快速决策特性,在教室等小规模IAQ控制场景下,该端侧实现可作为传统可编程控制器PLC(Programmable Logic Controller)控制方案的低成本替代或补充选项,验证了边缘计算在低功耗嵌入式IAQ智能监测中的可行性与潜力。

关键词: STM32F103C8T6微控制器, 边缘计算, 室内空气质量, PID 控制, 双阈值滞回策略

Abstract: To address the problems of high response delay,high cost,and dependence on cloud computing in traditional classroom indoor air quality(IAQ) monitoring systems,this paper proposes an edge-intelligent monitoring and hybrid control system based on the STM32F103C8T6 micro-controller.The system integrates multi-sensor data acquisition,air quality evaluation,and closed-loop control on the edge side,achieving coordinated operation between local decision-making and remote visualization.The hardware design incorporates an MQ-135 air quality sensor,DHT22 temperature-humidity sensor,BH1750 illumination sensor,and a PWM(Pulse Width Modulation) controlled fan module.On the software side,data acquisition and control logic are implemented in C language under the Keil5 environment,and a multi-sample averaging and hysteresis determination mechanism is applied to improve data stability.In terms of control strategy,a hybrid control scheme is adopted:the fan section uses a PID(Proportional-Integral-Derivative) based PWM regulation for smooth cooling,while the heating section employs a dual-threshold hysteresis strategy to achieve stable heating and suppress frequent on-off switching,thereby enhancing system stability and control precision while maintaining comfort and effectively suppressing overshoot.Experimental results show that the designed system performs well in response speed and control accuracy.With its low-cost hardware and rapid local decision-making capability,the system provides a low-cost alternative or complement to traditional programmable logic controller(PLC) schemes in small-scale classroom IAQ control scenarios,demonstrating the feasibility and potential of edge computing in low-power embedded IAQ intelligent monitoring applications.

Key words: STM32F103C8T6 micro-controller, Edge computing, Indoor air quality(IAQ), PID control, Dual-threshold hysteresis strategy

中图分类号: 

  • TP274
[1] ANDAMON M M,RAJAGOPALAN P,WOO J.Evaluation ofventilation in Australian school classrooms using long-term indoor CO2 concentration measurements[J].Building and Environment,2023,237:110313.
[2] FISK W J.The ventilation problem in schools:Literature review[J].Indoor Air,2017,27(6):1039-1051.
[3] SHI W,CAO J,ZHANG Q,et al.Edge computing:vision andchallenges[J].IEEE Internet of Things Journal,2016,3(5):637-646.
[4] HONAN D,GALLAGHER J,GARVEY J,et al.Indoor airquality in naturally ventilated primary schools:a systematic review of the assessment & impacts of CO2 levels[J].Buildings,2024,14(12):4003.
[5] FAN Y,CAO X,ZHANG J,et al.Short-term exposure to indoor CO2 and cognitive task performance:a systematic review and meta-analysis[J].Building and Environment,2023,237:110331.
[6] WARGOCKI P,WYON D P.The effects of moderately raised classroom temperatures and classroom ventilation rate on the performance of schoolwork by children[J].HVAC&R Research,2007,13(2):193-220.
[7] WEN C,DING X,WANG D Q,et al.Design of a ZigBee-based wireless temperature and humidity monitoring system for libra-ries [J].Journal of Qingdao University(Engineering & Techno-logy Edition),2016,31(2):26-31.
[8] MONTORI F,CONTIGIANI R,BEDOGNI L.Is WiFi suitable for energy-efficient IoT deployments? A performance study[C]//2017 IEEE 3rd International Forum on Research and Technologies for Society and Industry(RTSI).IEEE,2017:1-5.
[9] MEREMA B,DELWATI M,SOURBRON M,et al.Demandcontrolled ventilation(DCV) in school and office buildings:lessons learnt from case studies[J].Energy and Buildings,2018,172:349-360.
[10] CANDANEDO L M,FELDHEIM V.Accurate occupancy detection of an office room from light,temperature,humidity and CO2 measurements using statistical learning models[J].Energy and Buildings,2016,112:28-39.
[11] RUEDA L,AGBOSSOU K,CARDENAS A,et al.A comprehensive review of approaches to building occupancy detection[J].Building and Environment,2020,180:106966.
[12] MAO Y,YOU C,ZHANG J,et al.A survey on mobile edge computing:the communication perspective[J].IEEE Communications Surveys & Tutorials,2017,19(4):2322-2358.
[13] WU Z,HUANG H Z,FENG Y.Design of a carbon monoxide detection and indoor ventilation system based on STM32 [J].Modern Information Technology,2023,7(22):165-168.
[14] KARAGULIAN F,BARBIERE M,KOTSEV A,et al.Review of the performance of low-cost sensors for air quality monitoring[J].Atmosphere,2019,10(9):506.
[15] CONCAS F,MINERAUD J,LAGERSPETZ E,et al.Low-cost outdoor air quality monitoring and sensor calibration:a survey and critical analysis[J].ACM Transactions on Sensor Networks,2021,17(2):1-44.
[16] WANG L L,LIN B Q,CHEN Y,et al.Research on the application of PID algorithm based on Arduino in temperature measurement and control experiment[J].Physics and Engineering,2025,35(2):207-213.
[17] ZHANG A D,ZHANG Y R,LI T.Application of variable do-main fuzzy PID control in semiconductor laser temperature control system[J].Acta Optica Sinica,2021,41(12):1214003.
[18] JING X,GAO G W.Constant temperature control system based on PID regulation[J].Computer Measurement & Control,2021,29(4):110-114.
[19] DE DEAR R,BRAGER G S.Developing an adaptive model ofthermal comfort and preference[J].ASHRAE Transactions,1998,104(1):145-167.
[20] HU R,HU H P,ZHANG T H.Design and implementation of a contacts APP based on the App Inventor development platform[J].Shanxi Electronic Technology,2017(2):67-69.
[21] CLINCHARD S,HAVERINEN-SHAUGHNESSY U,SH-AUGHNESSY R.Assessing ventilation performance in schools using continuous CO2 monitoring:insights from renovation projects[J].Building and Environment,2025,269:112406.
[22] TAN H Y,OTHMAN M H D,KEK H Y,et al.Revolutionizingindoor air quality monitoring through IoT innovations:a comprehensive systematic review and bibliometric analysis[J].En-vironmental Science and Pollution Research,2024,31:44463-44488.
[23] SHAHID S,BROWN D J,WRIGHT P,et al.Innovations in air quality monitoring:sensors,IoT and future research [J].Sensors,2025,25(7):2070.
[24] HADJ SASSI M S,CHAARI FOURATI L.Comprehensive sur-vey on air quality monitoring systems based on emerging computing and communication technologies[J].Computer Networks,2022,209:108904.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!