基于DS18B20的数字温度计设计 联系客服

发布时间 : 星期三 文章基于DS18B20的数字温度计设计更新完毕开始阅读3aea340cfe4733687f21aa3c

毕 业 设 计

设计题目:数字温度计的设计

所属系别 机电工程系 专业班级

姓 名

学 号 200908030220119 指导教师

撰写日期 2011 年 11 月

摘 要

数字温度计(Digital Thermometer)简称D温度是许多监控系统中的一个重要参数。TM,它是采用数字化测量技术,把连续的温度值转换成不连续、离散的数字形式并加以显示的仪表。采用单片机控制的数字温度计,由于精度高、可扩展性强、集成方便、抗干扰能力强,得到了广泛的应用。本设计以单片机和温度传感器为核心,设计数字温度计。实现对温度的采集、监视和报警。在温度采集的实现中,使用了AT89C2051单片机和温度传感器DS18B20,温度监视部分利用动态驱动技术,以单片机驱动4位LED数码管。温度测量范围-55℃~+125℃,通过按键设置上下限报警温度,并用4位共阳极LED数码管以串口传送数据,实现温度显示,能准确达到设计要求。

关键词:单片机AT89C2051, 温度传感器DS18B20, 温度, 测量

Abstract

Digital Thermometer (Digital Thermometer) abbreviation D temperature is many monitoring and control system of a important parameters. TM, it is using digital measurement technique, the continuous temperature converted into digital form of discontinuous, discrete and to show appearance. Using single chip microcomputer control digital thermometer, due to the high precision, extensible, integrated convenient, strong anti-interference ability, a wide range of applications.This design with the single chip processor and temperature sensor as the core, to design digital thermometer. To achieve the collection of temperature, monitor, and report to the police. In temperature collection, the use of the single chip microcomputer AT89C2051 and temperature sensor DS18B20, temperature monitoring the part USES dynamic drive technology, on the single chip computer drive four LED digital tube. Temperature measurement range-55 ℃ ~ + 125 ℃, through the lower temperature alarm button, and a total of 4 anode LED digital tube to a serial port transmit data, realize temperature display, and exactly to meet the design requirements.

Key words: a single chip microcomputer AT89C2051 ,The temperature sensor DS18B20, Temperature, measurement

目 录

1 绪论 ..................................................................................................................................................... 1 2 设计的要求及任务 .......................................................................................................................... 1

2.1设计任务 .................................................................................................................................... 1 2.2技术指标 .................................................................................................................................... 1

3 智能温度传感器与单片机 ............................................................................................................ 2

3.1智能温度传感器的产品分类 .................................................................................................... 2 3.2 智能温度传感器典型产品的技术指标 ................................................................................... 2 3.3 AT89C2051单片机的主要特点 ................................................................................................ 2

4 数字温度计的设计 .......................................................................................................................... 4

4.1总体设计方案 ............................................................................................................................ 4 4.2方案的总体设计框图 ................................................................................................................ 5 4.3 系统整体硬件电路 ................................................................................................................... 5

4.3.1主板电路 ........................................................................................................................ 5 4.3.2显示电路 ........................................................................................................................ 6 4.3系统软件算法分析 .................................................................................................................... 6

4.3.1主程序 ............................................................................................................................ 7 4.3.2 读出温度子程序 ............................................................................................................. 7 4.3.3 温度转换命令子程序 ..................................................................................................... 8 4.3.4 计算温度子程序 ............................................................................................................. 8 4.3.5 显示数据刷新子程序 ..................................................................................................... 8

5 总结 ..................................................................................................................................................... 9 参 考 文 献 ........................................................................................................................................ 10 致 谢 ....................................................................................................................................................11