设计说明书
总字数:16000+
摘 要
随着养猪产业的规模化发展,猪舍环境对生猪生长和健康的影响日益显著。良好的环境条件能够提高生猪的生长速度、降低发病率,从而提升养殖效益。因此,设计一套能够实时监测和自动控制猪舍环境的系统具有重要意义。
本设计基于STM32F103C8T6单片机,DHT11传感器用于监测猪舍环境温湿度,当温度超过设定阈值时,自动启动风机通风并发出声光报警。光照传感器用于检测环境光照强度,并根据设定值自动控制照明灯的开关。SGP30传感器用于监测CO2浓度,MQ-135传感器监测氨气浓度,当检测值超过设定阈值时,系统自动启动风机通风并报警。按键模块用于手动设置各传感器的阈值以及手动控制通风和照明灯。OLED显示屏实时显示当前环境参数,WiFi模块则将数据发送到手机端,用户可以通过手机远程查看数据、设置阈值并控制通风和照明灯。
经过实际测试,该系统能够稳定、准确地监测猪舍内的温湿度、光照、CO₂和氨气浓度等环境参数,并根据预设阈值自动执行通风和照明控制。在不同环境条件下,系统报警功能正常,WiFi模块数据传输稳定,手机端控制流畅。测试结果表明,该系统有效改善了猪舍环境,降低了人工管理成本,提高了生猪养殖的智能化水平,具有良好的应用前景。
ABSTRACT
With the large-scale development of the pig farming industry, the impact of pigsty environment on the growth and health of pigs is becoming increasingly significant. Good environmental conditions can improve the growth rate of pigs, reduce the incidence rate, and thus improve the breeding efficiency. Therefore, designing a system that can monitor and automatically control the pigsty environment in real time is of great significance.
This design is based on the STM32F103C8T6 microcontroller, and the DHT11 sensor is used to monitor the temperature and humidity of the pigsty environment. When the temperature exceeds the set threshold, the fan will automatically start for ventilation and sound an audible and visual alarm. The light sensor is used to detect the ambient light intensity and automatically control the switch of the lighting according to the set value. The SGP30 sensor is used to monitor CO2 concentration, while the MQ-135 sensor monitors ammonia concentration. When the detection value exceeds the set threshold, the system automatically starts the fan ventilation and alarms. The button module is used to manually set the threshold of each sensor and manually control ventilation and lighting. The OLED display screen displays real-time environmental parameters, while the WiFi module sends data to the mobile phone. Users can remotely view the data, set thresholds, and control ventilation and lighting through their mobile phones.
After practical testing, the system can stably and accurately monitor environmental parameters such as temperature, humidity, lighting, CO ₂, and ammonia concentration in the pigsty, and automatically execute ventilation and lighting control according to preset thresholds. Under different environmental conditions, the system alarm function is normal, WiFi module data transmission is stable, and mobile control is smooth. The test results show that the system effectively improves the pigsty environment, reduces manual management costs, and enhances the intelligence level of pig farming, with good application prospects.
KEYWORDS: pigsty; singlechip; Sensors; Remote control; environmental monitoring
目 录
1 绪论
1.1 系统研究的背景及意义
1.2 国内外研究现状
1.2.1 国内研究现状
1.2.2 国外研究现状
1.3 系统框架结构
2 系统总体设计
2.1系统功能分析
2.2主要模块方案选择
2.2.1 主控模块方案选择
2.2.2 温湿度传感器选择
2.2.3 光照传感器选择
2.2.4 无线通信模块方案选择
2.2 系统总体框架设计
3 系统硬件设计
3.1 主要模块电路设计
3.1.1 STM32F103C8T6单片机简介
3.1.2 单片机最小系统
3.2 温湿度监测模块电路设计
3.3 光照监测模块电路设计
3.4 CO2监测模块电路设计
3.5 氨气监测模块电路设计
3.6 按键监测模块电路设计
3.7 显示模块电路设计
3.8 声光报警模块电路设计
3.9 继电器模块电路设计
3.10 WiFi模块电路设计
4 系统软件设计
4.1主程序流程设计
4.2温湿度监测子流程设计
4.2CO2模块子流程设计
4.4按键子流程设计
4.5显示模块子流程设计
4.6WiFi模块子流程设计
5 实物制作及功能测试
5.1实物制作
5.2实物功能测试
5.2.1温湿度测控测控实物测试
5.2.2CO2测控实物测试
5.2.3光照测控实物测试
5.2.4氨气测控实物测试
5.2.5WiFi模块实物测试
6 总结
参考文献
致 谢
附录
附录Ⅰ:整体电路图
附录Ⅱ:部分代码
购买后可查看具体内容!