news 2026/4/15 18:10:32

【dz-1008】基于单片机的环境监测系统设计

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-1008】基于单片机的环境监测系统设计

摘要

随着人们对生活环境质量关注度的不断提升,对环境参数的精准监测与及时预警变得尤为重要。传统的环境监测方式多依赖人工采样和实验室分析,不仅耗时费力、响应滞后,还存在数据获取不及时、监测范围有限等问题,难以满足实时、全面的环境监测需求。​

基于 STM32F103C8T6 单片机的环境监测系统,整合了 DHT11 温湿度传感器、GP2Y10 粉尘浓度传感器、三杯式风速传感器、FX 风向模块、YS 雨量模块、OLED 显示屏、3 个独立按键及 ESP8266WiFi 模块等,实现了对环境参数的自动化监测、报警及远程控制。系统核心功能包括:通过 DHT11 实时监测环境温湿度,当温湿度超出阈值时启动声光报警;借助 GP2Y10 检测粉尘浓度,浓度大于最大值时进行声光报警;利用 三杯式风速传感器监测风速,风速大于最大值时触发声光报警;通过 FX 风向模块获取风向信息;依靠 YS 雨量模块监测雨量,雨量大于最大值时发出声光报警;OLED 显示屏实时显示各项监测数据;3 个独立按键可用于设置各参数阈值;ESP8266WiFi 模块将数据发送至手机端,且手机端能设置各阈值。​该系统的实现,有效提升了环境监测的实时性与准确性,及时对异常环境参数进行预警,减少了人工干预,为环境管理提供了高效、可靠的解决方案,同时为同类环境监测设备的研发提供了参考,具有较高的实际应用价值。​

关键词:STM32F103C8T6;环境监测;传感器;声光报警;WiFi 通信;阈值设置

ABSTRACT

With the increasing attention paid to the quality of living environment, accurate monitoring and timely early warning of environmental parameters have become particularly important. Traditional environmental monitoring methods mostly rely on manual sampling and laboratory analysis, which are not only time-consuming and labor-intensive with delayed responses, but also have problems such as untimely data acquisition and limited monitoring range, making it difficult to meet the needs of real-time and comprehensive environmental monitoring.​

The environmental monitoring system based on the STM32F103C8T6 microcontroller integrates DHT11 temperature and humidity sensor, GP2Y10 dust concentration sensor, wind speed module, FX wind direction module, YS rainfall module, OLED display, 3 independent buttons and ESP8266WiFi module, etc., realizing automatic monitoring, alarm and remote control of environmental parameters. The core functions of the system include: real-time monitoring of environmental temperature and humidity through DHT11, activating sound and light alarm when temperature and humidity exceed the threshold; detecting dust concentration with GP2Y10, conducting sound and light alarm when the concentration is greater than the maximum value; monitoring wind speed with wind speed module, triggering sound and light alarm when the wind speed is greater than the maximum value; obtaining wind direction information through FX wind direction module; monitoring rainfall by YS rainfall module, issuing sound and light alarm when the rainfall is greater than the maximum value; OLED display showing various monitoring data in real-time; 3 independent buttons for setting each parameter threshold; ESP8266WiFi module sending data to the mobile phone, and the mobile phone can set each threshold.​

The implementation of this system effectively improves the real-time performance and accuracy of environmental monitoring, timely warns of abnormal environmental parameters, reduces manual intervention, provides an efficient and reliable solution for environmental management, and also offers a reference for the research and development of similar environmental monitoring equipment, with high practical application value.​

Keywords:STM32F103C8T6; Environmental monitoring; Sensor; Sound and light alarm; WiFi communication; Threshold setting​

目录

第 1 章 绪论

1.1 研究的目的及意义

1.2 国内外发展情况

1.3 本文主要研究内容

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

2.1 主要元器件选择

2.1.1 主控芯片选择

2.1.2 温湿度传感器选择

2.1.3 粉尘浓度传感器选择

2.1.4 风速模块选择

2.1.5 风向模块选择

2.1.6 雨量模块选择

2.1.7 显示模块选择

2.1.8 按键模块选择

2.1.9 WiFi 模块选择

2.2整体设计方案

第 3 章 硬件设计

3.1 主控电路模块

3.2 温湿度传感器电路

3.3 粉尘浓度传感器电路

3.4 风速模块电路

3.5 风向模块电路

3.6 雨量模块电路

3.7 显示模块电路

3.8 按键模块电路

3.9 WiFi 模块电路

3.10 声光报警电路

第4章 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 OLED显示子流程设计

4.4 独立按键子流程设计

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

4.6 ADC模数转换子流程设计

4.7 PM2.5检测模块子流程设计

4.8 WiFi模块子流程设计

第 5 章 实物测试

5.1 整体实物测试

5.2 温湿度传感器功能测试

5.3 粉尘浓度传感器功能测试

5.4 风速模块功能测试

5.5 风向模块功能测试

5.6 雨量模块功能测试

5.7 WiFi 模块功能测试

5.8 声光报警模块功能测试

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

第 6 章 总结与展望

6.1 总结

6.2 展望

致谢

参考文献

附录

附录一:原理图

附录二:PCB

附录三:主程序

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

【dz-1012】小型无士栽培自动控制系统设计与实现

摘要 在无土栽培领域,环境参数与营养液状态的精准调控对作物生长质量与产量起着决定性作用。传统无土栽培管理多依赖人工巡检和经验调节,存在参数控制滞后、营养液配比失衡、资源浪费等问题,难以满足精细化种植的严苛需求。 基于 STM32F103…

作者头像 李华
网站建设 2026/4/12 22:26:39

绿色工厂与上市公司匹配数据(2017-2023)

1729顶刊收割机!绿色工厂与上市公司匹配数据(2017-2023)数据简介2016年工业和信息化部(以下简称工信部)启动了第一批绿色制造体系示范建设项目,该项目涵盖绿色工厂、绿色产品、绿色园区、绿色供应链等多方面…

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

3 大核心 + 全产业链!小理家按摩机器人,选对的关键在这

随着亚健康问题日益普遍,智能康养需求持续攀升,按摩机器人作为替代传统人工按摩的重要品类,市场规模实现快速增长。面对市面上众多品牌,消费者与投资者该如何选择?从技术实力、商业模式、服务体系等核心维度来看&#…

作者头像 李华
网站建设 2026/4/15 14:34:25

gpt-oss-20b-WEBUI文本生成实战:云端3步快速体验

gpt-oss-20b-WEBUI文本生成实战:云端3步快速体验 你是不是也经常刷到同行用AI写出爆款文章,标题吸睛、内容流畅、观点犀利,仿佛背后有个专业编辑团队?而你自己还在熬夜改稿、绞尽脑汁想选题,效率低还不出效果。更头疼…

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

AI产品经理:未来5年最值得All In的职业,小白也能上手

文章指出AI产品经理是未来5年最有前景的职业,大多数人想抓住AI机会但处于观望、迷茫或跑偏三种状态。AI产品经理分为工具型、应用型和专业型三个层次,对多数人而言,成为应用型AI产品经理是最佳选择。文章提出三步学习法:夯实产品基…

作者头像 李华