基于单片机的环境温湿度光照度检测装置设计毕业设计

摘 要

本课题的研究目的是为人们提供一种能够实时了解所处环境质量信息的仪器,包括温度、湿度、光照度,使人们能够及时获知信息并做出相应的调整。

本文采用STC89C52单片机来作为控制核心,实现了对温、湿度的检测、光照度检测和LCD实时显示电路等硬件电路的设计,由于其功能的实现主要通过软件编程来完成,这就降低了硬件电路的复杂性,其成本也有所降低,而且还能够完成复杂硬件电路难以实现的任务。配置新式的微型低功耗传感器,温度传感器为18B20,湿度传感器为DHT11,光照度传感器为TSL2561,实现了环境温度,湿度,光照强度三个参数的采集,存储,显示等功能,另外,本系统还具有报警功能,当传感器所采集的数据不在使用者所设定的范围内,蜂鸣器就会报警以提醒使用者,系统运行可靠,结构简单,性价比高。

关键字:STC89C52单片机、温湿度、光照度、液晶显示、报警

I

Abstract

The research projects is to provide people an instruments with a real-time information about the quality of the

environment , including temperature, humidity, light intensity, so that people can be informed in a timely manner and make appropriate adjustments.

In this paper, as a control STC89C52 microcontroller core to achieve the design of the right temperature and humidity testing, light intensity detection circuit and LCD display real-time hardware and so on. The realization of its functions mainly through software programming to complete, which not only reduces the hardware circuit complexity and its cost, but also to complex hardware circuits difficult to achieve the task.Using of new low-power micro-sensors, temperature sensors 18B20, humidity sensors DHT11, illumination sensor TSL2561, to achieve the environmental temperature, humidity and light intensity three parameters of the acquisition, storage, display and other functions. in addition, the system also has alarm functions, when data collected of the sensor is not within the scope setted by the user, the buzzer will alarm to alert the user.The system is reliable, simple and cost-effective.

II

Keywords: STC89C52 microcontroller, temperature, humidity, light, the liquid crystal display, alarm function

III

目 录

第一章 绪论 ...................................... 1

1.1 选题背景及意义 ........................... 1 1.2 传感器介绍 ............................... 2

1.2.1 温度传感器 ......................... 2 1.2.2 湿度传感器 ......................... 4 1.2.3 光照度传感器 ....................... 7 1.3 课题主要内容及结构安排 .................. 10 第二章 方案比较和选择 ........................... 11

2.1 温度传感器的选择 ........................ 11 2.2 湿度传感器的选择 ........................ 12 2.3光照度传感器的选择 ....................... 14 2.4 单片机的选择 ............................ 15 2.5 本章小结 ................................ 16 第三章 系统整体设计 ............................. 16

3.1 信号采集 ................................ 17

3.1.1 光照度传感器 ...................... 17 3.1.2 温度传感器 ........................ 22 3.1.3 湿度传感器 ........................ 27 3.2 信号分析与处理 .......................... 30

3.2.1 单片机最小系统 .................... 31

IV

联系客服:779662525#qq.com(#替换为@)