您好,欢迎来到佳博论文网!

基于AT89S51单片机的数字温度计设计

论文编号:JD1032论文字数:13062,页数:32

【摘要】

随着时代的进步和发展,人类不断的需求,科技不断的进步。温度计所给人类带来的方便也是不可否定的,其中数字温度计就是一个典型的例子,但人们对它的要求越来越高。由于老式温度计的精确度低,测量范围小,无法满足现代化生活:工业、教学、科研、旅游等等各个领域的需求。随着集成电路技术的发展,单片微型计算机的功能也不断增强,由于单片机技术已经普及到我们生活,工作,科研,各个领域,已经成为一种比较成熟的技术,本文将介绍一种基于单片机控制的数字温度计,它属于多功能温度计。本设计所介绍的数字温度计与传统的温度计相比,具有读数方便,测温范围广,测温准确等优点。该温度计以AT89S51为主控器,通过DS18B20来检测温度,并通过四位共阴极LED数码管以串口传送数据,实现温度显示。同时可以设置上下线报警温度,当温度不在设置范围内时,可以报警。数字温度计是单总线器件,具有线路简单,体积小的特点。因此用它来组成一个测温系统,具有线路简单,在一根通信线上可以挂很多这样的数字温度计,十分方便。

【关键词】

单片机;数字控制;温度计; DS18B20;AT89S51

【Abstract】

As the times progress and development, human constant demand, technological progress. Thermometer, given the convenience of mankind is undeniable, in which the digital thermometer is a typical example, but it have become increasingly demanding. Due to the low accuracy of old-fashioned thermometer, measuring range is small, does not meet modern life: industry, teaching, research, and tourism demand in various fields. With the integrated circuits technology, single-chip micro-computer features are also growing, due to microcontroller technology has spread to our lives, work, research in various fields has become a relatively mature technology, this article describes a control based on single chip digital thermometer, it belongs to multi-function thermometer. The design presented in digital thermometer with a traditional thermometer, compared with a reading convenience, temperature measurement accurate.The thermometer in order to AT89S51-based controller, through the DS18B20 to detect the temperature, and through four common anode LEDdigital tubes, serial transmission of data to achieve temperature display. You can set the alarm off the assembly line at the same time the temperature is set when the temperature is not within the scope when it could be reported. Digital thermometer is a single bus device, with a simple circuit, small size and characteristics. Therefore, use it to form a temperature measurement system with a simple circuit, in a communication line can carry many of these digital thermometer is very convenient.

【Key words】

SCM: digital control; thermometer; DS18B20; AT89S51

目录

1 绪论2

2 系统方案论证与比较3

2.1 数字温度计设计要求3

2.2 数字温度计设计方案论证3

2.2.1 方案一3

2.2.2 方案二4

2.3 方案二的总体设计框图4

3 系统主要元器件的选择4

3.1 单片机的选用及功能介绍5

3.1.1 单片机的选择5

3.1.2 MCS-51 单片机引脚及功能介绍5

3.2 温度传感器的选择8

3.2.1 DS18B20 简单介绍8

4 系统硬件电路的设计9

4.1 主板电路9

4.2 显示电路10

4.3 DS18B20温度传感器与单片机的接口电路11

5 系统软件算法分析12

5.1 数字温度传感器测温原理12

5.1.1 DS18B20工作原理12

5.1.2 DS18B20 的单线协议和命令16

5.1.3 温度数据的计算处理方法19

5.2 测温系统程序设计19

5.2.1 主程序20

5.2.2 读出温度子程序20

5.2.3 温度转换命令子程序21

5.2.4 计算温度子程序22

5.2.5 显示数据刷新子程序22

6 调试及性能分析23

6.1单片机测试23

6.2系统的软件测试和仿真23

结论26

致谢27

参考文献28

附录29

基于AT89S51单片机的数字温度计设计......