设计说明书
总字数:16000+
摘要
在药房管理中,药品储存环境的稳定性对保障药品质量至关重要。温湿度异常、有害气体(如烟雾、一氧化碳、氢气)超标等情况,可能导致药品变质、疗效降低甚至产生安全隐患。传统的人工巡检方式依赖定时记录,存在数据滞后、响应不及时、劳动强度大等问题,难以满足现代化药房对环境监测的精准化、实时化需求。
基于 STM32F103C8T6 单片机的 ZigBee 药房环境监测系统,采用主从机架构,整合了 DHT11 温湿度传感器、MQ-2 烟雾传感器、MQ-7 一氧化碳传感器、MQ-8 氢气传感器、OLED 显示屏、ZigBee 模块、WiFi 模块、按键及声光报警、风扇等执行设备,实现了药房环境的多参数实时监测与智能调控。系统核心功能包括:从机通过各类传感器采集温湿度、烟雾浓度、CO 浓度、氢气浓度,当检测值超过预设阈值时自动启动风扇,并通过 ZigBee 将数据传输至主机;主机接收从机数据后,通过 OLED 显示屏实时展示各项参数,同时支持按键设置各参数阈值,若检测值超标则触发声光报警;主机通过 WiFi 模块将数据推送至手机端,实现远程查看与参数阈值的远程设置。
该系统的实现,有效提升了药房环境监测的自动化与智能化水平,确保了环境参数的实时监控与异常及时响应,为药品储存安全提供了可靠保障,同时为药房信息化管理提供了数据支持,具有较高的实际应用价值。
关键词:STM32F103C8T6;ZigBee;药房环境;监测系统;传感器;智能报警;WiFi 通信
ABSTRACT
In pharmacy management, the stability of the drug storage environment is crucial for ensuring drug quality. Abnormal temperature and humidity, excessive harmful gases (such as smoke, carbon monoxide, hydrogen), and other conditions may cause drug deterioration, reduced efficacy, or even safety hazards. Traditional manual inspection methods rely on timed records, which have problems such as data lag, delayed response, and high labor intensity, making it difficult to meet the needs of modern pharmacies for precise and real-time environmental monitoring.
The ZigBee pharmacy environment monitoring system based on the STM32F103C8T6 microcontroller adopts a master-slave architecture, integrating DHT11 temperature and humidity sensors, MQ-2 smoke sensors, MQ-7 carbon monoxide sensors, MQ-8 hydrogen sensors, OLED displays, ZigBee modules, WiFi modules, buttons, and sound-light alarm, fans and other executive devices, realizing multi-parameter real-time monitoring and intelligent regulation of the pharmacy environment. The core functions of the system include: the slave machine collects temperature and humidity, smoke concentration, CO concentration, and hydrogen concentration through various sensors, automatically starts the fan when the detected value exceeds the preset threshold, and transmits data to the master machine through ZigBee; after receiving the slave machine data, the master machine displays various parameters in real-time through the OLED display, and supports setting each parameter threshold through buttons, and triggers an acousto-optic alarm if the detected value exceeds the standard; the master machine pushes data to the mobile phone through the WiFi module to realize remote viewing and remote setting of parameter thresholds.
The implementation of this system effectively improves the automation and intelligence level of pharmacy environment monitoring, ensures real-time monitoring of environmental parameters and timely response to abnormalities, provides a reliable guarantee for drug storage safety, and also provides data support for pharmacy information management, which has high practical application value.
Keywords:STM32F103C8T6; ZigBee; Pharmacy environment; Monitoring system; Sensor; Intelligent alarm; WiFi communication
目录
第 1 章 绪论
1.1 研究的目的及意义
1.2 国内外发展情况
1.3 本文主要研究内容
第2章 设计思路与方案论证
2.1 主要元器件选择
2.1.1 主控芯片选择
2.1.2 温湿度传感器选择
2.1.3 烟雾传感器选择
2.1.4 CO 传感器选择
2.1.5 氢气传感器选择
2.1.6 ZigBee 模块选择
2.1.7 显示模块选择
2.1.8按键模块选择
2.1.10 声光报警模块选择
2.2整体设计方案
第 3 章 硬件设计
3.1 主控电路模块(主从机通用)
3.2 温湿度传感器电路
3.3 气体传感器电路(从机)
3.3.1 MQ-2 烟雾传感器电路
3.3.2 MQ-7 CO 传感器电路
3.3.3 MQ-8 氢气传感器电路
3.4 ZigBee 通信模块电路(主从机)
3.5 显示模块电路(主机)
3.6 按键模块电路(主机)
3.7 报警电路(主机)
第4章 系统程序设计
4.1 编程软件介绍
4.2 系统主流程设计
4.3 从机系统主流程设计
4.4 独立按键
4.5 OLED显示流程设计
4.6 ADC模数转换子流程设计
4.7 温湿度检测模块子流程设计
4.8 zigbee模块子流程设计
4.7 WiFi模块子流程设计
第 5 章 实物测试
5.1 整体实物测试
5.2 温湿度传感器功能测试
5.3 气体传感器功能测试
5.3.1 MQ-2 烟雾传感器测试
5.3.2 MQ-7 CO 传感器测试
5.3.3 MQ-8 氢气传感器测试
5.4 WiFi 模块与远程控制测试
5.5 报警与执行设备测试
5.6 按键设置与显示功能测试
第 6 章 总结与展望
6.1 总结
6.2 展望
致谢
参考文献
附录
附录一:原理图
附录二:PCB
附录三:主程序
购买后可查看具体内容!