1、 目录 摘要 . I ABSTRACT II 第 1 章 绪论 1 1.1 研究意义及背景 1 1.2 设计目的及要求 1 1.3 主要工作 2 1.4 设计的实现 2 第 2 章 系统概述 3 2.1 系统方案 3 2.2 系统组成 3 第 3 章 系统硬件设计 4 3.1 STC89C52 单片机 . 4 3.1.1 STC89C52 单片机主要特性 4 3.1.2 STC89C52 单片机引脚介绍 5 3.2 数码管显示 8 3.3 DS18B20 温度传感器 9 3.3.1 温度传感器测温原理 10 3.3.2 DS18B20 使用中的注意事项 11 3.4 系统工作原理 . 12 3
2、.5 系统整体电路 . 12 3.5.1 复位电路 . 12 3.5.2 晶振电路 . 12 3.5.3 系统整体电路 . 13 第 4 章 系统软件设计 . 13 4.1 主程序设计 . 14 4.2 DS18B20 初始化 . 15 4.3 DS18B20 温度传感器与单片机的接口电路 . 15 4.4 数码管显示与单片机对接 . 16 第五章 系统调试 . 17 5.1 调试软件的选用与使用 . 17 5.1.1 KEIL 软件的使用 17 5.1.2proteus 软件的使用 . 17 5.2 仿真结果与分析 . 18 结论 19 附录 23 程序清单 . 23 系统实物图 . 32
3、I 基于单片机的数字温度计的设计 摘要 在现代日常生活和工业生产过程中,经常会用到温度的检测及控制,在生产过程中, 为了高效地生产,必须对它的主要参数进行有效的控制。传统的测温元件有热电偶和热电 阻。而热电偶和热电阻测出的一般都是电压,再转换成对应的温度,这些方法相对比较复 杂,需要比较多的外部硬件支持。我们用一种相对比较简单的方式来测量。本文介绍一种 基于 STC89C52 单片机的一种温度测量及报警电路,该电路采用 DS18B20 温度传感器作为温 度监测元件,测量范围 0-+100,使用 LED 数码管模块进行温度显示,能设置温度报 警上下限。正文着重给出了软硬件系统的各部分电路,介绍了
4、集成温度传感器 DS18B20 的 原理,STC89C52 单片机功能和应用。该电路设计新颖、功能强大、绿色低碳、结构简单。 关键词:温度测量,温度传感器,单片机 II ABSTRACT In daily life and industrial production process, often used in the detection and control of temperature. In the production process, in order to efficiently carry out the production, to be its main parameter
5、s, such as temperature, pressure, flow control, etc. Temperature control in the production process of a large proportion. Temperature measurement is the basis of temperature-controlled, more mature technology.Traditional thermocouple and temperature components are the second resistor.The thermocoupl
6、e and thermal resistance are generally measured voltage, and then replaced by the corresponding temperature, these methods are relatively complex, requiring a relatively large number of external hardware support. We use a relatively simple way to measure. The introduction of a cost-based STC89C52 MCU a temperatur measurement circuits, the circuits used DS18B20 high-precision temperatur sensor, measuring scope 0-+100,can set the warning limitation, the use of seven segments LED that can b