1、 毕 业 设 计 题题 目:目:基于 DS18B20 的数字温度计的设计与实 现 学生姓名:学生姓名: 学学 号:号: 系系 (院) :(院) :物理与机电工程学院自动化系 专专 业:业:自动化专业 班班 级:级: 指导教师姓名及职称:指导教师姓名及职称: 起止时间:起止时间: 2011 年 10 月 2012 年 5 月 基于基于 DS18B20DS18B20 的数字温度计的设计与实现的数字温度计的设计与实现 摘要:摘要:随着时代的进步和发展,单片机技术已经普及到我们生活、工作、科研、各个领域, 已经成为一种比较成熟的技术。 对于温度的测量方法与装置的研究就凸显得非常重要。 由单 片机与温度
2、传感器构成的测温系统可广泛应用于很多领域。 本设计采用51单片机和DS18B20 数字温度传感器来进行温度测量的方法,包括温度传感器 芯片的选取、单片机与温度传感器接口电路的设计,以及实现温度信息采集和数据传输的软 件设计。DS18B20 数字温度传感器是单总线器件,与51 单片机组成一个测温系统,具有线路 简单、体积小等特点,而且在一根通信线上,可以挂接很多这样的测温系统,十分方便。 关键词关键词:单片机;温度传感器;数字温度计 Design and implementation of the digital thermometer based on DS18B20 Abstract:Wit
3、h the progress and development of era,microcontroller technology has become popular in our life,in the work,the scientific research and various fields,has become a relatively mature technology.The temperature measurement method and device of the highlights is very important.Posed by the single chip
4、temperature sensor and temperature measurement system can be widely applied in many fields. A practical temperature measuring method based on microcont roller and DS18B20 digital temperature sensor was presented. The selection of temperature sensor chip was discussed and the design of hardware inter
5、face circuit and related sof tware were dealt with in more details. The proposed design is simple in hardware connection lines and small in size. In addition , it is applicable for different temperature measuring systems based on DS18B20 temperature sensors hung on one communication line. Key words:
6、microcontroller;temperature sensor;temperature measurement system 目目 录录 1 绪论 1 1.1 温度计的介绍 1 1.2 选题的目的和意义、 1 1.2.1 选题的目的 1 1.2.2 选题的意义 2 2 数字温度计的设计方案 2 2.1 设计方案的确立及论证 2 2.1.1 温度传感器 DS18B20 的选择 2 2.1.2 单片机 STC89C52 的选择. 3 3 系统硬件电路的设计 3 3.1 主控制器 . 3 3.1.1 STC89C52 的介绍 . 4 3.1.2 DS18B20 的介绍 . 10 3.1.3 DS18B20 使用的注意事项 17 3.2 DS18B20 与单片机接口电路的设计 . 17 3.3 显示电路的设计. 18 3.3.1 方案一:数码管显示 . 18 3.3.2 方案二:液晶显示 . 19 3.3.3 显示电路. 22 4 系统程序的设计. 22 4.1 系统设计内容 23 4.1.1 主程序 . 23 4.1.2 读出温度子程序. 23 4.1.3 温度转