宝鸡文理学院电子电气工程学院单片机实习设计报告设计题目: 基于51单片机的温度报警系统设计班级: 2013级自动化2班姓名: 赵阳201395124062李杰201395124063江超201395124064王珊201395124065 指导教师: 李军生张曦2016年1月8日基于51单片机的温度报警系统设计摘要温度是一个十分重要的物理量,对它的测量与控制有十分重要的意义。
随着现代工农业技术的发展及人们对生活环境要求的提高,人们也迫切需要检测与控制温度。
温度控制电路在工农业生产中有着广泛的应用。
日常生活中也可以见到,如电冰箱的自动制冷,空调器的自动控制等等。
在工业生产中,温度、压力、流量和液位是四种最常见的过程变量。
其中,温度是一个非常重要的过程变量。
例如:在冶金工业、化工工业、电力工业、机械加工和食品加工等许多领域,都需要对各种加热炉、热处理炉、反应炉和锅炉的温度进行监控。
然而,用常规的监控方法,潜力是有限的,难以满足较高的性能要求。
采用单片机来对它们进行监控不仅具有监控方便、简单和灵活性大的优点,而且可以大幅度提高被测温度的技术指标,从而能够大大提高产品的质量和数量。
因此,单片机对温度的监控问题是一个工业生产中经常会遇到的监控问题。
现代社会是信息化的社会,随着安全化程度的日益提高,而通过温度报警器及时报警,避免不必要的损失。
研究了基于STC-89C52RC单片机温度控制系统的原理和功能,温度测量单元由单总线数字温度传感器DS18B20构成。
该系统可进行温度设定,时间显示和保存监测数据。
如果温度超过任意设置的上限和下限值,系统将报警并可以和自动控制的实现,从而达到温度监测智能一定范围内。
基于系统的原理,很容易使其他各种非线性控制系统,只要软件设计合理的改变。
关键字:STC-89C52RC单片机;温度;时间;DS18B20。
Design of temperature alarm system based on 51 singlechip microcomputerAbstracttemperature is a very important physical quantity of its measurement and control has very important significance. Along with the development of modern industry and agriculture technology development and people living environment improved, people urgently need to detect and control the temperature. Temperature control circuit in the industry and agriculture production is widely used. In daily life can also be seen, such as a refrigerator automatic refrigeration and air conditioning automatic control and so on. In industrial production, temperature, pressure, flow and level is one of the four most common process variables. The temperature is a very important process variables. For example: in metallurgical industry, chemical industry, power industry, machinery processing and Food processing and many other fields, we need to all kinds of heating furnace, heat treatment furnace, reactor and boiler temperature monitoring. However, conventional monitoring methods, the potential is limited, it is difficult to meet the higher performance requirements. The use of single-chip microcomputer to monitor not only convenient monitoring, simple and flexibility big advantages, and can greatly improve the technical indicators measured temperature, which can greatly improve the quality and quantity of products. Therefore, the problem of temperature monitoring chip is often encountered in an industrial production monitoring problem. Modern society is the information society, with the increasing of the degree of security, and through Temperature alarm in time, to avoid unnecessary losses.Study based on the STC-89C52RC single chip microcomputer temperature control principle and function of the system, the temperature measurement unit is composed of a single bus digital temperature sensor DS18B20 constitute. The system can set temperature and time display and save the monitoring data. If the temperature exceeds the arbitrarily set the upper limit and lower limit value, the system will alarm and automatic control, so as to achieve a range of intelligent temperature monitoring. Based on the principle of the system, it is easy to make a variety of other nonlinear control system, so long as the software design is reasonable.Key words:STC-89C52RC single chip microcomputer; temperature; time; DS18B20.目录第一章引言 (1)第二章设计要求 (2)2.1 基本要求 (2)2.2 扩展功能 (2)第三章总体方案设计 (3)3.1 方案论证 (3)3.1.1 方案一 (3)3.1.2 方案二 (3)3.2 总体设计框图 (3)第四章硬件设计 (5)4.1 单片机系统 (5)4.2 STC89C52芯片特性 (6)4.2.1简介: (6)4.2.2 主要特性: (7)4.2.3 管脚说明: (8)4.2.4 振荡器特性: (10)4.2.5 芯片擦除: (11)4.2.6 结构特点: (11)4.3 数字温度传感器模块 (11)4.3.1 DS18B20性能: (11)4.3.2 DS18B20外形及引脚说明: (12)4.3.3 DS18B20接线原理图: (12)4.3.4 DS18B20时序图: (13)4.3.5 数据处理: (14)4.4 DS18B20内部结构图: (15)4.5 声光报警电路 (16)4.6 键盘输入电路 (17)第五章软件设计 (18)5.1 主程序模块: (18)5.2 读温度值模块: (18)5.3 中断模块: (21)5.4 温度设定、报警模块: (22)第六章 LCD1602模块 (23)6.1 液晶显示器 (23)6.1.1 液晶显示器简介: (24)6.2 LCD1602简介: (25)6.2.1 LCD1602的参数和引脚: (26)6.2.2 LCD1602的指令说明及时序: (28)6.2.3 LCD1602的一般初始化(复位)过程: (31)第七章结论 (33)附录:程序代码 (34)参考文献 (52)第一章引言随着人们生活水平的不断提高,单片机控制无疑是人们追求的目标之一,它所给人带来的方便是不可否定的,各种数字系统的应用也使人们的生活更加舒适。
数字化控制、智能控制为现代人的工作、生活、科研等方面带来方便。
其中数字温度计就是一个典型的例子。
数字温度计与传统的温度计相比,具有读数方便、测温范围广、测温精确、功能多样话等优点。
其主要用于对测温要求准确度比较高的场所,或科研实验室使用,该设计使用STC89C52单片机作控制器,数字温度传感器DS18B20测量温度,单片机接受传感器输出,经处理用LED数码管实现温度值显示。
随着电子技术和微型计算机的迅速发展,微机测量和控制技术也得到了迅速的发展和广泛的应用。
利用微机对温度进行测控的技术,也便随之而生,并得到日益发展和完善,越来越显示出其优越性。
作为获取信息的手段——传感器技术得到了显著的进步,其应用领域较广泛。
传感器技术已成为衡量一个国家科学技术发展水平的重要标志之一。
因此,了解并掌握各类传感器的基本结构、工作原理及特性是非常重要的。
为了提高对传感器的认识和了解,尤其是对温度传感器的深入研究以及其用法与用途,基于实用、广泛和典型的原则而设计了本系统。
本系统利用传感器与单片机相结合,应用性比较强,本系统可以作为仓库温度监控系统,如果稍微改装可以做热水器温度调节系统、实验室温度监控系统,以及构成智能电饭煲等等。