推荐-基于STC89C52单片机的温度测量及报警电路设计 精品
- 格式:doc
- 大小:810.07 KB
- 文档页数:21
摘 要
摘要:在日常生活及工业生产过程中,经常要用到温度的检测及控制,温度是生产过程和科学实验中普遍而且重要的物理参数之一。传统的测温元件有热电偶和二电阻。而热电偶和热电阻测出的一般都是电压,再转换成对应的温度,这些方法相对比较复杂,需要比较多的外部硬件支持。我们用一种相对比较简单的方式来测量。
采用美国DALLAS半导体公司推出的一种改进型智能温度传感器DS18B20作为检测元件,温度范围为-55~125 ºC,最高分辨率可达0.0625 ºC。DS18B20可以直接读出被测温度值,而且采用三线制与单片机相连,减少了外部的硬件电路,具有低成本和易使用的特点。
基于STC89C52单片机的温度测量及报警电路,电路采用DS18B20作为温度监测元件,测量范围0℃-~50℃,使用LCD模块显示,能设置温度报警上下限。着重介绍软硬件系统的各部分电路,介绍了集成温度传感器DS18B20的原理,STC89C52单片机功能和应用。该电路设计新颖、功能强大、结构简单。
关键词:温度测量 报警 DS18B20 STC89C52
Abstract
Abstract:In daily life and industrial production process, often used in the
detection and control of temperature, temperature is the production process and
scientific experiments in general and one of the important physical parameter.
Traditional thermocouple and temperature ponents are the second resistor. The
thermocouple and thermal resistance are generally measured voltage, and then
replaced by the corresponding temperature, these methods are relatively plex,
requiring a relatively large number of external hardware support. We use a
relatively simple way to measure.
Use the United States following DALLAS Semiconductor DS1820 improved after
the introduction of a smart temperature sensor DS18B20 as the detection element,
a temperature range of -55 º C ~ 125 º C, up to a maximum resolution of 0.0625
º C. DS18B20 can be directly read out the temperature on the north side, and
three-wire system with single-chip connected to a decrease of the external
hardware circuit, with low-cost and easy use.
The introduction of a cost-based STC89C52 MCU a temperature measurement
circuits, the circuits used DS18B20 high-precision temperature sensor,
measuring scope 0 º C~+100 º C, can set the warning limitation, the use of seven
segments LCD that can be display the current temperature. The paper focuses on
providing a software and hardware system ponents circuit, introduced the theory
of DS18B20, the functions and applications of AT89C51 .This circuit design
innovative, powerful, can be expansionary strong.
Key words: Temperature measurement warning DS18B20 STC89C52
目 录
1 绪论………………………………………………………………………………………1
1.1 引言……………………………………………………………………………………1
1.2 设计内容及要求............................................................................................................1
1.3主体的部分……………………………………………………………….2
2 AT89S52单片机介绍及应用………………………………………………………………4
2.1 AT89S52的主要功能………………………………………………………………….4
2.2 引脚结构及说明………………………………………………………………………5
2.2.1方框图…………………………………………………………………………….6
2.2.2 引脚说明…………………………………………………………………………7
2.3 特殊功能寄存器……………………………………………………………………10
2.4 存储器结构..................................................................................................................13
2.5 软件看门狗及串口…………………………………………………………………14
2.5.1 WDT的使用………………………………………………………………………..14
2.5.2 掉电和空闲方式下的WDT……………………………………………………..15
2.5.3 定时器2………………………………………………………………………..15
2.6 其他功能介绍………………………………………………………………………16
3 系统软件的设计................................................................................................................23
3.1 程序设计语言………………………………………………………………………..23
3.2 主程序………………………………………………………………………………..23
3.3 显示子程序…………………………………………………………………………..24
3.4 定时器T0中断服务程序……………………………………………………………25
3.5 T1中断服务程序……………………………………………………………………..25
3.6 调时功能程序……………………………………………………………………….25
3.7 时钟/秒表功能程序…………………………………………………………………25
4 硬件电路的操作和显示……………………………………………………………….26
4.1 硬件工作过程………………………………………………………………………26
4.2 LED的性能特点………………………………………………………………….27
5 其他外围电路设计………………………………………………………….28 5.1 时钟电路……………………………………………………………………………28
5.2 复位电路……………………………………………………………………………29
5.3 键盘电路……………………………………………………………………………30
结 论………………………………………………………………………………………….32
致 谢………………………………………………………………………………………….33
参考文献……………………………………………………………………………………..34
附录A 英文和翻译………………………………………………………………………….35
附录B 电路原理图..................................................................................................................43
第一章 绪论
1.1引言
随着科技的发展,在工业、农业生产等重要领域对温度的控制要求越来越高,因而对温度报警系统的要求也越来越高。如何设计一款成本低廉、报警准确、操作简单的智能温度报警系统成为一个重要问题。以STC89C52单片机为处理核心,通过数字温度传感器DS18B20将检测到的数据输入单片机进行处理,与声光报警电路组合就可以构成温度报警系统,这种设计系统的成本较小,结构简单、操作方便,并且测量也很准确,能够满足工业、农业生产对温度要求不是特别高的地方。
温度报警系统,在工业、农业自动化控制中占有非常重要的地位。单片机系统的开发应用给现代工、农业测控领域带来了一次新的技术革命,自动化、智能化均离不开单片机的应用。将单片机控制方法运用到温度控制系统中,可以克服温度控制系统中存在的严重滞后现象,同时在提高采样频率的基础上可以很大程度的提高控制效果和控制精度。现代自动控制越来越朝着智能化发展,在很多的小型系统中,处理机的成本占系统成本的比例高达20%,而对于这些小型的系统来说,配置一个如此高速的处理机没有任何必要,因为这些小系统追求经济效益,而不是最在乎系统的快速性,所以用成本低廉的单片机控制小型的,而又不是很复杂,不需要大量复杂运算的系统中是非常适合的。
随着电子技术以及应用需求的发展,单片机技术得到了迅速的发展,在高集成度,高速度,低功耗以及高性能方面取得了很大的进展。伴随着科学技术的发展,电子技术