news 2026/4/16 7:01:52

【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/4/8 13:04:21

云服务器:从技术革新到产业重构的进化之路​​

如果说互联网是数字时代的高速公路,那么云服务器就是支撑这条公路高效运转的核心枢纽。从早期单一的物理服务器托管,到如今融合云计算、大数据、人工智能的综合服务平台,云服务器的进化史,正是数字经济重构产业格局的缩影。它不仅…

作者头像 李华
网站建设 2026/4/15 19:38:44

云服务器深度解析:技术内核、应用场景与上云避坑指南​

在数字时代,云服务器早已不是抽象的技术概念,而是支撑个人数字生活、企业业务运转的核心基础设施。但多数人只知其 “好用”,却不懂其 “为何好用”;企业急于上云,却常陷入选型误区。本文将从技术内核、场景适配、避坑…

作者头像 李华
网站建设 2026/4/13 9:52:47

2026赶紧抓住风口!转行AI大模型,收入直接暴涨10倍+

前言 恕我直言,就这几天,各大厂都在裁员,什么开发测试运维都裁,只有大模型是急招人。 你说你不知道大模型是什么?那可太对了,你不知道说明别人也不知道,就是要趁只有业内部分人知道的时候入局&a…

作者头像 李华
网站建设 2026/4/15 22:59:27

微型LoRa数传模块:无线5KM传输,双向透明传输工业级通信方案

微型 LoRa 数传模块,是一种基于LoRa(Long Range,远距离) 扩频调制技术的小型化、低功耗、远距离无线通信硬件,核心作用是实现设备间小数据量的长距离无线传输,是物联网(IoT)低功耗广域网(LPWAN)场景的核心通信单元。一、基本功能 …

作者头像 李华