毕 业 设 计 说 明 书
课题名称 |
基于STM32的室内环境监测系统 |
院 系 |
计算机与软件学院 |
专 业 |
嵌入式技术与应用 |
班 级 |
嵌设1913 |
学 号 |
1902423134 |
学生姓名 |
刘倚帆 |
指导教师: |
白顺科 |
2022 年 5 月 7 日
计算机与软件学院
我谨在此承诺:本人所写的毕业论文《基于STM32的室内环境监测系统》,由本人独立完成,没有抄袭行为,凡涉及其他作者的观点和材料,均作了注释与说明,若有不实,后果由本人承担。
承诺人(签名):
2022年 5月 7日
目录
1 绪论...........................................................1
1.1 背景和意义.............................................1
1.2系统设计目标..................................1
2 系统分析与设计.................................................2
3 硬件设计 ......................................................3
3.1硬件总体设计............................................3
3.2硬件选型.................................................4
3.2.1 STM32F103C8T6最小系统..................4
3.2.2 DHT11模块................................4
3.2.3 MQ-2模块.....................................5
3.2.4 光敏电阻模块................................6
3.2.5 0.96OLED模块.........................7
3.2.6有源蜂鸣器模块.........................8
3.2.7 继电器模块...................................9
3.3 小结..............................................10
4 软件设计.....................................................11
4.1 软件总体设计..........................................11
4.2 主程序设计............................................12
4.3 温湿度监测设计........................................13
4.4 烟雾监测设计..........................................15
4.5 光照监测设计.........................................17
4.6 屏幕显示设计.......................................18
5 系统实现与测试............................................20
5.1 系统的实现..................................21
5.2 系统的测试.....................................21
6 结论.......................................................23
致谢...........................................................24
参考文献................................................25
摘要
本课题旨在研究温湿度检测控制系统:通过DHT11温湿度传感器检测环境温湿度,将采集到的数据传给单片机进行处理,单片机处理后,当温湿度高于或者低于设定阀值后进行LED指示灯报警,实现自动化温湿度控制系统。采用STM32F103C8T6最小系统作为主控芯片实现最小系统、温湿度传感器、LED灯指示电路、程序下载电路组成,实现本次课题的硬件电路的设计与搭建。通过Keil5软件编写单片机程序,设置温湿度的阀值,采用Altium Designer设计绘制本次课题的原理图,软硬件结合设计,进行仿真实现本次课题的功能。本次课题使用到的技术:KEIL软件编译程序、Altium Designer设计原理图并仿真、温湿度传感器的使用、数码管驱动方法、单片机最小系统。
关键词:环境监测;光敏电阻模块;STM32F103C8T6芯片;DHT11模块; MQ-2模块
Summary
The purpose of this project is to study the temperature and humidity detection and control system: detect the ambient temperature and humidity through the DHT11 temperature and humidity sensor, transmit the collected data to the microcontroller for processing, and after the microcontroller is processed, when the temperature and humidity are higher or lower than the set threshold, the LED indicator alarm is carried out to realize the automatic temperature and humidity control system. The STM32F103C8T6 minimum system is used as the main control chip to realize the minimum system, temperature and humidity sensor, LED lamp indication circuit, and program download circuit to realize the design and construction of the hardware circuit of this project.Through Keil5 software, we write a microcontroller program, set the threshold of temperature and humidity, use Altium Designer design to draw the schematic of this project, comb