news 2026/4/16 10:19:03

【dz-927】基于stm32的温湿度检测设计

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-927】基于stm32的温湿度检测设计

基于stm32的温湿度检测设计

摘要

在农业种植、家庭园艺等场景中,环境温湿度、土壤湿度及光照等参数的稳定对植物生长至关重要。传统的人工监测与调控方式不仅耗时费力,还难以实现精准控制,易导致植物因环境不适出现生长问题。因此,研发一种能自动监测环境参数并实现智能调控的设备具有重要现实意义。

本设计提出一种基于 STM32F103C8T6 单片机的温湿度检测系统。系统主要功能包括:通过DHT11 温湿度传感器检测当前环境的温湿度;借助YL-69 土壤湿度传感器监测土壤湿度,当湿度小于最小值时,继电器控制水泵自动浇水,直至湿度大于最大值后停止;通过YW01 液位检测模块监测水池液位,液位小于最小值时,继电器控制水泵加水;利用5516 光照检测模块采集环境光照,光照大于最大值时,通过 ULN2003A 驱动四相五线步进电机控制遮阳棚打开;通过按键可设置各参数阈值,手动控制浇水、抽水及遮阳棚开关;所有测量数据通过OLED 显示屏实时展示;系统采用电池供电,确保便携使用。

该系统的作用在于,为植物生长提供了自动化的环境监测与调控方案。通过实时监测与智能响应,精准维持适宜的生长环境,减少人工干预,提高植物养护效率与成功率,为农业种植和家庭园艺提供有力支持。

关键词:STM32;温湿度检测;自动调控;土壤湿度;光照监测

Design of Temperature and Humidity Detection Based on STM32

Abstract

In agricultural planting, home gardening, and other scenarios, the stability of environmental temperature, humidity, soil moisture, and light parameters is crucial for plant growth. The traditional manual monitoring and regulation methods are not only time-consuming and laborious, but also difficult to achieve precise control, which can easily lead to growth problems of plants due to environmental discomfort. Therefore, developing a device that can automatically monitor environmental parameters and achieve intelligent regulation is of great practical significance.

This design proposes a temperature and humidity detection system based on STM32F103C8T6 microcontroller. The main functions of the system include: detecting the temperature and humidity of the current environment through the DHT11 temperature and humidity sensor; Using YL-69 soil moisture sensor to monitor soil moisture, when the humidity is below the minimum value, the relay controls the water pump to automatically water until the humidity exceeds the maximum value and then stops; Monitor the liquid level of the water tank through the YW01 liquid level detection module. When the liquid level is below the minimum value, the relay controls the water pump to add water; Use the 5516 light detection module to collect ambient light. When the light exceeds the maximum value, use ULN2003A to drive a four phase five wire stepper motor to control the opening of the sunshade; By pressing buttons, various parameter thresholds can be set, and watering, pumping, and sunshade switches can be manually controlled; All measurement data is displayed in real-time on an OLED screen; The system is powered by batteries to ensure portability.

The function of this system is to provide automated environmental monitoring and regulation solutions for plant growth. By real-time monitoring and intelligent response, we can accurately maintain a suitable growth environment, reduce manual intervention, improve plant maintenance efficiency and success rate, and provide strong support for agricultural planting and home gardening.

Keywords:STM32; Temperature and humidity detection; Automatic regulation; Soil moisture; Light monitoring

目 录

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 显示模块电路设计

3.10 按键模块电路设计

3.11 电源模块电路设计

4 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 OLED显示子流程设计

4.4 温湿度检测模块子流程设计

4.5 土壤环境检测模块子流程设计

4.6 独立按键子流程设计

4.7 ADC模数转换子流程设计

5实物制作与功能测试

5.1 实物制作

5.2 温湿度检测功能测试

5.3 土壤湿度检测与自动浇水功能测试

5.4 液位检测与自动补水功能测试

5.5 光照检测与遮阳棚控制功能测试

5.6 阈值设置与参数显示功能测试

6 总结

参考文献

致谢

附录A 原理图

附录B PCB

附录C 主程序

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/16 10:14:41

专题:2025医疗行业核心洞察报告:AI医疗、医疗器械、投融资与新药|附380+份报告PDF、数据、可视化模板汇总下载

原文链接:https://tecdat.cn/?p44586 原文出处:拓端抖音号拓端tecdat 医疗健康行业正处于硬科技驱动的范式变革期,AI深度赋能、医疗器械全球化、创新药技术突破与投融资结构重构四大核心趋势交织,推动产业从“规模扩张”向“价值…

作者头像 李华
网站建设 2026/4/16 3:37:02

为什么不采用级联删除而选择软删除

在数据库设计中,如果涉及级联删除的问题,不要通过外键的方式来进行操作,需要使用事务的方式来进行操作,为什么不采用外键的方式主要有以下两点:在数据库中,外键会关联主键,在主键进行删除的同时…

作者头像 李华
网站建设 2026/4/8 5:29:11

传统开发成本过高?低代码平台如何降低企业数字化转型预算

在数字化浪潮席卷各行各业的今天,“成本太高” 成为阻碍企业尤其是中小企业数字化转型的首要难题。传统开发模式下,人力薪资、漫长周期、维护损耗等成本层层叠加,一套常规业务系统的开发投入动辄数十万甚至上百万,让不少企业望而却…

作者头像 李华
网站建设 2026/3/30 6:24:26

如何备份docker images

备份Docker镜像主要有以下几种方式&#xff1a;方法一&#xff1a;docker save / docker load&#xff08;推荐&#xff09;备份单个镜像bash复制# 保存镜像为tar文件&#xff08;包含所有标签&#xff09; docker save -o backup.tar <镜像名>:<标签># 示例 docke…

作者头像 李华
网站建设 2026/4/14 2:54:21

探索成熟的FTP替代方案:现代化文件传输的新选择

随着数据规模的扩大和安全需求的提升&#xff0c;传统FTP协议已逐渐显露出诸多局限。企业和技术团队需要更安全、高效、可靠的文件传输解决方案来满足现代化业务需求。本文将系统梳理当前主流的FTP替代方案&#xff0c;为不同场景下的文件传输需求提供参考。 云存储与文件同步服…

作者头像 李华