news 2026/5/4 3:57:48

【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 10:32:41

云端之上:支撑数字文明的隐形基石​

​ 当我们轻点手机屏幕收发信息、在视频网站追剧、通过在线办公软件协作时,一个庞大而无形的系统正在幕后默默运转 —— 这就是云服务器构建的数字生态。它不像实体服务器那样有可见的机箱与线路,却以分布式架构跨越地理边界,成为支撑现代社…

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

2026 高性价比|预算友好的 AI 论文写作工具推荐

2026年,市面上AI论文写作工具层出不穷,对于学生党和初入学术领域的研究者而言,既要高效辅助写作,又要控制成本,选对工具至关重要。动辄上百元的月度订阅,常让人陷入“想省成本又怕踩坑”的两难,…

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

人工智能大模型技术解析:程序员和小白的必读指南

人工智能大模型是通过超大规模参数和海量训练数据构建的基础模型,具有强泛化能力和多任务处理能力。其发展历经萌芽期、沉淀期和爆发期三个阶段。大模型由海量数据与算法、巨量算力平台、核心能力及服务应用四部分组成,能够实现内容生成、知识问答、代码…

作者头像 李华
网站建设 2026/5/2 20:05:17

收藏!30+程序员零基础转行大模型,2个月拿2w+offer,别只看理论不行动

作为一名30北漂程序员,我用2个月时间,从零基础跨界大模型领域,成功斩获月薪2w的offer,彻底摆脱了十年“码农内耗”的困境。今天把我的亲身经历转行全攻略毫无保留分享出来,尤其适合迷茫想转行、只懂基础编程、不敢迈出…

作者头像 李华
网站建设 2026/5/1 18:59:51

教培管家第14讲:家长端——打造合规且顺畅的登录门户

目录⏳ 前情回顾🎯 本节目标为什么要专门设计一个“登录页”?第一步:数据建模——动态协议管理第二步:搭建后台配置管理页第三歩:创建小程序第四步:搭建登录页4.1 创建变量4.2 搭建页面布局第五步&#xff…

作者头像 李华