设计说明书
总字数:18000+
摘要
随着城市化进程的加快和居民生活水平的提高,家居环境的安全性与舒适性日益成为人们关注的焦点。传统的家居安防方式多依赖独立设备简单报警,存在功能单一、联动性差、无法远程监控等问题,难以满足现代家庭对智能化、一体化安防的需求。
基于 STM32F103C8T6 单片机的嵌入式智能家居安防系统,整合了 DHT11 温湿度传感器、YS-17 火焰检测模块、MQ-2 烟雾检测模块、OLED 显示模块、按键及 ESP8266 WiFi 模块,并联动加热、降温、加湿、除湿、水泵、通风等执行设备,实现了家居环境的全方位监测与智能安防控制。系统核心功能包括:通过 DHT11 实时监测室内温湿度,当温度异常时自动启动加热或降温装置,湿度失衡时触发加湿或除湿设备;借助 YS-17 检测火灾情况,一旦发现火情立即控制水泵灭火并启动声光报警;通过 MQ-2 监测烟雾浓度,超过阈值时自动开启通风装置并进行声光报警;通过 OLED 显示屏实时显示各项环境数据及设备运行状态;支持通过按键现场设置各参数阈值;利用 ESP8266 WiFi 模块将数据同步至手机端,实现远程监测、参数设置及设备控制。
该系统的实现,有效提升了家居环境的安全性与舒适度,减少了人工干预,实现了安防与环境调控的一体化管理,为智能家居安防设备的研发提供了实用参考,具有较高的推广应用价值。
关键词:STM32F103C8T6;智能家居;安防系统;传感器;智能控制;WiFi 通信
ABSTRACT
With the acceleration of urbanization and the improvement of residents’ living standards, the safety and comfort of home environments have increasingly become the focus of attention. Traditional home security methods rely mostly on simple alarms from independent devices, which have problems such as single functionality, poor linkage, and inability to remote monitoring, making it difficult to meet the needs of modern families for intelligent and integrated security.
The embedded smart home security system based on the STM32F103C8T6 microcontroller integrates DHT11 temperature and humidity sensor, YS-17 flame detection module, MQ-2 smoke detection module, OLED display module, buttons, ESP8266 WiFi module, and links with execution devices such as heating, cooling, humidification, dehumidification, water pump, and ventilation devices, realizing comprehensive monitoring and intelligent security control of the home environment. The core functions of the system include: real-time monitoring of indoor temperature and humidity through DHT11, automatically activating heating or cooling devices when the temperature is abnormal, and triggering humidification or dehumidification equipment when humidity is unbalanced; detecting fire conditions with YS-17, and immediately controlling the water pump to extinguish the fire and activating sound and light alarm once a fire is detected; monitoring smoke concentration through MQ-2, automatically turning on ventilation devices and conducting sound and light alarm when it exceeds the threshold; real-time display of various environmental data and equipment operation status through the OLED display module; supporting on-site setting of various parameter thresholds through buttons; using the ESP8266 WiFi module to synchronize data to the mobile phone terminal, realizing remote monitoring, parameter setting and equipment control.
The implementation of this system has effectively improved the safety and comfort of the home environment, reduced manual intervention, realized the integrated management of security and environmental control, provided a practical reference for the research and development of smart home security equipment, and has high promotion and application value.
Keywords:STM32F103C8T6; smart home; security system; sensor; intelligent 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 按键模块选择
2.2整体设计方案
第 3 章 硬件设计
3.1 主控电路模块
3.2 温湿度传感器电路
3.3 火焰检测模块电路
3.4 烟雾检测模块电路
3.5 显示模块电路
3.6 无线通信模块电路
3.7 按键模块电路
3.8 执行设备驱动电路
第4章 系统程序设计
4.1 编程软件介绍
4.2 系统主流程设计
4.3 独立按键子流程设计
4.4 温湿度检测模块子流程设计
4.5 ADC模数转换子流程设计
4.6 OLED显示子流程设计
4.7 WiFi模块子流程设计
第 5 章 实物测试
5.1 整体实物测试
5.2 温湿度传感器功能测试
5.3 火焰检测模块功能测试
5.4 烟雾检测模块功能测试
5.5 无线通信模块功能测试
5.6 执行设备功能测试
5.7 按键设置与显示功能测试
第6章 总结与展望
6.1 总结
6.2 展望
致谢
参考文献
附录
附录一:原理图
附录二:PCB
附录三:主程序
购买后可查看具体内容!