基于51单片机的温室大棚温湿度检测报警系统设计

  • 格式:docx
  • 大小:319.62 KB
  • 文档页数:21

湖南科技大学

课程设计

课程设计名称: 多路温湿度测试报警系统

学 生 姓 名:

学 院: 机电工程学院

专 业 及 班 级 : 09 级测控一班

学 号: 0903030110

指导教师: 2013 年 01 月 18 日

湖南科技大学机电工程学院

课程设计任务书

课程设计名称 专业综合课程设计 课程设计题目 温室大棚温湿度检测系统设计

学生姓名

年级 09级 专业 测控技术与

仪器 学号

0903030110

指导教师

单位 湖南科技大学重点实验室

课程设计起止日期 2012-12-30~2013-1-18

设计内容:

本设计是基于 AT89c51 单片机的大棚温湿度控制系统, 通过多个 DHT11 温湿度传 感器采集不同地点的坏境数据,并用 LCD12864 实时显示;程序中设置所需的温湿度,若显 示的坏境数据超过设置值,则通过蜂鸣器报警。

任务与要求:

湿度 ±5% 0~100% 温度 ±1% 0~ 100℃

限定( 20~ 100) 限定( 1~ 20%)

LCD 实时显示

电源 DC 5V 工作环境温度小于 90℃ 湿度小于 90%

可设置报警温湿度

主要参考资料:

单片机编程实用技巧丛书

传感器原理与应用

LCD1602 系列液晶显示与模块设计摘要

随着现代技术的不断发展, 生产生活现代化的不断提高, 用温室大棚技术来 培养农作物可以显著的提高农作物产量, 降低农业生产对自然环境和气候变化的 要求。然而温室大棚对于温度湿度等一系列空气成分指标要求非常严格,

而现代 化的温室大棚则必须有一整套温度湿度的检测和控制系统, 本设计就是为了适应 现代温室大棚的需求, 更加方便有效地观测环境温湿度, 以便于更为科学合理地 对温室大棚进行管理。 本设计是以单片机为核心, 配合温湿度传感器, 以及相关 的外围电路组成的检测系统, 可以接收所测环境的温度和湿度信号, 检测人员可 以通过 LCD显示的数据, 实时监控环境的温度和湿度情况,

如果检测到的数据超 过所设定的温湿度上下限, 则系统会自动产生相应的声光报警。 所有的测量操作 都可以通过主机控制软件来实现, 温度和湿度传感器得到的测量信号, 经电路转 换为电信号, 然后通过转换送到单片机进行数据处理, 经软件分析处理后送显示 装置。

本系统包括系统硬件和软件设计 , 可靠性高,结构简单,系统还应用 RS232

与上位机相连接, 可以设置自动记录温度、 湿度的相关的参数, 也可以设置每隔 一定的时间自动记录,操作简便,应用广泛。

关键词 :STC89C52单片机,温湿度传感器, LCD显示Abstract

With the development of modern technology, the production of

modern life continues to improve, for greenhouse technology to

cultivate crops can significantly increase the yield of crops,

reducing the agricultural production of the natural environment and

climate change request. However, the greenhouse temperature and

humidity requirements for a series of air composition indicators

are very strict, and greenhouse modernization must have a set of

temperature and humidity measurement and control system, the design

is for people living with and the continuous improvement of

production level, to the living environment and the requirements of

the production environment is particularly important, control

temperature and humidity is a typical example, therefore, emerge as

the times require an intelligent temperature and humidity detection

system in modern life and fast, convenient and reliable detection

system, especially in the industrial production if the detection of

inaccurate will occur in many production accidents. To provide a

better life for modern people to work, scientific research, and

more convenient facilities, we must start from the SCM technology,

all toward digital control system, intelligent control direction.

The design is based on single-chip microcomputer as the core, with

the temperature and humidity sensor, detecting system and related

peripheral circuit, can receive the measurement of environmental

temperature and humidity signal, detecting personnel can be

displayed by the LCD data, the temperature and humidity of real-time monitoring of the environment. The measurement operation all

can be realized through the host computer control software, the

measurement signals are temperature and humidity sensor, the

circuit is converted to electrical signals, and then the data were

processed by conversion to SCM, through the software analysis

processing evacuation display device.

The system hardware and software design, including the system of

high reliability, simple structure, realizes the automatic control

of temperature and humidity. The system also applies RS232 and host machine is connected, can parameters related to the automatic

recording of temperature, humidity settings, can also be set at a

certain time automatic recording, available in the meteorological

observation. Keywords : STC89C52 microcontroller, temperature and

humidity sensor, LCD display目录

第1章 概述 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

1.1 课题研究的背景 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

1.2 温湿度检测的发展状况以及存在的问题 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

1.3 本课程设计的主要内容 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯ 第 2章 系统总体方案设计 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1 温湿度传感器 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.1 DHT11 产品概述 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.2 接口说明 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.3 电源引脚 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.4 串行接口 (单线双向 )⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.5 DHT11引脚说明 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.6 焊接信息 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.1.7 注意事项 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.2 RS232接口 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.3 单片机 STC89C52 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

2.4 LCD1602⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

第 3章 系统的硬件设计和连接 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

3.1 主控模块 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

3.2 显示模块 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

3.3 温度和湿度采集模块 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

3.4 键盘设计 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

3.5 与上位机相连电路的设计 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

3.6 报警电路设计 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

第 4章 系统软件方案的设计 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

4.1 程序流程图 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

第5章 总结与展望 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

参考文献