logo资料库

【论文】基于DS18B20的多点温度测量监控系统设计.doc

第1页 / 共46页
第2页 / 共46页
第3页 / 共46页
第4页 / 共46页
第5页 / 共46页
第6页 / 共46页
第7页 / 共46页
第8页 / 共46页
资料共46页,剩余部分请下载后查看
摘 要
ABSTRACT
1.绪 论
1.1研究背景
1.2内容及要求
2.传感器方案论证
2.1 热敏电阻
2.2 数字温度传感器
3.系统方案概述
4.硬件系统设计
4.1 单片机最小系统
4.1.1 AT89C52简介
4.1.2 晶振电路
4.1.3 复位电路
4.1.4 排阻电路
4.2DS18B20温度传感器
4.2.1 DS18B20简介
4.2.2 DS18B20内部结构
4.2.3 DS18B20电路
4.3LCD1602液晶显示电路
4.4按键模块
4.5报警模块
5.软件系统设计
5.1 软件开发平台
5.2 主程序设计
5.3 DS18B20程序设计
5.3.1 初始化
5.3.2 ROM指令
5.3.3 数据处理
5.3.4 程序流程图
5.4 LCD1602程序设计
5.5 报警模块程序设计
6.仿真与测试
6.1 仿真平台
6.2 仿真分析
结 语
参考文献
附录一:系统仿真电路图
附录二:PCB电路图
附录三:主程序设计
上海交通大学 基于 DS18B20 的多点温度测量监控系统设计 Design of Multi-point Temperature Measurement and Monitoring System Based on DS18B20 学 院: 电子信息与电气工程学院 专 业: 姓 名: 指导老师: 电气工程及其自动化 蒋宇智 叶志国 年 月 日
上海交通大学本科毕业设计(论文) 目 录 摘 要 .............................................................. 3 ABSTRACT ........................................................... 4 1. 绪 论 ......................................................... 6 1.1 研究背景 .................................................. 6 1.2 内容及要求 ................................................ 6 2. 传感器方案论证 ................................................ 8 2.1 热敏电阻 ....................................................8 2.2 数字温度传感器 ..............................................8 3. 系统方案概述 .................................................. 9 4. 硬件系统设计 ................................................. 10 4.1 单片机最小系统 .............................................10 4.1.1 AT89C52 简介 ..........................................10 4.1.2 晶振电路 ............................................. 13 4.1.3 复位电路 ............................................. 14 4.1.4 排阻电路 ............................................. 14 4.2 DS18B20 温度传感器 ........................................ 15 4.2.1 DS18B20 简介 ..........................................15 4.2.2 DS18B20 内部结构 ......................................17 4.2.3 DS18B20 电路 ..........................................20 4.3 LCD1602 液晶显示电路 ...................................... 21 4.4 按键模块 ................................................. 24 4.5 报警模块 ................................................. 25 5. 软件系统设计 ............................................... 26 5.1 软件开发平台 ...............................................26 5.2 主程序设计 .................................................26 5.3 DS18B20 程序设计 ........................................... 29 5.3.1 初始化 ............................................... 29 5.3.2 ROM 指令 ..............................................30 - 1 -
上海交通大学本科毕业设计(论文) 5.3.3 数据处理 ............................................. 31 5.3.4 程序流程图 ........................................... 32 5.4 LCD1602 程序设计 ........................................... 32 5.5 报警模块程序设计 ...........................................33 6. 仿真与测试 ................................................. 35 6.1 仿真平台 ...................................................35 6.2 仿真分析 ...................................................35 结 语 ............................................................. 37 参考文献 .......................................................... 38 附录一:系统仿真电路图 ............................................ 39 附录二:PCB 电路图 .................................................40 附录三:主程序设计 ................................................ 41 - 2 -
上海交通大学本科毕业设计(论文) 摘 要 在日常生活及工业生产过程中,经常要用到温度的检测及控制,温度是生产 过程和科学实验中普遍而且重要的物理参数之一,同时它也是一种最基本的环境 参数。人民的生活和环境温度息息相关,物理、化学、生物等学科都离不开温度。 在观光农业生产和实验研究中,在电力、化工、石油、冶金、机械制造、大型仓 储室、实验室、农场塑料大棚甚至人们的居室里经常需要对环境温度进行多点测 量监控,并根据实际要求对环境温度进行控制。 本系统采用一种单总线数字式温度传感器 DS18B20 作为检测元件,温度测量 范围为-55~125ºC,最高分辨率可达 0.0625ºC。DS18B20 可以直接读出被测温度 值,而且采用单总线单端口形式与单片机相连,同时单总线可外挂多个传感器, 这减少了外部的硬件电路,具有低成本和易使用的特点。 本文介绍一种基于 DS18B20 的多点温度测量监控系统设计,以 AT89C52 单片 机作为主控制器,不断循环读取 4 组 DS18B20(T1、T2、T3 和 T4)温度数据, 同时使用 LCD1602 液晶循环显示 4 组测取的温度值以及每组设定的温度上下限 值,通过按键可设置每组温度报警上下限和液晶显示的模式(循环显示模式和手 动切换显示模式)。当前组的温度值若不在设定范围内,则蜂鸣器报警,对应的 LED 灯点亮;具体过程为:温度高于上限值,红色 LED 灯点亮;温度低于下限值, 蓝色 LED 灯亮。 关键词:AT89C52 单片机;温度测量监控;DS18B20;LCD1602;按键模块 - 3 -
上海交通大学本科毕业设计(论文) ABSTRACT In daily life and industrial production processes, temperature detection and control are often used. Temperature is one of the most common and important physical parameters in production processes and scientific experiments. It is also a basic environmental parameter. People's lives are closely related to the temperature of the environment. Physics, chemistry, biology and other disciplines are inseparable from temperature. In the sightseeing agricultural production and experimental research, in the power, chemical, petroleum, metallurgy, machinery manufacturing, large storage rooms, laboratories, farm plastic greenhouses and even people's living rooms, it is often necessary to conduct multi-point measurement and monitoring of the ambient temperature, and according to the actual situation. It is required to control the ambient temperature. The system uses a single-bus digital temperature sensor DS18B20 as the detection component, the temperature measurement range is -55 ~ 125oC, the highest resolution can reach 0.0625oC. DS18B20 can directly read the measured temperature value, and is connected to the single-chip microcomputer in a single bus single port form. At the same time, the single bus can externally connect multiple sensors, which reduces the external hardware circuit, and has the characteristics of low cost and easy to use. This paper introduces a DS18B20-based multi-point temperature measurement monitoring system design. The AT89C52 single-chip microcomputer is used as the main controller to continuously read and record four sets of DS18B20 (T1、T2、T3 and T4) temperature data. At the same time, the LCD1602 liquid crystal cycle is used to display the temperature values ​ of each group and the set of four sets. The upper and lower limits of the temperature can be set, and the upper and lower limits of the temperature alarm and the mode of the liquid crystal display (cyclic display mode and manual switching display mode) can be set by pressing the button. If the temperature value of the current group is not within the set range, the buzzer will alarm and the - 4 - ​
上海交通大学本科毕业设计(论文) corresponding LED will light; the specific process is: the temperature is higher than the upper limit, the red LED is lit; the temperature is lower than the lower limit, blue The color LED lights up. Key words: AT89C52 single chip microcomputer; temperature measurement monitoring; DS18B20; LCD1602; button module - 5 -
上海交通大学本科毕业设计(论文) 1. 绪 论 1.1 研究背景 目前,在许多情况下,都需要对环境的温度进行多点测量监控,包括人的生 活工作环境、仪器设备的工作环境以及动植物的生长环境等。如果环境温度超过 或者低于限制值,必定对所处环境的人或设备造成影响,甚至给个人和社会造成 巨大的损失。 因此,在某些特定环境内使用多组温度报警器来对温度进行多点实时监控并 做到超温报警,而使用单片机实时控制多组温度报警器则是其中的一种重要方 式。 设计目的主要是了解单片机实时控制的多点温度测量监控系统的历史与现 状,根据现实生活的需要以及已掌握的理论知识,制定出基于 DS18B20 的多点 温度测量监控系统硬件、软件的设计方案,利用 51 单片机循环读取 4 组传感器 的温度值,辅以一些其他外围电路,让它实现对环境温度的多点探测、循环显示、 并且具有按键设置、超高温、低温报警等功能,最终调试验证方案的可行性,完 成设计。 1.2 内容及要求 本文主要介绍了用 51 单片机循环读取 4 组数字温度传感器 DS18B20 数值的 方法来实现温度的多点测量与监控,以单片机 AT89C52 最小系统为核心,辅以 4 组 DS18B20 组建的小型温度传感器网络、LCD1602 液晶显示模块、按键设置模块 以及报警模块,构成了一个单片机的多点温度监控系统。该装置适用于人民的日 常生活和工、农业生产过程中的多点温度测量与报警,实现对温度的监测。 主要研究内容包括两方面,一是对系统硬件部分的设计,包括 4 组温度的循 环采集、LCD 显示、按键设置和 LED、蜂鸣器报警;二是对软件部分的设计,应 用 C 语言实现温度的采集与显示。 通过对本课题的设计能够熟悉数字温度测量监控系统的工作原理及过程,了 解各功能器件(单片机、DS18B20、LCD1602)的基本原理与应用,掌握各部分电路 - 6 -
上海交通大学本科毕业设计(论文) 的硬件连线与程序编写,最终完成多点温度测量监控系统的总体设计。其具体的 要求如下: 1、根据设计要求,选用 AT89C52 单片机为核心器件; 2、温度检测器件采用 4 组 DS18B20 构成小型温度传感器网络,以单总线单 端口的形式与单片机的 P3.0 口连接; 3、显示电路采用 LCD1602 显示器接 P0 口并行循环/手动切换显示 4 组温度 值; 4、按键电路采用独立按键模式,用于设置温度报警的上下限值和切换液晶 的显示模式; 5、报警电路由 LED 指示灯和蜂鸣器组成,当测取的温度值不在设定上下限 值内,报警电路工作; - 7 -
分享到:
收藏