设计说明书
总字数:20000+
摘要
随着农业现代化、智能家居等领域的快速发展,环境参数(温度、湿度、水位、光照)的稳定与否直接影响作物生长、家居舒适度及设备安全,实时精准的环境监测与自动调控成为关键需求。若环境温度过高或过低、土壤湿度过干或过涝、水位异常或光照不适,且未能及时干预,可能导致作物减产、家居环境恶化甚至设备损坏。因此,研发一种能多维度监测环境参数、自动调控且操作便捷的环境监测系统具有重要现实意义。
本设计提出了一种基于 STC89C52 单片机的环境监测系统。系统主要功能包括:通过 DS18B20 模块测量环境温度,温度低于设置最小值时,继电器控制加热片升温,高于设置最大值时,继电器控制风扇降温,同时触发声光报警;通过 YL-69 土壤湿度检测模块测量土壤湿度,湿度低于设置最小值时,继电器控制水泵加水,高于设置最大值时,继电器控制风扇除湿,同步启动声光报警;通过 YW-01D 模块检测水位,水位低于设置最小值时,立即进行声光报警;通过 5516 光照检测模块测量光照强度,光照低于设置最小值时,继电器控制补光灯补光,高于设置最大值时,SG90 舵机控制打开遮阳板,且伴随声光报警;用户可通过按键灵活设置温度、湿度、水位、光照的各项阈值;所有监测数据与阈值均通过 LCD1602 显示屏清晰展示。
该环境监测系统的作用在于,为农业种植、智能家居等场景提供了一体化的环境监测与自动调控工具。通过实时监测多维度环境参数、自动执行调控动作及及时报警,能有效维持环境稳定,减少人工干预成本,保障作物健康生长、提升家居舒适度,同时避免因环境异常引发的安全问题,为相关场景的高效运营提供可靠保障。
关键词:STC89C52;环境监测系统;多参数监测;自动调控;声光报警;LCD1602 显示
Design of Environmental Monitoring System
Abstract
With the rapid development of agricultural modernization, smart home and other fields, the stability of environmental parameters (temperature, humidity, water level, light) directly affects crop growth, home comfort and equipment safety. Real time and accurate environmental monitoring and automatic regulation have become key requirements. If the environmental temperature is too high or too low, the soil moisture is too dry or too wet, the water level is abnormal or the light is not suitable, and timely intervention is not taken, it may lead to crop yield reduction, deterioration of home environment, and even equipment damage. Therefore, it is of great practical significance to develop an environmental monitoring system that can monitor environmental parameters from multiple dimensions, automatically regulate and operate conveniently.
This design proposes an environmental monitoring system based on STC89C52 microcontroller. The main functions of the system include: measuring the ambient temperature through the DS18B20 module. When the temperature is below the set minimum value, the relay controls the heating element to heat up. When it is above the set maximum value, the relay controls the fan to cool down and triggers an audible and visual alarm; Measure soil moisture through the YL-69 soil moisture detection module. When the humidity is below the set minimum value, the relay controls the water pump to add water. When it is above the set maximum value, the relay controls the fan to dehumidify and synchronously starts the sound and light alarm; Detect the water level through the YW-01D module, and immediately sound and light an alarm when the water level is below the set minimum value; Measure the light intensity through the 5516 light detection module. When the light is below the set minimum value, the relay controls the supplementary light to supplement the light. When it is above the set maximum value, the SG90 servo controls the opening of the sun visor, accompanied by an audible and visual alarm; Users can flexibly set various thresholds for temperature, humidity, water level, and lighting through buttons; All monitoring data and thresholds are clearly displayed on the LCD1602 screen.
The role of this environmental monitoring system is to provide an integrated environmental monitoring and automatic control tool for scenarios such as agricultural planting and smart homes. By real-time monitoring of multi-dimensional environmental parameters, automatic execution of regulatory actions, and timely alarms, it is possible to effectively maintain environmental stability, reduce manual intervention costs, ensure healthy crop growth, improve home comfort, and avoid safety issues caused by abnormal environments, providing reliable guarantees for the efficient operation of related scenes.
Keywords:STC89C52; Environmental monitoring system; Multi parameter monitoring; Automatic regulation; Sound and light alarm; LCD1602 display
目 录
1 绪论
1.1 研究背景及意义
1.2 国内外研究现状
1.3 主要内容
2 系统总体方案设计
2.1系统总体设计
2.2 主要模块方案选择
3 系统硬件设计
3.1 总体硬件框架
3.2 主控模块电路设计
3.3 温度检测模块电路设计
3.4 湿度与水位检测模块电路设计
3.5 光照检测模块电路设计
3.6 执行调控模块电路设计
3.7 显示模块电路设计
3.8 按键模块电路设计
3.9 声光报警模块电路设计
4 系统程序设计
4.1 编程软件介绍
4.2 主机系统主流程设计
4.3 独立按键
4.4 温度检测模块子流程
4.5 A/D模数转换子流程
4.6 LCD1602液晶显示子流程
4.7 舵机模块子流通
4.8 土壤湿度检测模块子流程设计
4.9 液位检测模块子流程设计
4.10 光照检测模块子流程设计
5 实物制作与功能测试
5.1 实物制作
5.2 温度监测与自动调控功能测试
5.3 土壤湿度监测与自动调控功能测试
5.4 水位监测与报警功能测试
5.5 光照监测与自动调控功能测试
5.6 阈值设置功能测试
5.7 数据显示功能测试
6 总结
参考文献
致谢
附录A 原理图
附录B PCB
附录C 主程序
购买后可查看具体内容!