news 2026/5/1 9:33:57

【dz-700】基于STM32智能水族箱的设计

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-700】基于STM32智能水族箱的设计

摘要

在水族饲养日益普及的当下,水族箱环境的精准调控对保障水生生物的健康生长至关重要。传统的水族箱管理依赖人工操作,存在监测不及时、调控精度低、劳动强度大等问题,难以满足现代化、精细化饲养的需求。​

基于 STM32F103C9T6 单片机的智能水族箱系统,整合了超声波水位传感器、防水式 DS18B20 温度传感器、PH 检测模块、浊度传感器、光敏电阻、人体热释电 D20S3 传感器、RTC 时钟模块、按键、OLED 显示屏、WIFI 模块及执行设备(加水装置、防水加热棒、换水水泵、补光设备、步进电机投喂装置、充氧设备等),实现了水族箱环境的自动化监测与智能调控。系统核心功能包括:通过超声波传感器检测水位,当水位低于设置最小值时启动加水装置;借助防水式 DS18B20 检测水温,水温低于设置最小值时触发防水加热棒工作;通过 PH 检测模块监测 PH 值,当 PH 值超出设定范围时,启动水泵进行换水;利用浊度传感器检测水体浑浊度,大于设置最大值时,控制水泵换水;通过光敏电阻检测光照值,低于设置最小值时自动补光;通过人体热释电 D20S3 传感器监测水族箱周围是否有人,检测到人时控制补光灯亮起;借助内部 RTC 获取时间,支持通过按键设置 3 个定时投喂时间点,时间到时开启步进电机,10 秒后自动关闭;支持通过按键设置充氧间隔时间及各参数阈值;通过 OLED 显示屏实时显示各项监测数据;利用 WIFI 模块将数据发送至手机端,实现手机端调节各阈值及控制加水、排水、加热、投喂、补光和模式切换。​

该系统的实现,有效提升了水族箱环境调控的自动化与智能化水平,减少了人工干预,确保了水生环境参数的稳定与适宜,为水生生物的健康生长提供了高效、可靠的解决方案,同时为同类智能水族设备的研发提供了参考,具有较高的实际应用价值。

关键词:STM32F103C9T6;智能水族箱;环境监测;自动调控;传感器;WIFI 通信

ABSTRACT

With the increasing popularity of aquatic breeding, precise regulation of aquarium environments is crucial for ensuring the healthy growth of aquatic organisms. Traditional aquarium management relies on manual operations, which have problems such as untimely monitoring, low regulation accuracy, and high labor intensity, making it difficult to meet the needs of modern and refined breeding.​

The intelligent aquarium system based on the STM32F103C9T6 microcontroller integrates ultrasonic water level sensors, waterproof DS18B20 temperature sensors, PH detection modules, turbidity sensors, photoresistors, human pyroelectric D20S3 sensors, RTC clock modules, buttons, OLED displays, WIFI modules, and executive devices (water adding devices, waterproof heating rods, water change pumps, supplementary lighting equipment, stepper motor feeding devices, oxygenation equipment, etc.), realizing automatic monitoring and intelligent regulation of the aquarium environment. The core functions of the system include: detecting water level through an ultrasonic sensor, starting the water adding device when the water level is lower than the set minimum value; using a waterproof DS18B20 to detect water temperature, triggering the waterproof heating rod to work when the water temperature is lower than the set minimum value; monitoring PH value through a PH detection module, starting the water pump for water change when the PH value exceeds the set range (using two relays); detecting water turbidity through a turbidity sensor, controlling the water pump to change water when the turbidity is greater than the set maximum value (using two relays); detecting light intensity through a photoresistor, automatically supplementing light when the light intensity is lower than the set minimum value; monitoring whether there is a person around the aquarium through a human pyroelectric D20S3 sensor, and controlling the supplementary light to turn on when a person is detected; obtaining time through the internal RTC, and supporting setting 3 定时 feeding time points through buttons, when the feeding time comes, the stepper motor is turned on, and automatically turned off after 10 seconds; supporting setting the interval for oxygenation through buttons; allowing setting of various thresholds through buttons; displaying measured values through an OLED display; sending measured data to the mobile phone through a WIFI module, enabling the mobile phone to adjust various thresholds and control water adding, draining, heating, feeding, supplementary lighting, and mode switching.​

The implementation of this system effectively improves the automation and intelligence level of aquarium environment regulation, reduces manual intervention, ensures the stability and suitability of aquatic environment parameters, provides an efficient and reliable solution for the healthy growth of aquatic organisms, and also offers a reference for the research and development of similar intelligent aquatic equipment, with high practical application value.

Keywords:STM32F103C9T6; Intelligent aquarium; Environmental monitoring; Automatic regulation; Sensor; WIFI communication​

目录

第 1 章 绪论

1.1 研究的目的及意义

1.2 国内外发展情况

1.3 本文主要研究内容

第 2 章 设计思路与方案论证

2.1 主要元器件选择

2.1.1 主控芯片选择

2.1.2 超声波水位传感器选择

2.1.3 水温传感器选择

2.1.4 PH 检测模块选择

2.1.5 浊度传感器选择

2.1.6 光照检测模块选择

2.1.7 人体热释电传感器选择

2.1.8 继电器模块选择

2.1.9 步进电机及驱动模块选择

2.1.10 RTC 时钟模块选择

2.1.11 按键模块选择

2.1.12 显示模块选择

2.1.13 WIFI 模块选择

2.2整体设计方案

第 3 章 硬件设计

3.1 主控电路模块

3.2 超声波水位传感器电路

3.3 水温传感器电路

3.4 PH 检测模块电路

3.5 浊度传感器电路

3.6 光照检测模块电路

3.7 人体热释电传感器电路

3.8 步进电机驱动电路

3.9 显示模块电路

3.10 WIFI 模块电路

3.11 按键模块电路

3.12 继电器驱动电路

第4章 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 独立按键

4. 4 A/D模数转换子流程

4.5 直流电机-MX1508驱动模块子流程

4.6 温度检测模块子流程

4.7 时钟模块子流程

4.8 步进电机子流程

4.9 超声波检测模块子流程

4.10 OLED显示流程设计

4.11 WiFi模块子流程设计

第 5 章 实物测试

5.1 整体实物测试

5.2 超声波水位传感器功能测试

5.3 水温传感器功能测试

5.4 PH 检测模块功能测试

5.5 浊度传感器功能测试

5.6 光照与人体感应联动功能测试

5.7 步进电机投喂功能测试

5.8 充氧设备功能测试

5.9 WIFI 模块功能测试

5.10 按键设置与显示功能测试

第 6 章 总结与展望

6.1 总结

6.2 展望

致谢

参考文献

附录

附录一:原理图

附录二:PCB

附录三:主程序

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

冬 日 暖 阳

冬日阳光 闪烁着真挚祝福 烦恼系在风尖 随孤寂柳枝 忘我舞蹈 摆动间 触见生命的灵动 珍爱寻常日子 善待每一次相逢 心中的太阳 便永远灿烂

作者头像 李华
网站建设 2026/4/30 10:23:17

FLUX.2‑klein‑4B:步数蒸馏实现 4 步亚秒级图像生成,在消费级 GPU 上体验实时交互;Vehicles OpenImages 数据集:专注车辆检测与定位

当前,主流图像生成模型虽能产出高质量结果,但推理速度慢、显存需求高,交互模式仍停留在「离线工具」时代,用户输入提示后只能被动等待,无法实现实时响应与交互。这限制了 AI 在实时设计、快速原型等场景的应用。 在此背…

作者头像 李华
网站建设 2026/5/1 6:54:07

高精度农业AI模型 玉米幼苗与杂草检测数据集 深度学习框架YOLOV8模型如何训练玉米幼苗检测数据集及玉米杂草检测数据集 识别幼苗及杂草

玉米幼苗与杂草检测 YOLO 数据集 的详细信息整理成的规范表🌽 玉米幼苗与杂草检测 YOLO 数据集概览项目内容数据集名称玉米幼苗与杂草检测 YOLO 数据集总图像数量3,042 张类别数量2 类类别标签corn(玉米幼苗)、weed(杂草&#xff…

作者头像 李华
网站建设 2026/5/1 4:45:14

<span class=“js_title_inner“>第146篇:美国棱镜门计划技术解密(二):被监听用户数据的审核、分发与入库全流程</span>

Part1 前言 大家好,我是ABC_123。上一篇文章着重给大家讲解了美国斯诺登曝光的棱镜门事件的技术细节,本篇文章我们继续介绍剩余部分,这篇文章比上一篇较难理解,是PRISM棱镜门计划审核流程及数据汇聚方式。Part2 技术研究过程 棱镜…

作者头像 李华
网站建设 2026/5/1 4:46:02

计算机毕业设计之基于springboot的在线作业管理系统的设计与实现

时代在飞速进步,每个行业都在努力发展现在先进技术,通过这些先进的技术来提高自己的水平和优势,在线作业管理系统当然不能排除在外。在线作业管理系统是在实际应用和软件工程的开发原理之上,运用java语言以及SpringBoot框架进行开…

作者头像 李华
网站建设 2026/5/1 5:48:04

计算机毕业设计之nodejs药品零售企业进销存管理系统

本文首先实现了药品零售企业进销存管理系统设计与实现管理技术的发展,随后依照传统的软件开发流程,最先为系统挑选适用的言语和软件开发平台,依据需求分析开展控制模块制做和数据库查询构造设计,随后依据系统整体功能模块的设计&a…

作者头像 李华