APP下载

基于STM32单片机的自动浇花系统设计

2023-08-21王波王晋美孙毅浩乔俊超

现代信息科技 2023年12期

王波 王晋美 孙毅浩 乔俊超

摘  要:采用STM32单片机作为主控制器,设计一种自动浇花系统,该系统由主控模块、LP4056锂电池充电管理模块、稳压模块、按键控制模块、湿度采集模块、OLED显示输出模块和水泵控制模块组成。该系统能够实现对花卉土壤湿度的实时监测,监测数据传送至CPU模块,当湿度低于设定阈值时,由单片机启动水泵进行抽水,实现自动浇花功能。系统设计有充电及低功耗模式,工作灵活可靠,具有一定的推广价值。

关键词:STM32单片机;湿度;自动浇花;低功耗

中图分类号:TN709;TP273  文献标识码:A  文章编号:2096-4706(2023)12-0166-04

Design of Automatic Watering System Based on STM32 Single-Chip Microcomputer

WANG Bo1,2, WANG Jinmei1,2, SUN Yihao3, QIAO Junchao1

(1.School of Mechanical and Electrical Engineering, Huanghe Jiaotong University, Jiaozuo  454950, China;

2.Henan Intelligent Manufacturing Technology and Equipment Engineering Technology Research Center, Jiaozuo  454950, China;

3.State Grid Xinxiang County Electric Power Supply Company, Xinxiang  453000, China)

Abstract: This paper uses STM32 Single-Chip Microcomputer as the main controller, and designs an automatic watering system. The system is composed of main control module, LP4056 lithium battery charging management module, voltage stabilization module, key control module, humidity acquisition module, OLED display output module and water pump control module. The system can realize real-time monitoring of soil humidity of flowers, and the monitoring data is transmitted to the CPU module. When the humidity is lower than the set threshold, the Single-Chip Microcomputer starts the water pump to pump water to realize the automatic watering function. The system is designed with charging and low power consumption mode, which is flexible and reliable in working, and has certain promotion value.

Keywords: STM32 Single-Chip Microcomputer; humidity; automatic watering; low power consumption

0  引  言

近年來,越来越多的人在家或办公室种植喜爱的花卉,用来装饰环境和净化空气,有些花卉对湿度要求较高,需要及时浇水,但是紧凑的工作生活节奏,又使得很多人不能很好地照顾花卉,来不及浇水出现枯萎等情况[1],因此,设计一种自动浇花系统就显得非常重要。本设计根据自动浇花系统实际应用环境,选用STM32G030C8T6作为主控制器,选用湿度传感器实时监测土壤湿度值,采用水泵进行自动抽水浇花[2],设计有按键模块,改变监测土壤湿度的阈值;采用OLED显示屏显示湿度及电池电量值等参数,考虑到电池电量持续问题,本系统采用LP4056充电管理芯片设计了充电管理模块,可以实现锂电池的循环利用;系统的一个特点是增加了低功耗模式,当外围设备不工作时进入低耗的休眠状态,以达到整体的低功耗,提高整个系统的使用时间,通过以上模块实现自动浇花系统设计。……

登录APP查看全文