空调机温度控制系统-Read
- 格式:doc
- 大小:1.10 MB
- 文档页数:8
室内温度自动控制系统摘要在现代人类的生活环境中, 温度扮演着极其重要的角色。
在人们的生产生活中, 无论生活在哪里, 从事什么工作,都要时时刻刻与温度打着交道。
尤其是在18世纪工业革命以来,工业发展与农业生产都与能否掌握温度, 有着密不可分的联系。
因此,温度的监测与控制与人类的生产生活有着十分重要的意义。
我们通过STC12C5A60S2单片机和DALLAS公司DS18B20温度传感器对室内温度进行实时监测与控制实现温度的相对稳定具有极其重要的现实意义。
通过该系统的设计制作实践对电子系统设计运动控制理论应用,研究新技术学习知识增强动手能力具有重要的现实意义。
关键字:温度控制DS18B20 单片机控制系统设计目录论文共45 页1引言 (4)1.1项目概述 (4)1.2设计目的 (4)1.3设计任务 (4)1.4研究思路和方法 (4)2项目总体方案设计 (5)2.1系统原理框图与工作原理 (5)2.1.1国内外室温控制技术研究 (5)2.1.2系统原理框图设计 (5)3.系统硬件设计 (5)3.1电源模块 (5)3.2控制系统模块 (6)3.3温度检测 (6)3.3.1常用温度检测传感器 (6)3.3.2 DS18B20温度传感器电路 (9)3.4驱动模块 (9)3.4.1半桥驱动原理 (9)3.5升温模块 (10)3.6人机交互模块 (10)3.6.1 1602液晶显示 (10)3.6.2 红外遥控操作原理 (11)3.6.3红外接收电路 (11)4.系统软件设计 (13)4.1程序流程图 (13)4.2温度采集 (14)4.2.1DS18B20软件定义 (14)4.2.2温度的计算 (14)4.3红外遥控 (14)4.4电机的PWM控制 (20)4.5发热电阻丝的控制 (21)5.调试运行 (22)5.1温度传感器校准 (22)5.2温度调节时间 (23)5.3温度波动范围 (23)5.4系统参数 (23)6.系统优化 (25)6.1优化控制方式 (25)6.2美化外形结构 (25)6.3.扩展系统应用 (25)结论 (27)致谢 (28)参考文献 (29)附件一:原理图 (30)附件二:源程序 (30)1引言1.1项目概述我们的项目开发针对的对象是收入水平不高,买不起空调,有希望能不受热受冷舒适的生活。
方案设计与分析1温度控制系统方案测温系统采用集成温度传感器AD590测量温度,AD590具有线性优良、性能稳定、灵敏度高、无需补偿、热容量小、抗干扰能力强、可远距离测温且使用方便等优点。
可广泛应用于各种冰箱、空调器、粮仓、冰库、工业仪器配套和各种温度的测量和控制等领域。
将AD590测得的温度信号经转换电路转换为电压量输出,再经AD转换后,将数据送入单片机处理,最后由显示电路显示所测温度,此外还设有键盘,用来设置温度,将测得温度与设置温度比较后,由指示灯指示系统所处的工作状态。
2硬件资源简介2.1 89C51简介89C51是一种带4K字节闪烁可编程可擦除只读存储器(FPEROM—F alsh Programmable and Erasable Read Only Memory)的低电压,高性能CMOS8位微处理器,俗称单片机。
89C2051是一种带2K字节闪烁可编程可擦除只读存储器的单片机。
单片机的可擦除只读存储器可以反复擦除100次。
该器件采用ATMEL高密度非易失存储器制造技术制造,与工业标准的MCS-51指令集和输出管脚相兼容。
由于将多功能8位CPU和闪烁存储器组合在单个芯片中,ATMEL的89C51是一种高效微控制器,89 C2051是它的一种精简版本。
89C单片机为很多嵌入式控制系统提供了一种灵活性高且价廉的方案。
2.3三端稳压器LM7805简介三端稳压集成电路lm7805电子产品中,常见的三端稳压集成电路有正电压输出的lm78 ××系列和负电压输出的lm79××系列。
顾名思义,三端IC是指这种稳压用的集成电路,只有三条引脚输出,分别是输入端、接地端和输出端。
它的样子象是普通的三极管,TO- 220 的标准封装,也有lm9013样子的TO-92封装。
用lm78/lm79系列三端稳压IC来组成稳压电源所需的外围元件极少,电路内部还有过流、过热及调整管的保护电路,使用起来可靠、方便,而且价格便宜。
可靠性整理第一部分:概述(一)可靠性的必要性:1.客户的需要:仪器的使用部门,尤其是实时在线检测仪器的使用部门,强烈地希望所使用的仪器能够长时间连续、无故障得工作。
2.自身的需要:仪器自身可靠性的提高,就意味着自身竞争力的提高,最终的结果不是我们寻求客户,而是客户寻求我们。
(二)可靠性的定义可靠性的经典定义:产品在规定的条件下和规定的时间内,完成规定功能的能力。
该定义明确指出评价一个产品的可靠性,与规定的工作条件和规定的工作时间有关,也与规定产品应完成的功能有关。
产品的可靠性与工作条件的关系极为密切。
“规定的工作条件”是指产品工作时所处的环境条件、负荷条件和工作方式。
环境条件一般分为气候环境和机械环境。
气候环境是指电子元器件所处环境的气候条件,如温度、湿度、气压、气氛、盐雾、霉菌、辐射等;机械环境是指电子元器件是否经常受到外界机械应力的影响,如振动、冲击、碰撞、跌落、离心、摇摆等。
环境对电路所施加的应力可能是恒定的,也可能是变化的和交变的。
负荷条件是指电子元器件所承受的电、热、力等应力的条件,目前主要是指加在电子元器件上的电压、电流和功率等条件。
工作方式一般分为连续工作或间断工作,不工作的情况属于存贮状态。
“规定的时间”是指评价电子元器件的可靠性和规定的时间有关。
可靠性本身就是时间的函数,要保持电子元器件全部性能处于良好的工作状态,时间长比时间短更困难。
在同一工作条件下,保持的时间越长可靠性越高。
所以,在讨论电子元器件可靠性时,必须指明在多长时间内的可靠性。
规定功能:要明确具体产品的功能是什么,怎样才算是完成规定功能。
产品丧失规定功能称为失效,对可修复产品通常也称为故障。
能力:只是定性的理解是比较抽象的,为了衡量检验,后面将加以定量描述。
产品的失效或故障均具有偶然性,一个产品在某段时间内的工作情况并不很好地反映该产品可靠性的高低,而应该观察大量该种产品的工作情况并进行合理的处理后才能正确的反映该产品的可靠性,因此对能力的定量需用概率和数理统计的方法。
毕业设计 - 空调温湿度自动控制原理篇一:空调温度控制单元设计_毕业设计说明书唐山学院毕业设计设计题目:空调温度控制单元设计空调温度控制单元设计纲要以温度作为被控丈量的反应控制系统,在化工、石油、冶金等生产过程的物理和化学反响中,温度常常是一个很重要的量,需要正确的加以控制。
除了这些部门外,温度控制系统还宽泛的应用于其余领域,是用途很广的一类工业控制系统。
温度控制系统常用来保持温度恒定或许使温度依据某种规定的程序变化。
本文以空调机的设计为例,介绍了以AT89S51单片机为控制核心的温度控制器的设计过程,温度设定范围为- 10~45℃,最小划分温度为1℃. ,标准温差≦1℃。
用液晶显示屏显示目前温度。
能依据设定的温度实现自动加热或降温处理。
设计出控制系统电路单元。
在该设计中采纳高精度温度传感器 AD590对室内的温度进行及时精准丈量,用超低温平漂移高精度运算放大器 OP07将温度 - 电压信号进行放大,再送入ADC0809进行A/D 变换,将收集到的温度信号传输给单片机,再由单片机控制显示器,并比较收集温度与设定温度能否一致,而后驱动空调机的加热或降温循环对空气进行办理,进而模拟实现空调温度控制单元的工作状况。
该设计份整体方案设计、硬件设计、软件设计等几个部分,设计过程流利,所波及的电路较为合理。
该设计在硬件方案设计、单元电路设计、元器件的选择等方面较有特点。
要点词:空调,温度,AD590,ADC0809, LCD1602Air temperature control unitAbstractCharged with measuring the temperature as a feedback control system,in the chemical, petroleum, metallurgical production process of physicaland chemical reactions, temperature is often a very important quantity,1require accurate control.In addition to these departments,the temperature control system is also widely used in other areas, is veryversatile and a class of industrial control systems.Temperature control system used to keep the temperature constant or to temperature changesin accordance with a prescribed procedure.In this paper,the design of air conditioning for example,introduced to AT89S51 microcontroller core temperature controller to control thedesign process,the temperature setting range is-10~45 ℃,the minimum temperature distinction between 1 ℃.,Standard t emperature≦ 1 ℃. With the LCDdisplay shows the current temperature.The temperature can be set automatically according to heating or cooling treatment. Design a control system circuit unit. Used in the design of high-precision temperaturesensorAD590 on the indoor temperature in real-time accurate measurement ofultra-low temperature drift, high-precision operational amplifier OP07level the temperature - voltage signal amplification, and then carriedinto the ADC0809A / D conversion,the temperature will be collected signal transmission to the microcontroller, controlled by the MCU monitor andcompare the acquisition is consistent with temperature and set temperature,and then drive air conditioning heating or cooling cycle to process the air to simulate the temperature control unit for air conditioning work.The overall program design were the design, hardware design, software design, and several other parts of the design process fluid, involvingthe circuit is more reasonable. The design of the hardware design,unit circuit design, component selection such as more unique.Key words: air-conditioning, temperature, AD590, ADC0809, LCD1602目录摘要 .................................................................. ..................................................................... . (II)Abstract ............................................................ ..................................................................... .. (II)1.绪论 .................................................................. ..................................................................... (1)1.1课题的国内外现状 .................................................................. (1)1.2课题的目的及意义 .................................................................. (1)1.3本文的主要工作 .................................................................. . (1)2.温度控制系统硬件实现 .................................................................. (2)2.1总体设计 .................................................................. . (2)2.2温度采样电路设计 .................................................................. (3)2.3A/D转换电路设计 .................................................................. . (4)A/D转换的常用方法 .................................................................. . (4)A/D转换器的主要技术指标 .................................................................. . (5)ADC0809 的主要特性和内部结构 .................................................................. (5)ADC0809管脚功能及定义 .................................................................. (6)2.4单片机的选择 .................................................................. .. (7)2.5数字显示部分设计 .................................................................. .. (9)显示模块的选择 .................................................................. . (9)LCD1602简介 .................................................................. .. (9)2.6驱动控制电路设计 .................................................................. (13)2.7键盘电路 .................................................................. . (14)3 .温度控制系统软件实现 .................................................................. . (15)3.1主程序模块 .................................................................. (15)3.2A/D转换子程序 .................................................................. (16)4.设计总结 .................................................................. ....................................................................... 16谢辞 .................................................................. ..................................................................... (18)参考文献 .................................................................. ..................................................................... (19)附录 .................................................................. ..................................................................... (20)外文资料 .................................................................. ..................................................................... (26)唐山学院毕业设计1.绪论1.1课题的国内外现状空调器即空气调理器( room air conditioner),是一种用于给空间地区提供办理空气的机组。
空调温控原理
空调的温控原理是通过感知室内空气的温度,然后调节空调系统的工作来达到控制室内温度的目的。
首先,空调系统中的温度传感器会测量室内空气的温度。
传感器会将这个温度信息传送给空调控制器。
空调控制器接收到温度信息后,将根据设定的目标温度进行比较。
如果室内温度高于设定温度,控制器将会发出指令打开制冷模式。
制冷模式中,控制器会将制冷循环启动,通过压缩机将低温制冷剂压缩成高温高压气体。
然后,制冷剂通过冷凝器释放热量,并且变成高压液体。
高压液体制冷剂进入膨胀阀,经过减压后变成低压液体,进入蒸发器。
在蒸发器中,低压液体制冷剂蒸发吸收室内空气的热量,使得空气温度下降。
蒸发后的制冷剂再次进入压缩机,重新开始制冷循环。
一旦室内温度达到设定温度,空调控制器将会停止制冷模式。
反之,如果室内温度低于设定温度,空调控制器将会发出指令打开加热模式。
加热模式中,控制器会将加热循环启动,通过电阻加热器或者
燃气加热器产生热量,然后通过风扇将热空气吹入室内,使得室内温度升高。
以上就是空调温控原理的基本过程。
通过不断感知室内温度并调节空调系统工作模式,空调可以实现控制室内温度的目标。
关于空调温度控制系统的研讨摘要本文介绍了空调机温度控制系统。
本温度控制系统采用的是AT80C51单片机采集数据,处理数据来实现对温度的控制。
主要过程如下:利用温度传感器收集的信号,将电信号通过A/D转换器转换成数字信号,传送给单片机进行数据处理,并向压缩机输出控制信号,来决定空调是出于制冷或是制热功能。
当安装有LED实时显示被控制温度及设定温度,使系统应用更加地方便,也更加的直观。
关键字 AT80C51单片机 A/D转换器温度传感器随着人们生活水平的日益提高,空调已成为现代家庭不可或缺的家用电器设备,人们也对空调的舒适性和空气品质的要求提出了更高的要求。
现代的只能空调,不仅利用了数字电路技术与模拟电路技术,而且采用了单片机技术,实现了软硬件的结合,既完善了空调的功能,又简化了空调的控制与操作;不仅满足了不同用户对环境温度的不同要求,而且能全智能调节室内的温度。
为此,文中以单片机AT80C51为核心,利用LM35温度传感器、ADC0804转换器和数码管等,对温度控制系统进行了设计。
一、总体设计方案空调温度控制系统,只要完成对温度的采集、显示以及设定等工作,从而实现对空调控制。
传统的情况时采用滑动电阻器电阻充当测温器件的方案,虽然其中段测量线性度好,精度较高,但是测量电路的设计难度高,且测量电路系统庞大,难于调试,而且成本相对较高。
鉴于上述原因,我们采用了ADC0804将输入的模拟信号充当测温器件。
外部温度信号经ADC0804将输入的模拟信号转换成8位的数字信号,通过并口传送到单片机(AT80C51)。
单片机系统将接收的数字信号译码处理,通过数码管将温度显示出来,同时单片机系统还将完成按键温度设定、一段温度内空调没法使用等程序的处理,将处理温度信号与设定温度值比较形成可控制空调制冷、制热、停止工作三种工作状态,从而实现空调的智能化。
原理图如下图所示:图 1 系统原理图二、硬件电路设计该空调温度控制系统的硬件电路,只要由单片机AT80C51最小系统、8段译码管、数码管、按键电路、驱动电路、A/D转换电路、温度采样电路等组成。
基于Python的智能温控系统设计与实现智能温控系统是一种能够根据环境温度和用户需求自动调节室内温度的系统。
随着人们对生活品质的要求不断提高,智能家居系统逐渐成为现代家庭的标配之一。
本文将介绍基于Python语言的智能温控系统的设计与实现过程。
1. 系统架构设计智能温控系统主要由传感器模块、控制模块和执行模块组成。
传感器模块用于实时监测室内外温度,控制模块根据传感器数据和用户设定的温度阈值进行决策,执行模块负责控制空调或暖气等设备进行温度调节。
2. 传感器模块传感器模块通常包括温度传感器和湿度传感器。
在Python中,可以通过引入相应的库来实现传感器数据的读取。
例如,使用Adafruit_DHT库可以轻松读取DHT系列传感器的数据。
示例代码star:编程语言:pythonimport Adafruit_DHTsensor = Adafruit_DHT.DHT11pin = 4humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)if humidity is not None and temperature is not None:print('Temp={0:0.1f}*CHumidity={1:0.1f}%'.format(temperature, humidity))else:print('Failed to get reading. Try again!')示例代码end3. 控制模块控制模块根据传感器数据和用户设定的温度阈值来决定是否开启或关闭空调、加热器等设备。
在Python中,可以通过条件语句来实现控制逻辑。
示例代码star:编程语言:pythondesired_temperature = 25if temperature < desired_temperature:# turn on heater or air conditionerprint('Turning on heater/air conditioner...')else:# turn off heater or air conditionerprint('Turning off heater/air conditioner...')示例代码end4. 执行模块执行模块负责与空调、暖气等设备进行通信,控制其工作状态。
1、空调机温度控制系统
2、16路抢答器设计
4、汽车倒车防撞报警器的设计与实现
3、单片机在城市智能交通灯中的控制
5、基于单片机的LCD时钟电路设计
6、脉宽调制开关电源的原理与应用
7、基于单片机的定时闹铃设计
8、注塑机电气控制线路设计
9、起重机电气控制线路设计
10、基于51单片机的电子日历的设计
11、点阵LED汉字显示系统的设计
12、用单片机控制直流电机或步进电机
13、单片机控制音乐播放
14、三相桥式有源逆变电路的设计和研究15、代替小型PLC的单片机控制器
16、电动自行车调速控制器设计与研究
17、数控机床伺服控制系统的研究
18、基于8051的日历设计
19、基于8051的数控直流电压源设计
20、基于8051的简易电子屏设计
21、多功能波形发生器设计
22、带稳幅的文氏电桥振荡器设计
23、基于8051的打铃系统设计调光灯电路设计
24、串联稳压电路设计
25、简易数字频率计设计
1。
优秀论文审核通过未经允许切勿外传基于单片机的水温控制系统设计摘要温度控制系统可以说是无所不在,热水器系统、空调系统、冰箱、电饭煲、电风扇等家电产品以至手持式高速高效的计算机和电子设备,均需要提供温度控制功能。
本系统的设计可以用于热水器温度控制系统和饮水机等各种电器电路中。
它以单片机AT80C51为核心,通过3个数码管显示温度和4个按键实现人机对话,使用单总线温度转换芯片DS18B20实时采集温度并通过数码管显示,并提供各种运行指示灯用来指示系统现在所处状态,如:温度设置、加热、停止加热等,整个系统通过四个按键来设置加热温度和控制运行模式。
关键词:单片机、数码管显示、单总线、DS18B20.Based Temperature Control SystemAbstractTemperature control system can be said to be ubiquitous, water can be used for drinking water -machine dialogue, the use of single-chip bus temperature conversion temperature DS18B20 real-time acquisition and through the digital display and offers a variety of operating light to indicate system now live in the state, such as: temperature setting, ,共同点。
输出控制接点的共同接点。
●NC:Normal Close常闭点。
以Com为共同点,NC与COM在平时是呈导通状态的。
●NO:Normal Open常开点。
NO与COM在平时是呈开路状态的,当继电器动作时,NO与COM导通,NC与COM则呈开路状态。
基于单片机的空调温度控制器设计The design of air conditioning temperature controller based on MCU学院:信息科学与工程专业班级:测控技术与仪器1003班学号:100401316学生姓名:刘和平指导教师:颜华(教授)2014 年6 月摘要随着经济的发展和人们生活水平的提高,空调机受到了广泛的应用。
空调机的温度控制器主要是由温度传感器感受室内温度变化,将采集到的温度信号处理后与设定的温度值进行比较,控制继电器的通断,使温度被控制在设定值左右,使空调器的工作状态随着人们要求和环境状态而自动变化,迅速准确的达到人们的要求,并使空调器的工作状态保持在最合理的状态下。
在工农业生产、科学研究和在人们的生活领域中,温度测控系统占有很重要的地位,得到了广泛的应用。
因此,温度传感器的应用数量居各种传感器之首。
目前,温度传感器正从模拟式向数字集成式方向飞速发展。
本文主要从硬件和软件两方面介绍了单片机温度控制系统的设计。
该系统以STC12C5608AD单片机为核心,主要由温度检测电路、按键与显示电路、继电器控制电路等构成。
在本系统中,主要是同过DS18B20采集被测温度并转换成数字信号送单片机,以单片机为核心数据处理系统,通过两位数码管,显示设定温度,通过继电器来控制压缩机、四通阀从而控制空调制冷或制热。
本论文概述了温控器的发展及基本原理,介绍了温度传感器的原理及特性,分析了DS18B20温度传感器的优劣。
在此基础上描述了系统研制的理论基础,对测温系统的一些主要参数进行了讨论。
同时在介绍温度控制系统功能的基础上,提出了系统的总体构成。
针对测温系统温度采集、接收、处理、显示部分的总体设计方案进行了论证,进一步介绍了单片机在系统中的应用,分析了系统各部分的硬件及软件实现。
关键词:DS18B20;单片机;温度控制;空调AbstractWith the development of economy and the improvement of people's living standard, the air conditioner has been widely applied. Temperature controller of air conditioner is mainly composed of sensors to monitor indoor temperature, the temperature signal processing the collected with the set temperature value, to control the on-off relay, the temperature is controlled in the set value, the air conditioner working condition with people demand and the state of the environment changes rapidly and automatically, accurate to the requirements of the people, and make the air conditioner working state is maintained in a reasonable state. In the industrial and agricultural production, scientific research and in people's lives, temperature measurement and control system plays a very important role, has been widely applied. Therefore, the number of temperature sensor applications of various sensors of the first home. At present, the temperature sensor from analog to digital integrated development.This paper mainly describes the hardware and software aspects of the design of single-chip temperature control system. The system STC12C5608AD microcontroller core, mainly by the temperature detection circuit, buttons and display circuit, relay control circuit, etc.. In this system, mainly through the DS18B20 collection with the measured temperature and converted into a digital signal sent to the microcontroller, microcontroller as the core data processing system, through two digital tube display set temperature, the compressor is controlled by relays, Stone valve to control the air conditioning, refrigeration or heating. This paper outlines the development and the basic principles of the thermostat, introduced the principle and characteristics of the temperature sensor. Analysis of the merits of the DS18B20 temperature sensor. Based on this description of the theoretical basis for the development of the system, some of the key parameters of the measurement system were discussed. While the introduction of a temperature control system functions is proposed based on the overall structure of the system. Temperature measurement system for collecting, receiving, processing, display part of the overall design has been demonstrated, further describes the SCM applications in the system, and analyzes the various parts of the system hardware and software.Keywords: DS18B20; single chip microcomputer; temperature control; air conditioningII目录摘要 (I)Abstract (II)第1章绪论 (1)1.1 课题研究目的 (1)1.2 课题研究意义 (1)第2章系统总体方案设计 (3)2.1 温度传感器产品分类与选择 (3)2.1.1 常用的测温方法 (3)2.1.2 温度传感器产品分类 (3)2.1.3 温度传感器的选择 (5)2.2 总体方案的确定 (6)2.3 系统实现框图 (7)第3章系统单元电路设计 (8)3.1 系统相关硬件及模块介绍 (8)3.1.1 温度采集电路 (8)3.1.2 STC12C5608AD介绍 (9)3.1.3 时钟电路 (11)3.1.4 复位电路 (11)3.1.5 温度显示电路 (12)3.1.6 按键功能设置电路 (13)3.1.7 继电器驱动电路 (14)3.1.8 继电器控制电路 (14)3.1.9 压缩机、四通阀 (15)3.1.10 电动机电路 (15)第4章系统软件设计 (17)4.1 DS18B20数据通信概述 (17)4.2 控制接口时序说明 (19)4.3 软件程序设计 (20)4.3.1 主程序模块流程图 (21)4.3.2 DS18B20测温程序及流程图 (22)4.3.3 按键扫描程序及流程图 (25)4.4程序调试 (26)4.4.1 Keil uVision2软件 (26)4.4.2程序调试过程中遇到的问题及解决办法 (27)第5章结论 (28)参考文献 (29)致谢 (31)附录1 系统硬件电路图 (32)附录2 系统软件程序................................................................................ 错误!未定义书签。
实验三十二温度传感器温度控制实验1.了解温度传感器电路的工作原理2.了解温度控制的基本原理3.掌握一线总线接口的使用这是一个综合硬件实验,分两大功能:温度的测量和温度的控制。
1.DALLAS 最新单线数字温度传感器 DS18B20 简介Dallas 半导体公司的数字化温度传感器 DS1820 是世界上第一片支持“一线总线”接口的温度传感器。
现场温度直接以“一线总线”的数字方式传输,大大提高了系统的抗干扰性。
适合于恶劣环境的现场温度测量,如:环境控制、设备或者过程控制、测温类消费电子产品等。
与前一代产品不同,新的产品支持3V~5.5V 的电压范围,使系统设计更灵便、方便。
DS18B20 测量温度范围为 -55°C~+125°C,在-10~+85°C 范围内,精度为±0.5°C。
DS18B20 可以程序设定 9~12 位的分辨率,及用户设定的报警温度存储在EEPROM 中,掉电后依然保存。
DS18B20 内部结构DS18B20 内部结构主要由四部份组成: 64 位光刻ROM、温度传感器、非挥发的温度报警触发器 TH 和 TL、配置寄存器。
DS18B20 的管脚罗列如下: DQ 为数字信号输入/输出端; GND 为电源地; VDD 为外接供电电源输入端(在寄生电源接线方式时接地)。
光刻ROM 中的 64位序列号是出厂前被光刻好的,它可以看做是该DS18B20 的地址序列码。
64 位光刻 ROM 的罗列是:开始 8 位(28H)是产品类型标号,接着的 48 位是该 DS18B20 自身的序列号,最后 8 位是前面 56 位的循环冗余校验码(CRC=X8+X5+X4+1)。
光刻 ROM 的作用是使每一个 DS18B20都各不相同,这样就可以实现一根总线上挂接多个DS18B20 的目的。
DS18B20 中的温度传感器可完成对温度的测量,以 12 位转化为例:用 16 位符号扩展的二进制补码读数形式提供,以 0.0625℃/LSB 形式表达,其中 S 为符号位。
空调维修,因我而易!1程序版本:ELY/08-06 /(Rev01)中央空调万能通用型控制器使用说明书EL Y 冷源科技★版权所有@2009-8-22业务电话**************图文传真**************请您务必于维修安装前仔细阅读本说明书空调维修,因我而易!2中央空调万能通用型控制器说明书QTM120C2户式冷水机组一、产品简介本产品基于中央空调维修的特点并结合麦克维尔、开利、约克、特灵等主流空调品牌的产品控制技术及系统匹配参数设计开发。
内置先进的系统过冷度、过热度智能匹配程序。
集成所有空调系统保护电路,完全通用市场上绝大多数中央空调品牌。
QTM120C2完美通用于所有品牌户式冷(热)水机组及各种不同类型小型风冷冷(热)水机组空调产品。
二、产品功能✧单个主板可控制1-2台压缩机,2个四通阀,2个散热风机,2台循环水泵✧工作模式:制冷/制热/自动运行/待机防冻/智能除霜✧支持七组定时开关机功能✧压缩机再启动保护功能✧压缩机过载保护功能✧感温器缺失自动检测报警功能✧先进的系统过冷度/过热度智能匹配功能✧冷媒泄露自动检测功能✧智能能量控制,负荷匹配功能✧根据负荷智能调整压缩机平均磨损功能✧TTL 通讯接口,连线距离<30M三、控制面板操作说明出水3空调维修,因我而易!4注:通过开/关机键对机组启停控制时,是根据当前机组状态,取反控制,即如是开机则执行关机。
多色彩背光LCD 显示,线控器能接受面板按键和红外遥控控制。
用来控制小型冷热水机组。
它支持以下功能控制: 模式——制冷,制热独立的制冷模式温度设置和制热模式温度设置 进水/出水温度显示 实时时间显示 实时开/关 手动除霜 按键锁定功能不同的控制参数设定,如:除霜终止温度等 上电默认关机或最后运行状态选择 远程遥控开/关 室外风机速度显示永久性记忆——重新上电时保持掉电前的设置 多色彩背光显示 多种错误代码读出 按键输入时蜂鸣器提醒 无线遥控控制掉电时电池支持实时时钟运行1)通电设置通电后,系统从永久记忆体中获取最新设定和系统状态信息:a)模式空调维修,因我而易!5b)制冷和制热模式温度设定c)定时开/关机设定d)密码和运行时间设定e)回水或出水温度显示f)系统状态(开/关)g)上电默认关机或最后运行状态h)按键锁定状态i)系统运行时间2)模式按〈模式〉键将循环实现从制冷到制热模式的转换(模式切换需在关机状态下)。
/******************************************************//**软件首页类//******************************************************/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Software{/// Moves the specified old index./// <param name="oldIndex">The old index.</param>/// <param name="newIndex">The new index.</param>public void Move(int oldIndex, int newIndex){this.MoveItem(oldIndex, newIndex);}/// Adds the range./// <param name="items">The items.</param>public void AddRange(params T[] items){this.BeginUpdate();for (int i = 0; i < items.Length; i++){this.Add(items[i]);}this.EndUpdate();}/// Begins the update.public void BeginUpdate(){this.update++;}/// Ends the update.public void EndUpdate(){this.EndUpdate(true);}internal virtual void EndUpdate(bool notify){update--;if (update <= 0){this.update = 0;if (notify){OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));}}}#endregion#region Overridesprotected internal int Version{get{return this.version;}}protected bool IsInUpdate{get { return this.update > 0; }}protected override void InsertItem(int index, T item){base.InsertItem(index, item);this.OnPropertyChanged("Count");this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Add, item, index);}protected override void SetItem(int index, T item){T oldItem = base[index];base.SetItem(index, item);this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Replace, oldItem, item, index);}protected override void RemoveItem(int index){T item = base[index];base.RemoveItem(index);this.OnPropertyChanged("Count");this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Remove, item, index);}protected override void ClearItems(){base.ClearItems();this.OnPropertyChanged("Count");this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Reset);}protected virtual void MoveItem(int oldIndex, int newIndex){T item = base[oldIndex];base.RemoveItem(oldIndex);base.InsertItem(newIndex, item);this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Move, item, newIndex, oldIndex);}#endregion#region INotifyCollectionChanged Memberspublic event NotifyCollectionChangedEventHandler CollectionChanged;protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args){if (this.CollectionChanged != null && update == 0){this.CollectionChanged(this, args);this.version++;}}private void OnCollectionChanged(NotifyCollectionChangedAction action){OnCollectionChanged(new NotifyCollectionChangedEventArgs(action));}private void OnCollectionChanged(NotifyCollectionChangedAction action, object item, int index){OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, item, index));}private void OnCollectionChanged(NotifyCollectionChangedAction action, object oldItem, object item, int index){OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, oldItem, item, index));}#endregion#region INotifyPropertyChanged Memberspublic event PropertyChangedEventHandler PropertyChanged;protected virtual void OnPropertyChanged(PropertyChangedEventArgs e){if (this.PropertyChanged != null){this.PropertyChanged(this, e);}}protected void OnPropertyChanged(string propertyName){this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));}#endregion}}}/******************************************************//**校准设置类//******************************************************/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Calibration settings{/// Base class for all layers.public abstract class MapLayer : ItemsControl, ILayer{/// Identifies the BaseZoomLevel dependency property.public static readonly DependencyProperty BaseZoomLevelProperty = DependencyProperty.RegisterAttached("BaseZoomLevel",typeof(double),typeof(MapLayer),new PropertyMetadata(double.NaN, new PropertyChangedCallback(LocationChangedHandler)));/// Identifies the HotSpot dependency property.public static readonly DependencyProperty HotSpotProperty = DependencyProperty.RegisterAttached("HotSpot",typeof(HotSpot),typeof(MapLayer),new PropertyMetadata(null, new PropertyChangedCallback(LocationChangedHandler)));/// Identifies the GeographicalSize dependency property.public static readonly DependencyProperty GeographicalSizeProperty = DependencyProperty.RegisterAttached("GeographicalSize",typeof(Location),typeof(MapLayer),new PropertyMetadata(Location.Empty, new PropertyChangedCallback(GeographicalSizeChangedHandler)));/// Identifies the Location dependency property.public static readonly DependencyProperty LocationProperty = DependencyProperty.RegisterAttached("Location",typeof(Location),typeof(MapLayer),new PropertyMetadata(Location.Empty, new PropertyChangedCallback(LocationChangedHandler)));/// Identifies the MaxScale dependency property.public static readonly DependencyProperty MaxScaleProperty = DependencyProperty.RegisterAttached("MaxScale",typeof(double),typeof(MapLayer),new PropertyMetadata(double.NaN, new PropertyChangedCallback(LocationChangedHandler)));/// Identifies the MinScale dependency property.public static readonly DependencyProperty MinScaleProperty = DependencyProperty.RegisterAttached("MinScale",typeof(double),typeof(MapLayer),new PropertyMetadata(double.NaN, new PropertyChangedCallback(LocationChangedHandler)));/// Identifies the ZoomRange dependency property.public static readonly DependencyProperty ZoomRangeProperty = DependencyProperty.RegisterAttached("ZoomRange",typeof(ZoomRange),typeof(MapLayer),new PropertyMetadata(ZoomRange.Empty, new PropertyChangedCallback(LocationChangedHandler)));private WeakReference mapControl = null;/// Initializes a new instance of the MapLayer class.protected MapLayer(){this.Loaded += new RoutedEventHandler(this.BaseLayer_Loaded);/// Gets or sets map control this layer belongs to.public RadMap MapControl{get{if (this.mapControl != null&& this.mapControl.IsAlive){return this.mapControl.Target as RadMap;}else{return null;}}set{RadMap oldMap = null;if (this.mapControl != null&& this.mapControl.IsAlive){oldMap = this.mapControl.Target as RadMap;}this.mapControl = value != null ? new WeakReference(value) : null;this.OnMapChanged(oldMap, value);}}/// Gets value of the attachable BaseZoomLevel property./// The BaseZoomLevel affect FrameworkElements (except MapShape based ones.) /// It specify zoom level where framework element in the information layer/// have ScaleTransform with scale = 1. If this property is set, then/// scale transformation will be applied to the framework element when/// we zoom in/out map control./// <param name="element">Element to get value of the property from.</param> /// <returns>Value of the BaseZoomLevel property.</returns>public static double GetBaseZoomLevel(DependencyObject element){return (double)element.GetV alue(BaseZoomLevelProperty);}/// Gets value of the attachable HotSpot property./// <param name="element">Element to get value of the property from.</param> /// <returns>Value of the HotSpot property.</returns>public static HotSpot GetHotSpot(DependencyObject element){return (HotSpot)element.GetValue(HotSpotProperty);}/// Gets value of the attachable GeographicalSize property./// <param name="element">Element to get value of the property from.</param> /// <returns>Value of the GeographicalSize property.</returns>public static Location GetGeographicalSize(DependencyObject element){return (Location)element.GetValue(GeographicalSizeProperty);}/// Gets value of the attachable Location property./// <param name="element">Element to get value of the property from.</param> /// <returns>Value of the Location property.</returns>public static Location GetLocation(DependencyObject element){return (Location)element.GetValue(LocationProperty);}/// Gets value of the attachable MaxScale property./// The MaxScale affect FrameworkElements (except MapShape based ones.)/// It specify maximum scale factor which will be applied to the framework element when/// it has BaseZoomLevel property set and we zoom in map control./// <param name="element">Element to get value of the property from.</param>/// <returns>Value of the MaxScale property.</returns>public static double GetMaxScale(DependencyObject element){return (double)element.GetV alue(MaxScaleProperty);}/// Gets value of the attachable MinScale property./// The MinScale affect FrameworkElements (except MapShape based ones.)/// It specify maximum scale factor which will be applied to the framework element when/// it has BaseZoomLevel property set and we zoom out map control./// <param name="element">Element to get value of the property from.</param>/// <returns>Value of the MinScale property.</returns>public static double GetMinScale(DependencyObject element){return (double)element.GetV alue(MinScaleProperty);}/// Gets value of the attachable ZoomRange property./// <param name="element">Element to get value of the property from.</param>/// <returns>Value of the ZoomRange property.</returns>public static ZoomRange GetZoomRange(DependencyObject element){return (ZoomRange)element.GetValue(ZoomRangeProperty);}/// Sets value of the attachable BaseZoomLevel property./// The BaseZoomLevel affect FrameworkElements (except MapShape based ones.)/// It specify zoom level where framework element in the information layer/// have ScaleTransform with scale = 1. If this property is set, then/// scale transformation will be applied to the framework element when/// we zoom in/out map control./// <param name="element">Element to set value of the property to.</param>/// <param name="value">Zoom level.</param>public static void SetBaseZoomLevel(DependencyObject element, double value){element.SetValue(BaseZoomLevelProperty, value);}/// Sets value of the attachable HotSpot property./// <param name="element">Element to set value of the property to.</param>/// <param name="value">Hotspot.</param>public static void SetHotSpot(DependencyObject element, HotSpot value){element.SetValue(HotSpotProperty, value);}/// Sets value of the attachable GeographicalSize property./// <param name="element">Element to set value of the property to.</param>/// <param name="value">Geographical size of the element.</param>public static void SetGeographicalSize(DependencyObject element, Location value){element.SetValue(GeographicalSizeProperty, value);}/// Sets value of the attachable Location property./// <param name="element">Element to set value of the property to.</param>/// <param name="value">Geographical location of the element.</param>public static void SetLocation(DependencyObject element, Location value){element.SetValue(LocationProperty, value);}/// Sets value of the attachable MaxScale property./// The MaxScale affect FrameworkElements (except MapShape based ones.)/// It specify maximum scale factor which will be applied to the framework element when/// it has BaseZoomLevel property set and we zoom in map control./// <param name="element">Element to get value of the property from.</param>/// <param name="value">Value of the MaxScale property.</param>public static void SetMaxScale(DependencyObject element, double value){element.SetValue(MaxScaleProperty, value);}/// Sets value of the attachable MinScale property./// The MinScale affect FrameworkElements (except MapShape based ones.)/// It specify maximum scale factor which will be applied to the framework element when/// it has BaseZoomLevel property set and we zoom out map control./// <param name="element">Element to get value of the property from.</param>/// <param name="value">Value of the MinScale property.</param>public static void SetMinScale(DependencyObject element, double value){element.SetValue(MinScaleProperty, value);}/// Sets value of the attachable ZoomRange property./// <param name="element">Element to set value of the property to.</param>/// <param name="value">Zoom range of the element.</param>public static void SetZoomRange(DependencyObject element, ZoomRange value){element.SetValue(ZoomRangeProperty, value);}/// Dispose all resources are used by RadMap control.public virtual void Dispose(){this.MapControl = null;}/// Called to arrange and size the content./// <param name="finalSize">The computed size that is used to arrange the content.</param>/// <returns>The calculated size.</returns>protected override Size ArrangeOverride(Size finalSize){this.SetClip(finalSize);return base.ArrangeOverride(finalSize);}/// Is called when map control is changed for this map layer./// <param name="oldMap">Old map control.</param>/// <param name="newMap">New map control.</param>protected abstract void OnMapChanged(RadMap oldMap, RadMap newMap);/// Set up clipping for layer.protected abstract void SetClip(Size size);/// Hotspot property changed callback./// <param name="source">Source.</param>/// <param name="eventArgs">Event Args.</param>private static void HotspotChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs){FrameworkElement element = source as FrameworkElement;if (element != null){// Set element's hot spot.}}/// GeographicalSize property changed callback./// <param name="source">Source.</param>/// <param name="eventArgs">Event Args.</param>private static void GeographicalSizeChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs){FrameworkElement element = source as FrameworkElement;if (element != null){// Set geographical size of the element relative to the layer.}}/// Location property changed callback./// <param name="source">Source.</param>/// <param name="eventArgs">Event Args.</param>private static void LocationChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs){MapShape shape = source as MapShape;if (shape == null){FrameworkElement element = source as FrameworkElement;ContentPresenter presenter = source as ContentPresenter;if ((presenter != null && presenter.Content is MapShape)|| (element != null&& element.ActualWidth > 0&& element.ActualHeight > 0)){// Set location of the element relative to the layer.InformationLayer layer = element.GetParent<InformationLayer>();if (layer != null){LocationRect region = layer.Region;layer.SetRegionFromItems();if (region == layer.Region){presenter = layer.ParentOfType<ContentPresenter, InformationLayer>(element);if (presenter != null){// Copy new values.layer.ArrangeItem(presenter);}else{layer.ArrangeItem(element);}}}// Set square of the element in the Dynamic layer.DynamicLayer dynamicLayer = element.GetParent<DynamicLayer>();if (dynamicLayer != null){presenter = layer.ParentOfType<ContentPresenter, DynamicLayer>(element);if (presenter != null){dynamicLayer.MoveItem(presenter,(Location)eventArgs.NewValue);}else{dynamicLayer.MoveItem(element,(Location)eventArgs.NewValue);}}}}else{if (shape.MapCanvas != null){InformationLayer layer = yer;if (layer == null){layer = shape.GetParent<InformationLayer>();}if (layer != null){ContentPresenter presenter = layer.ItemContainerGenerator.ContainerFromItem(shape) as ContentPresenter;if (presenter == null && shape.DataContext != null){presenter = layer.ItemContainerGenerator.ContainerFromItem(shape.DataContext) as ContentPresenter;}if (presenter != null){presenter.SetValue(eventArgs.Property,eventArgs.NewValue);}}}}}private void BaseLayer_Loaded(object sender, RoutedEventArgs e){if (this.MapControl != null){Size size = new Size(this.MapControl.ActualWidth, this.MapControl.ActualHeight);this.SetClip(size);}}private T1 ParentOfType<T1, T2>(UIElement element) where T1 : DependencyObject{if (element == null) return null;DependencyObject parent = VisualTreeHelper.GetParent(element);while ((parent != null) && !(parent is T1) && !(parent is T2)){DependencyObject newVisualParent = VisualTreeHelper.GetParent(parent);if (newVisualParent != null){parent = newVisualParent;}else{// try to get the logical parent ( e.g. if in Popup)if (parent is FrameworkElement){parent = (parent as FrameworkElement).Parent;}else{break;}}}return parent as T1;}}}}/******************************************************//**温度设置类//******************************************************/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Temperature setting{/// DataServiceCollection.internal class DataServiceCollection<TEntity> :ObservableItemCollection<TEntity>,INotifyPropertyChangedwhere TEntity : class, INotifyPropertyChanged{public event EventHandler<LoadOperationCompletedEventArgs<TEntity>> LoadCompleted;private SynchronizationContext syncContext;private readonly DataServiceContext context;private readonly WCF.DataServiceCollection<TEntity> wcfDataServiceCollection;private IAsyncResult currentLoadOperation;private bool cancelledRequest;private bool ignoreCollectionChangedOverride;private int totalItemCount = -1;private bool isLoading;private bool hasChanges;/// Gets the total item count./// <value>The total item count.</value>public int TotalItemCount{get{return this.totalItemCount;}private set{if (this.totalItemCount != value){this.totalItemCount = value;this.OnPropertyChanged("TotalItemCount");}}}public bool IsLoading{get{return this.isLoading;}private set{if (this.isLoading != value){this.isLoading = value;this.OnPropertyChanged("IsLoading");}}}public bool HasChanges{get{return this.hasChanges;}private set{if (this.hasChanges != value){this.hasChanges = value;this.OnPropertyChanged("HasChanges");}}}/// Initializes a new instance of the DataServiceCollection class./// <param name="context">The context.</param>public DataServiceCollection(DataServiceContext context){if (context == null){throw new ArgumentNullException("context");}this.context = context;this.wcfDataServiceCollection = new WCF.DataServiceCollection<TEntity>(this.context);}public void SetSynchronizationContext(SynchronizationContext synchronizationContext){this.syncContext = synchronizationContext;}public void Load(LoadContext loadContext){this.wcfDataServiceCollection.Clear();var query = loadContext.DataServiceQuery;var queryRequestUri = query.RequestUri;this.IsLoading = true;// Any other option will break the inner logic.if (this.context.MergeOption != MergeOption.OverwriteChanges){throw new InvalidOperationException("DataServiceContext.MergeOption can only be MergeOption.OverwriteChanges.");}this.currentLoadOperation = this.context.BeginExecute<TEntity>(queryRequestUri, this.OnResultsReceived, loadContext);}public void CancelLoad(){if (this.currentLoadOperation != null&& !this.currentLoadOperation.IsCompleted){this.cancelledRequest = true;try{this.context.CancelRequest(this.currentLoadOperation);}catch (WebException){}}}/// Called when the results arrive asynchrounously from the server./// <remarks>/// Since there is no guarantee that this method will be invoked on the UI thread,/// we have to marshal the response operation back to the main application thread/// (the UI thread). Code that accesses entities, accesses the DataServiceContext or/// enumerates results of LINQ queries needs to happen on the UI thread./// </remarks>/// <param name="result">The result.</param>private void OnResultsReceived(IAsyncResult result){this.syncContext.Post(delegate(object state){this.SynchronizeContextLoadCompleted(result);}, null);}[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design","CA1031:DoNotCatchGeneralExceptionTypes")]private void SynchronizeContextLoadCompleted(IAsyncResult result){if (this.cancelledRequest){this.cancelledRequest = false;this.currentLoadOperation = null;this.IsLoading = false;var args = new LoadOperationCompletedEventArgs<TEntity>(Enumerable.Empty<TEntity>(), null, (LoadContext)result.AsyncState, true, null, 0);this.OnLoadCompleted(args);}else{QueryOperationResponse<TEntity> response = null;try{response = (QueryOperationResponse<TEntity>)this.context.EndExecute<TEntity>(result);}catch (Exception exception){this.IsLoading = false;var args = new LoadOperationCompletedEventArgs<TEntity>(Enumerable.Empty<TEntity>(), response, (LoadContext)result.AsyncState, false, exception, 0);this.OnLoadCompleted(args);return;}if (response != null){this.ProcessResponse(response, (LoadContext)result.AsyncState);}}}private void ProcessResponse(QueryOperationResponse<TEntity> response, LoadContext loadContext){//// Load the entities that have just arrived in the "state"//// DataServiceCollection so it can start "tracking" them.//// response is an IEnumerable<T> and contains the entitiesthis.wcfDataServiceCollection.Load(response);var continuation = response.GetContinuation();if (continuation != null){// Send a request for the next server page.this.currentLoadOperation = this.context.BeginExecute<TEntity>(continuation, this.OnResultsReceived, loadContext);}else{this.IsLoading = false;// This was the last page, so copy all the entities to "this".this.SuspendNotifications();this.ignoreCollectionChangedOverride = true;this.Clear();this.AddRange(this.wcfDataServiceCollection);this.ignoreCollectionChangedOverride = false;try{this.TotalItemCount = (int)response.TotalCount;}catch (InvalidOperationException){// The server refuses to tell us the total count for some reason.// Most probably the DataServiceBehavior has its// AcceptCountRequests set to false.// Set the TotalItemCount to be as much as we know.// Nothing better that we can do. Bad server, bad!this.TotalItemCount = this.Count;}this.ResumeNotifications();}var args = new LoadOperationCompletedEventArgs<TEntity>(this.wcfDataServiceCollection, response, loadContext, false, null, this.TotalItemCount);this.OnLoadCompleted(args);}protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e){base.OnCollectionChanged(e);if (this.ignoreCollectionChangedOverride){return;}switch (e.Action){case NotifyCollectionChangedAction.Add:foreach (TEntity item in e.NewItems){this.wcfDataServiceCollection.Add(item);this.TotalItemCount++;}break;case NotifyCollectionChangedAction.Remove:foreach (TEntity item in e.OldItems){this.wcfDataServiceCollection.Remove(item);this.TotalItemCount--;}break;case NotifyCollectionChangedAction.Replace:break;case NotifyCollectionChangedAction.Reset:break;default:break;}this.RefreshHasChanges();}protected override void OnItemChanged(ItemChangedEventArgs<TEntity> e){base.OnItemChanged(e);this.RefreshHasChanges();}public void RefreshHasChanges(){this.HasChanges = this.context.HasChanges();}private void OnPropertyChanged(string propertyName){this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));}protected virtual void OnLoadCompleted(LoadOperationCompletedEventArgs<TEntity> args){var handler = this.LoadCompleted;if (handler != null){handler(this, args);}}}}}/******************************************************//**校准报告类//******************************************************/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Calibration report{/// A content holder class for the Docking.[DefaultProperty("IsSelected")][TemplateVisualState(Name = "Normal", GroupName = "CommonStateGroup")][TemplateVisualState(Name = "Selected", GroupName = "CommonStateGroup")][TemplateVisualState(Name = "MouseOver", GroupName = "CommonStateGroup")][TemplateVisualState(Name = "Disabled", GroupName = "CommonStateGroup")][TemplateVisualState(Name = "Unfocused", GroupName = "FocusStates")][TemplateVisualState(Name = "Focused", GroupName = "FocusStates")][TemplateVisualState(Name = "LastInGroup", GroupName = "LastInGroupStates")][TemplateVisualState(Name = "NotLastInGroup", GroupName = "LastInGroupStates")] [TemplateVisualState(Name = "Pinned", GroupName = "PinnedStates")][TemplateVisualState(Name = "Unpinned", GroupName = "PinnedStates")][TelerikToolboxCategory("Containers")]。
空调机温度控制系统
1. 设计要求及预期功能
用MCS-51单片机设计一个空调机的温控系统。
具体要求及功能如下:
①实时测量环境温度,并显示当前温度值。
②当室温度高于设定温度,压缩机运转,使室温降低。
③当室温低于设定温度,压缩机停止运转。
④温度设定功能,通过按键输入压缩机启停的温度设定值。
设定温度过程中显示设定温度值,以便于操作。
设定完毕后,改为显示当前测定温度值。
2. 总体方案
(1)系统设计
1所示。
①
②系统由四个主要功能模块组成:温度测量、按键输入,数码显示以及控制压缩机启停
模块。
◆温度测量模块的主要功能是将环境温度转化为电参数(电压),并通过A/D转换得到
数字量送入单片机。
◆按键输入模块主要功能是实现设定温度值的输入。
◆LED显示模块主要功能是显示当前环境温度值。
因空调对温度精度要求不高,本设
计只要求显示两位整数的温度值。
◆压缩机控制模块主要功能是单片机根据环境温度与设定温度的比较结果送出开关信
号、控制压缩机的启停。
(2)关键技术
◆本系统中的关键技术是如何实时测量室内温度。
在对外界物理量如温度、湿度、压
力等进行测量时,首先要解决的问题是如何将这些非电量转换为电参数(电阻、电压、
电流),其次,是如何将模拟量(电压)转换为数字量。
◆显然对温度的测量,温度传感器是必不可少的。
温度传感器的种类、型号很多。
在
本设计中选用的是AD590温度传感器。
3. 硬件设计及功能说明
⑴系统的硬件电路:包括主机、温度控制、压缩机的控制、按键及显示5个部分,系统硬件电路原理图如图2所示。
⑵功能说明
①将AD590作为室内温度传感器,当温度变化时,AD590会产生电流变化,经OPA1将电流转换为电压,由OPA2做零位调整,最后由OPA3反相放大10倍。
②ADC0804输出最大转换值=FFH(255),OPA3为放大10倍时,则本电路最大测量温度为:最大显示温度为5.1V/10=0.51V,即51o C(10为放大倍数)
255X=51 知X=0.2 即先乘2再除10
FF→255→255×2→510 R4=0.5 R3=10
即D4=0 D3=5 D2=1 D1=0
本电路显示器只取D3、D2两位数。
③按下P2.1按钮,放开后立即进入温度设定模式,显示设定最高温度34C(建立TABLE 内),每按一次设定温度将减少1C直至最低设定温度20C,再按一次又回到34C。
④当室温高于设定温度,压缩机(P3.0)运转,使室温降低,当室温低于设定温度,压缩机停止运转。
⑤当进入设定温度模式,如未按下设定按钮(P2.1),经数秒后自动解除设定模式,回到室温显示模式。
⑥本程序以计时中断,每50毫秒中断一次,比较室温与设定温度一次,而令压缩机运转或停止。
4. 软件设计
(1) 软件设计流程
主要包括5个模块:
●主程序
●按键设定温度模块
●十进制调整和数据转换模块
●控制模块
●显示模块
图2空调硬件电路原理图
主程序流程如图3所示。
(2) 汇编语言程序:
ORG 00H
JMP START0 ;主程序
ORG 0BH
JMP TIM0 ;TIMER0中断子程序START0:MOV TMOD,#01H ;TIMER0工作在MODE1 MOV TH0,#HIGH(65536-50000) ;50毫秒中断一次
MOV TL0,#LOW(65536-50000)
SETB TR0 ;启动TIMER0
MOV IE,#82H ;TIMER0中断使能
MOV 24H,#0FFH ;设定温度RAM初值
ANL P1,#00H ;清除显示器
MOV R0,#14 ;至TABLE的取码指针初值START:MOVX @R0,A ;令ADC0804开始转换/WR=0 WAIT:JNB P2.1,SET0 ;是否设定温度?
JB P2.0,ADC ;ADC0804转换完成否?
JMP W AIT
ADC:MOVX A,@R0 ;是则将转换值载入累加器CALL L1 ;调用十进制转换子程序
CALL DISP ;调用显示子程序
JMP START
L1:CLR C ;C=0
MOV 20H,#00H ;十进制转换的低位寄存器
MOV 21H,#00H ;十进制转换的高位寄存器
MOV R3,#08H ;作为十进制调整,调整的次数NEXT:RLC A ;将取入值转换为十进制
MOV R2,A ;暂存于R2
MOV A,20H ;(20H)乘2加C
ADDC A,20H
DA A ;做十进制调整
MOV 20H,A ;结果存回(20H)
MOV A,21H ;(21H)乘2加C
ADDC A,21H
MOV 21H,A ;做十进制调整
MOV A,R2 ;结果存回(21H)
DJNZ R3,NEXT ;做十进制调整结束?
L2:MOV A,20H
ADD A,20H ;(20H)乘2
DA A ;做十进制调整
MOV 20H,A ;存回20H
MOV A,21H
ADDC A,21H ;(21H)乘2
DA A ;做十进制调整
MOV 21H,A ;存回(21H)
RET
DISP:MOV A,20H ;(取D2值)(20H)RAM的高4位
ANL A,#0F0H
SWAP A ;变为低4位存入(22H)RAM
MOV 22H,A
MOV A,21H ;(取D3值)(21H)RAM的低4位
ANL A,#0FE
SWAP A ;变为高4位
ORL A,22H ;D3、D2合成8位存入室温地址(23H)
MOV 23H,A
MOV P1,A ;输出至P1显示温度
MOV R7,#0FFH ;延时
DJNZ R7,S
RET
SET0:CALL DELAY ;设定温度,按钮消除抖动JNB P2.1,S ;放开否?
CALL DELAY ;消除抖动
A2:CJNE R0,#0FFH,A1 ;是否取完最低温度20O C MOV R0,#14 ;是,则令取码指针指到最高温度A1:MOV A,R0 ;至TABLE取设定温度MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P1,A ;输出至P1显示设定温度
MOV 24E,A ;设定温度值存入(24H)RAM
MOV R5,#4FH ;设定P2.1按钮按键时间
D4:MOV R7,#0FFH
D2:MOV R6,#0FFH
D1:JNB P2.1,SET1 ;有按则跳至SET1
DJNZ R6,D1
DJNZ R7,D2
DJNZ R5,D4
JMP START ;没按时间到,则回到START SET1:CALL DELAY ;消除抖动
JNB P2.1,S ;放开否?
CALL DELAY ;消除抖动
DEC R0 ;将取码指针减去1,即减1O C
JMP A2 ;跳至A2,再检测P2.1有键按下否?
TIM0:PUSH ACC ;TIMER0中断子程序
PUSH PSW
MOV TH0,#HIGH(65536-50000);重设中断时间
MOV TL0,#LOW(65536-50000)
CLR C ;C=0
MOV A,24H ;(24H)设定温度RAM,(23H)室温RAM
SUBB A,23H ;(24H)减(23H)
JNC OFF ;C=0表示(24H)大,即设定温度大
CLR P3.0 ;C=1,设定温度小,令压缩机运转(P3.0)RETURN:POP PSW
POP ACC
RETI
OFF:SETB P3.0 ;设定温度大,令压缩机停止JMP RETURN
DELAY:MOV R7,#60 ;消除抖动延时
D3:MOV R6,#248
DJNZ R6,S
DJNZ R7,D3
RET
TABLE:DB 20H,21H,22H,23H,24H ;设定温计值
DB 25H,26H,27H,28H,29H
DB 30H,31H,32H,33H,34H
END
5. 系统调试
●完成了硬件设计、制作和软件编程之后,要使系统能够按设计意图正常运行,必
须进行系统调试。
●系统调试包括硬件调试和软件调试两个部分,软硬件的调试是不可能绝对分开的,
硬件的调试常常需要利用调试软件,软件的调试也可能需要通过对硬件的测试和控制来进行。
模拟实验时可用发光二极管的亮灭代替压缩机控制模块的起停来进行。
(1) 硬件调试
硬件的调试主要是把电路各种参数调整到符合设计要求,排除硬件故障,其中包括设计错误和工艺性故障。
(2) 软件调试
软件调试的任务是利用开发工具进行在线仿真调试,发现和纠正程序错误,同时也能发现硬件故障。
6. 参考文献
《单片机原理及应用》主编:张毅刚高等教育出版社
《单片机原理及系统设计》编著:胡汉才清华大学出版社
《MCS-51单片机应用设计》作者:张毅刚等哈尔滨工业大学出版社。