温度警报器器设计报告

. 比赛设计论文说明书 题 目 温度检测及报警器 院 (系) 信息与通信学院 专 业 电子信息工程 成员名单 1100220926 武文杰, 1100220924 唐晓东, 1100220923覃武将 2012年 12月23日 摘要 温度是一个十分重要的物理量,对他的测量与控制有十分重要的意义,随着现代工农业技术的发展及人们对生活环境要求的提高,人们也迫切需要检测与控制温度。本温度报警器的设计与制作,阐明了该装置进行设计与制作的具体过程及方法。这种温度报警器结构简单,可操作性强,应用广泛。工作时,温度测量范围为-55C到125 C当前环境温度若超过设定的高温临界温度,由单片机发出报警信号,防止因温度升高而带来的不必要的损失。

现代社会是信息社会,随着安全化程度的日益提高,机房作为现代化的枢纽,其安全工作已成为重中之重,机房内一旦发生故障,将导致整个系统瘫痪,造成巨大的损失很社会影响。造成高温火灾有电气线路短路、接触电阻过大等引发高温或火灾;
静电产生高温或火灾;
雷电等强电侵入导致高温或火灾;
最主要是机房内电脑、空调等用电设备长时间工作,导致设备老化,空调发生故障,而不能降温;
因此机房内所属的电子产品发热快,在短时间内机房温度升高超出设备正常温度,导致系统瘫痪或产生火灾,这时温度报警系统就会发挥应有的功能。

AbstractAbstractAbstractAbstract Temperature is a very important physics, measurement and control of his have very important sense, with modern industrial and agricultural technology and the development of environment for peoples life rise, people also urgently need detection and control the temperature. This temperature alarm design and production, it is expounded that the device for the design and production of specific processes and s. This temperature alarm simple structure, the maneuverability is strong, wide application. Work, temperature measurement range for - 55 DHS C to 125 DHS environmental temperature if exceed the C the current set of microcomputer temperature critical temperature, issued a warning signal, caused by temperature to prevent unnecessary losses. The modern society is the ination society, as secure degree of increasing, room - as modern hub, its work safety has become a top priority, the telecom room once breaks down, will cause the entire system paralyze, caused great damage very social influence. A high temperature fire caused by electrical wiring short circuit, overload, contact resistance too high temperature or triggered fires; Electrostatic generation high temperature or fire; Lightning invasion as lead to high temperatures or fire Most major is the telecom room computers, air-conditioners etc electrical equipment working for a long time, resulting in equipment aging, air conditioning, and cannot cooling fault; Therefore the telecom room belongs to electronic products fever faster, in a short time, room temperature beyond normal temperature, cause the system equipment or produce fire, then paralyzed temperature alarm system will play its function. 目 录 一、系统总体设计要求 二、电路设计图 三、系统程序设计 四、调试与性能分析 五、源程序清单 一、系统总体设计要求 1.题目设计要求 本系统采用STC90C51作控制器和DS18b20作温度采集,它们都工作在5V直流电压下。其工作原理大致如下室内温度由DS18b20采集,并在DS18b20内部实现模拟信号和数字信号的转换,通过对STC90C51编程可实现读取DS18B20转换的数字信号,读取温度后STC90C51进行内部计算,四位共阴数码管可改为液晶显示实时温度(显示温度有效值保留到十分位),当温度超过设定值时,蜂鸣器发出报警。

2 总体设计框图 本设计采用STC90C51作为主控芯片,蜂鸣器作为输出设备产生报警声,LCD1602能够实时的显示当前的的温度。其中P3.2,P3.3,P3.4,P3.5外接按键,P0口用作LCD输出数据端口,P1.0接蜂鸣器端口。详细原理图见附件 设计框图如图所示 二、具体电路设计图 1.液晶设计图 2.复位电路 3.按键电路及主控电路 4.蜂鸣器电路 三、系统程序设计 //名称用1602LCD与DS18B20设计的温度报警器(含ROM CODE,温度上下限显示) //说明本例将报警器温度设为高高-30摄氏度,低-20摄氏度,当DS18B20感知温度达到此临界值时,对应的LCD闪烁,且发出报警声音。

//本例还可以单独显示DS18B20的ROM CODE及报警温度上下限。

include define uchar unsigned char define uint unsigned int sbit DQ1P20; //定义第一路 sbit DQ2P21; //定义第二路 sbit LED1P23; //定义第一路的指示灯 sbit LED2P22; //定义第二路的指示灯 sbit RSP24; //数据/命令选择端(H/L) sbit RWP25; //读写选择端(H/L) sbit ENP26; //使能信号 sbit BELLP10; //蜂鸣器 sbit key1P32; //报警温度设置选择按键 sbit key2P33; // 加 sbit key3P34; // 减 sbit key4P35; // 通道选择按键 uint data disdata1[5]; uint data disdata2[5]; uint tvalue1;//温度值 uint tvalue2;//温度值 uint bjdate1; //1路下限值 uint bjdate2; //2路下限值 uint bjdate11; //1路上限值 uint bjdate22; //2路上限值 uchar tflag1;//温度正负标志 uchar tflag2;//温度正负标志 uint a0; //报警值设置选择标志 uint b0; //通道选择标志 unsigned char code str1[]{“ T1 “}; unsigned char code str2[]{“ T2 “}; unsigned char code clean[]{“ “}; /****************lcd1602程序**************************/ void delay1msunsigned int ms//延时1毫秒(不够精确的) { unsigned int i,j; fori0;ims;i forj0;j100;j; } void wr_comunsigned char com//写指令// { delay1ms1; RS0; RW0; EN0; P0com; delay1ms1; EN1; delay1ms1; EN0; } void wr_datunsigned char dat//写数据 { delay1ms1;; RS1; RW0; EN0; P0dat; delay1ms1; EN1; delay1ms1; EN0; } void lcd_init//初始化设置 { delay1ms15; wr_com0 x38; delay1ms5; wr_com0 x08;delay1ms5; wr_com0 x01;delay1ms5; //清屏 wr_com0 x0c;delay1ms5; } void displayunsigned char *p //显示 { while*p\0 { wr_dat*p; p; delay1ms1; } } void init_playvoid//初始化显示 { lcd_init; wr_com0 x80; displaystr1; wr_com0 xc0; displaystr2; } void delay_18B20unsigned int i//延时1微秒 { whilei--; } /