设计说明书
总字数:17000+
摘要
随着高校宿舍安全管理需求的日益提升,构建智能化安防系统对预防火灾、保障学生人身与财产安全具有重要意义。传统宿舍安防依赖人工巡查与监控录像回溯,存在火灾隐患发现滞后、异常入侵预警不及时等问题,难以满足实时性、主动性的安全防护需求。
基于 STM32F103C8T6 单片机的宿舍安防系统,整合了 YS-17 火焰检测模块、MQ-2 烟雾传感器、D203S 人体热释电传感器、KY-003 霍尔传感器、OLED 显示屏、按键模块、水泵执行装置及 ESP8266 WIFI 模块,实现了宿舍环境的全方位监测与智能防护。系统核心功能包括:通过 YS-17 与 MQ-2 协同监测火灾隐患,检测到火焰或烟雾浓度超标时自动启动水泵灭火;通过 D203S 与 KY-003 联动监测异常滞留,门关闭状态下检测到人员停留超过 10 秒时触发声光报警;支持通过按键本地设置烟雾浓度阈值及手动控制水泵;通过 OLED 实时显示传感器数据与设备状态;借助 ESP8266 WIFI 模块实现手机端远程查看数据、设置阈值及控制水泵开关。
该系统的实现,有效提升了宿舍安防的实时性与主动性,通过多传感器联动实现火灾与异常滞留的双重防护,减少了对人工巡查的依赖。同时,远程通信功能突破了传统安防的时空限制,为管理人员提供了便捷的远程管控手段。该方案成本适中、部署灵活,为高校宿舍及小型居住空间的智能化安防改造提供了实用参考,具有较高的实际应用价值。
关键词:STM32F103C8T6;宿舍安防;多传感器联动;火灾监测;远程控制;WIFI 通信
ABSTRACT
With the increasing demand for safety management in college dormitories, the construction of an intelligent security system is of great significance for preventing fires and ensuring the personal and property safety of students. Traditional dormitory security relies on manual inspections and retrospective monitoring videos, which have problems such as delayed detection of fire hazards and untimely warning of abnormal intrusions, making it difficult to meet the needs of real-time and proactive safety protection.
The dormitory security system based on the STM32F103C8T6 microcontroller integrates the YS-17 flame detection module, MQ-2 smoke sensor, D203S pyroelectric sensor, KY-003 Hall sensor, OLED display, key module, water pump execution device, and ESP8266 WIFI module, realizing comprehensive monitoring and intelligent protection of the dormitory environment. The core functions of the system include: collaboratively monitoring fire hazards through YS-17 and MQ-2, automatically activating the water pump to extinguish fires when flames or excessive smoke concentration are detected; jointly monitoring abnormal through D203S and KY-003, triggering an audible and visual alarm when a person is detected staying for more than 10 seconds with the door closed; supporting local setting of smoke concentration thresholds and manual control of the water pump through keys; real-time display of sensor data and device status through OLED; realizing remote viewing of data, setting thresholds, and controlling the water pump switch on the mobile phone through the ESP8266 WIFI module.
The implementation of this system effectively improves the real-time and initiative of dormitory security, realizes dual protection against fires and abnormal 滞留 through multi-sensor linkage, and reduces reliance on manual inspections. At the same time, the remote communication function breaks through the time and space limitations of traditional security, providing managers with a convenient means of remote management and control. This solution is moderately priced and flexible in deployment, providing a practical reference for the intelligent security transformation of college dormitories and small living spaces, and has high practical application value.
Keywords:STM32F103C8T6; Dormitory Security; Multi-sensor Linkage; Fire Monitoring; Remote Control; WIFI Communication
目录
第1章 绪论
1.1 研究的目的及意义
1.2 国内外发展情况
1.3 本文主要研究内容
第2章 设计思路与方案论证
2.1 主要元器件选择
2.1.1 主控芯片选择
2.1.2 火焰检测模块选择
2.1.3 烟雾传感器选择
2.1.4 人体与门状态监测模块选择
2.1.5 显示模块选择
2.1.6 按键模块选择
2.1.7 WIFI 模块选择
2.1.8 执行设备选择
2.2整体设计方案
第 3 章 硬件设计
3.1 主控芯片电路(STM32F103C8T6)
3.1.1 功能
3.1.2 工作原理
3.1.3 引脚功能
3.2 火焰检测模块电路(YS-17)
3.2.1 功能
3.2.2 工作原理
3.2.3 引脚功能
3.3 烟雾检测模块电路(MQ-2)
3.3.1 功能
3.3.2 工作原理
3.3.3 引脚功能
3.4 人体热释电模块电路(D203S)
3.4.1 功能
3.4.2 工作原理
3.4.3 引脚功能
3.5 霍尔传感器模块电路(KY-003)
3.5.1 功能
3.5.2 工作原理
3.5.3 引脚功能
3.6 OLED 显示模块电路
3.6.1 功能
3.6.2 工作原理
3.6.3 引脚功能
3.7 按键模块电路
3.7.1 功能
3.7.2 工作原理
3.7.3 引脚功能
3.8 WIFI 模块电路(ESP8266)
3.8.1 功能
3.8.2 工作原理
3.8.3 引脚功能
3.9 执行设备驱动电路
3.9.1 功能
3.9.2 工作原理
3.9.3 引脚功能
第4章 系统程序设计
4.1 编程软件介绍
4.2 系统主流程设计
4.3 独立按键
4.4 OLED显示流程设计
4.5 WiFi模块子流程设计
4.6 ADC模数转换子流程设计
第 5 章 实物测试
5.1 整体实物测试
5.2 火焰与烟雾检测及灭火功能测试
5.3 人体感应与门状态检测报警功能测试
5.4 WIFI 模块数据传输与远程控制测试
5.5 OLED 显示与按键设置功能测试
5.6 总结
第6章 总结与展望
一、总结
二、展望
致谢
参考文献
附录
附录一:原理图
附录二:PCB
附录三:主程序
购买后可查看具体内容!