基于AT89S51单片机的智能电热水器的设计-毕业设计_第1页
基于AT89S51单片机的智能电热水器的设计-毕业设计_第2页
基于AT89S51单片机的智能电热水器的设计-毕业设计_第3页
基于AT89S51单片机的智能电热水器的设计-毕业设计_第4页
基于AT89S51单片机的智能电热水器的设计-毕业设计_第5页
已阅读5页,还剩43页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

湖南工业大学本科生毕业设计(论文)毕业设计.2键扫描子程序流程框图开始按键扫描开始按键扫描温度加1预设温度减1有键按下吗?是温度+键吗?是温度-键吗?①图显示子程序流程框图图3.3.1显示子程序流程框图图3.3.1开始恢复现场将代码送入P1口确定寄存器组调延时将位码送入P2口判断4位显示完了吗?现场保护结束NY3.4运行程序流程框图开始开始断电水温高于设定值吗?水温低于设定值吗?通电加热报警断电水位低于设定值吗?NYNYNY图软件仿真Proteus产品系列包含了革命性的VSM技术,用户可以对基于微控制器的设计连同所有的周围电子器件一起仿真,用户甚至可以实时采用诸如LED/LCD、键盘、RS232终端等动态外设模型来对设计进行交互仿真。ISIS提供给用户图形外观包括线宽、填充类型、字符等的全部控制,使用户能够生成如杂志上看到一样精美的原理图,远胜过CAD软件绘制出的稀薄的线条。画完图可以以图形文件输出,或者拷贝到剪切板以便其他文件使用。这就使得ISIS成为制作技术文件,学术论文,项目报告的理想工具,也是PCB设计的一个出色的前端,其画图的外形由风格模板定义。此界面下调出元件组成原理图,调试流程如下:按键→上电复位→水位检测→水温检测→数码管显示→下载程序运行:图3.5软件仿真示意图程序调试分为三个部分:按键调试,指示灯显示调试,及数码管显示。在具体仿真的过程中,按键调试时,应注意按键的次序,首先是温度+键,然后测试温度-键,否则有时会出现数码管显示延时现象,这种情况主要跟程序设计有关。基于编程方面有些薄弱的情况,应该严格按照按键次序进行调试。指示灯调试时,有时会出现指示灯无显示或者不明显、亮度不够的情况,这是由于指示灯电压过低造成的。数码管显示时,只要前两个步骤进行顺利,其就可以正常显示。由于本设计采用独立式按键,主程序调试结束后,各部分运行正常,能够显示水位及水温结果。另外,此设计采用的温度检测模块,检测精度不高,有时会出现温度跳跃式显示,比如:有时此一时刻温度显示为59℃,下一时刻会显示66℃结论基于AT89S51单片机的智能电热水器控制器,经过调试可以满足设计要求。首先由传感器检测水温,经过模数转换,发送到单片机控制中心,当水温小于设置范围1℃时,单片机控制继电器对电热水器加热;当水温超过温度设置范围1℃时,单片机控制继电器断电,停止加热;当温度超过99℃时,蜂鸣器报警断电;当水位小于系统设定值时,单片机控制继电器断电,停止加热。本设计有些方面需要进一步讨论,进一步完善的方面:(1)AT89S51单片机本身的存储空间很小,只有4KB,在实际运用中无法达到更多的设计要求。(2)由于AT89S51单片机结构简单,相比其他单片机(如:MC68HC05SR)来说,不能完成更多的要求,影响了其实用性。(3)水温检测的精度不太高。这是硬件的问题,由于没有找到很好的检测器件,造成实验结果有较小的误差。致谢本文是在我的导师****讲师的悉心指导下完成的,从论文题目的选定,大纲的编写,资料的收集与整理,论文数稿的修改、审稿到最终定稿,无不倾注他的心血和汗水。他的言传身教使我终生受益。还要感谢我的舍友,在撰稿期间给了我许多帮助和鼓励,尤其是***同学,对我的整体框架给予了许多建设性意见,也在我的软件仿真时,给予了很多帮助。衷心祝他们在以后的工作和生活中顺利。最后还要感谢我的父母,没有他们无私的奉献我是无法顺利完成学业的。学生签名:日期:参考文献[1]吴国经.单片机应用技术[M].北京:中国电力出版社.2004:10.[2]张振荣.MCS-51单片机原理及实用技术[M].北京:人民邮电出版社.2000:10-13.[3]沈红卫.基于单片机的智能系统设计与实现[M].北京:电子工业出版社.2005:30-35.[4]肖洪兵.跟我学用单片机[M].北京:北京航空航天大学出版社.2002:100-103.[5]楼然苗.51系列单片机设计实例[M].北京:北京航空航天大学出版社.2003:50-60.[6]李光飞.单片机课程设计实例指导[M].北京:北京航空航天大学出版社.2004:14-17.[7]张丰.电子开发论坛[EB/OL]./pub/txt/9888.html,1996-8-14.[8]徐惠民、安德宁.单片微型计算机原理接口与应用[M].北京:北京邮电大学出版社.1996:80-88.[9]夏继强.单片机实验与实践教程[M].北京:北京航空航天大学出版社.2001:71-76.[10]何立民.单片机高级教程[M].北京:北京航空航天大学出版社.2001:51-59.[11]张友德,涂时亮,陈章龙.MC68HC08系列单片机原理与应用[M].上海:复旦大学出版社.2001:16-18.[13]刘筱明.电脑电热水器继电器非正常状态下的保护措施[D].广东顺德万和电器有限公司.1999.[14]李建事.陈刚.家用电器单片机控制系统的制作与检修[M].上海:上海交通大学出版社.1998:22-30.[15]杨宁.单片机与控制技术[M].北京:北京航空航天大学出版社.2005:33-36.[16]付家才.单片机控制工程实践技术[M].北京:化学工业出版社.2004:42-45.附录1程序清单:1.A/D转换器子程序进行A/D转换时,采用查询EOC的标志信号来检测A/D转换是否完毕,若完毕则把数据通过P0端口读入,经过数据处理之后在数码管上显示。进行A/D转换之前,要启动转换的方法:ABC=110选择第三通道ST=0,ST=1,ST=0产生启动转换的正脉冲信号CH EQU30HDPCNT EQU31HDPBUF EQU33HGDATA EQU32HST BITP3.0OE BITP3.1EOC BITP3.2 ORG00H LJMPSTART ORG0BH LJMPT0X ORG30HSTART: MOVCH,#0BCH MOVDPCNT,#00H MOVR1,#DPCNT MOVR7,#5 MOVA,#10 MOVR0,#DPBUFLOP: MOV@R0,A INCR0 DJNZR7,LOP MOV@R0,#00H INCR0 MOV@R0,#00H INCR0 MOV@R0,#00H MOVTMOD,#01H MOVTH0,#(65536-4000)/256 MOVTL0,#(65536-4000)MOD256 SETBTR0 SETBET0 SETBEAWT: CLRST SETBST CLRSTWAIT: JNBEOC,WAIT SETBOE MOVGDATA,P0 CLROE MOVA,GDATA MOVB,#100 DIVAB MOV33H,A MOVA,B MOVB,#10 DIVAB MOV34H,A MOV35H,B SJMPWTT0X: NOP MOVTH0,#(65536-4000)/256 MOVTL0,#(65536-4000)MOD256 MOVDPTR,#DPCD MOVA,DPCNT ADDA,#DPBUF MOVR0,A MOVA,@R0 MOVCA,@A+DPTR MOVP1,A MOVDPTR,#DPBT MOVA,DPCNT MOVCA,@A+DPTR MOVP2,A INCDPCNT MOVA,DPCNT CJNEA,#8,NEXT MOVDPCNT,#00HNEXT: RETIDPCD: DB3FH,06H,5BH,4FH,66H DB6DH,7DH,07H,7FH,6FH,00HDPBT: DB0FEH,0FDH,0FBH,0F7H DB0EFH,0DFH,0BFH,07FH END2.数码管显示子程序 ORG 0000HMAX7219:DIN BITP1.1 ;定义变量 CLK BITP1.2 LOADBITP1.1 LED_BFEQU50H ;显示数据首址 AJMP MAINMAIN: MOV SP.#70H LCALL PROCESS ;设置MAX7219初始值 LCALL DISPLAY ;显示WAIT; ;其他程序省略 SJMP WAIT ;MAX7219初始化子程序PROCECC:MOV A,#0BH MOV B,#07H LCALL W_7219 MOVA,#09H MOVB,#00H LCALLW_7219 MOVA,##0AH MOVB,#09H LCALLW_7219 MOVA,#0CH MOVB,#01H LCALLW_7219 RET ;MAX7219显示子程序DISPLAY:MOVR0,#LED_BF MOVR4,#01H MOVR3,#08HC_DISP:MOVA,@R0 MOVB,A MOVA,R4 LCALLW_7219 INCR0 INCR4 DJNZR3,C_DISP RETW_7219:CLRLOAD LCALLSD_7219 MOVA,B LCALLSD_7219 SETBLOAD RETSD_7219:MOVR6,#08HC_SD:NOP CLR CLK RLCA MOVDIN,C NOP3.滤波电路驱动程序中值滤波,采样值分别放在R2,r3,r4中,结果从小到大排序放在R2,R3,R4中。;R3为中值FILT2:MOVA,R2CLRCSUBBA,R3JCFILT21MOVA,R2XCHA,R3MOVR2,AFILT21:MOVA,R3CLRCSUBBA,R4JCFILT22MOVA,R4XCHA,R3XCHR4,ACLRCSUBBA,R2JNCFILT22MOVA,R2MOVR3,AFILT22:RET4.温度传感电路DS18B20测温实验源程序ORG0000HSTART:MOVSP,#60H;开机初始化MOVP0,#0FFHMOVP1,#0FEHMOVP2,#0FFHMOVP3,#0FFHMAIN:LCALLGET_TEMPER;调用读温度子程序LCALLDISP;调用数码管显示子程序AJMPMAIN;重复循环:读DS18B20传感器的温度值GET_TEMPER:SETBP3.3LCALLRST18B20;复位DS18B20JB00H,DSS2RETDSS2:MOVA,#0CCH;跳过ROM匹配LCALLWR18B20MOVA,#44H;向DS18B20发出温度转换命LCALLWR18B20LCALLRST18B20;准备读温度前先复位MOVA,#0CCH;跳过ROM匹配LCALLWR18B20MOVA,#0BEH;向DS18B20发出读温度命令LCALLWR18B20LCALLRE18B20;读出温度数据RET;DS18B20复位初始化程序RST18B20:SETBP3.3NOPCLRP3.3MOVR0,#06BH;主机发出复位低脉冲MOVR1,#03HDSR1:DJNZR0,DSR1MOVR0,#6BHDJNZR1,DSR1SETBP3.3;拉高数据线NOPNOPNOPMOVR0,#25HDSR2:JNBP3.3,DSR3;等待DS18B20回应DJNZR0,DSR2LJMPDSR4DSR3:SETB00H;置标志位,表示DS1820存在LJMPDSR5DSR4:CLR00H;清标志位,表示DS1820不存在LJMPDSR7DSR5:MOVR0,#06BHDSR6:DJNZR0,DSR6;延时一段时间DSR7:SETBP3.3RET;写DS18B20的子程序WR18B20:MOVR2,#8CLRCWR1:CLRP3.3MOVR3,#6DJNZR3,$RRCAMOVP3.3,CMOVR3,#23DJNZR3,$SETBP3.3NOPDJNZR2,WR1SETBP3.3RET;从DS18B20中读温度数据程序RE18B20:MOVR4,#2MOVR1,#2FHRE00:MOVR2,#8RE01:CLRCSETBP3.3NOPNOPCLRP3.3NOPNOPNOPSETBP3.3MOVR3,#09RE10:DJNZR3,RE10MOVC,P3.3MOVR3,#23RE20:DJNZR3,RE20RRCADJNZR2,RE01MOV@R1,ADECR1DJNZR4,RE00RET;显示子程序DISP:MOVA,2FHMOVC,70HRRCAMOVC,71HRRCAMOVC,72HRRCAMOVC,73HRRCAMOV2FH,AMOVA,2FHMOVB,#10DIVABMOV30H,AMOV31H,BMOVA,30HMOVDPTR,#SGTBMOVCA,@A+DPTRMOVP0,A;显示温度“十位”值CLRP2.2SETBP2.0SETBP2.1SETBP2.3SETBP2.4LCALLYS4722UMOVA,31HMOVDPTR,#SGTBMOVCA,@A+DPTRMOVP0,A;显示温度“个位”值CLRP2.3SETBP2.0SETBP2.1SETBP2.2SETBP2.4LCALLYS4722UMOVA,#01000110BMOVP0,A;显示温度符号“℃”CLRP2.4SETBP2.0SETBP2.1SETBP2.2SETBP2.3LCALLYS4722URET;*************8位共阳数码管显示器字型码表**********SGTB:DB0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90HDB88H,83H,0C6H,0A1H,86H,8EH,89H,0A3H,8CH,0C8HYS4722U:MOVR4,#10;延时子程序Y3:MOVR5,#216DJNZR5,$DJNZR4,Y3RETEND附录2智能电热水器原理图:附录3TheControlleroftheDomesticElectricWater-Heater1.TheperspectivesofapplianceWater-heaterisakindofdomesticelectricappliancewhichcanbeusedinbathroom,washroomandkitchen.Thetypesofwater-heateravailableinthemarketatpresentincludes:electricwater-heater,solarwater-heater,gaswater-heater.TobespecificallyinChina,theuseofsolarwater-heaterislimitedbytheweatherandthescopeforuseisnarrowwhilegaswater-haterisfueledbypetrolandgas,thesupplyofwhichwillbedifficulttomeettheincreasingdemandsandbadforenvironment.Sotheelectricwater-heaterhasbecomemoreandmorepopularamongcustomers.AccordingtostatisticsfromChinesecommercialfederationnotlongago,themarketshareofelectricwater-heaterinsalesvolumeandsalesrevenuehassurpassedthegaswater-heaterwhichkeepsaheadforalongtime.Itispredictedbythisfederationthatdrivenbythelarger-scalereconstructingoftheelectricnetworkinthecityandtheextensivestartupofthehousingmarketinthecity,themarketforelectricwater-heaterwillpresentthestronggrowthtendencyinthenextfewyears.2.TheGoalforDesignTherearetwokindsofelectricwater-heatersavailableinthemarketatpresent:thecontinualfluenttypeandwaterstoragetype.Consideringthespecialdemandofthemoistworkingconditionsonsinglechip,weadoptthenewlypromotedMC68HC08singlechipbyMotorolatobethecontrolcenter.Withitshighresistancetointerference,steadyworking,flashmemoryandsoon,thissinglechipcansatisfythedemandoftheelectricwater-heaterwithhighperformance.Alsoconsideringthefiercecompetitionindomesticappliancesindustry,wewillrealizethesefunctionsbyusingcomponentsassimpleaspossibletoreducethecost.Wewillmakefulluseoftheinternalandouterfunctionstoenhancetheperformance-to-priceratio.Withfewimprovements,itcanbeproducedmassivelywithlowcostinpractice.3.TheLZC-CIHardwareDesign3.1TechnologyStandardsandCharacteristicsThemainfunctionofthecontrolleristocontrolthetemperature.Besidesthat,ithastorealizethefollowingfunctions:Todisplaythereal-timetemperatureofwater,therangeis0~99℃.Tosetthetemperatureofwaterarbitrarilywithin20~80℃.Havethefunctionofappointmentwhichenables24hourturningonsettingwillfully.HaveLTDtodisplayreal-timetemperaturedigitally.Whensetting,thetemperatureandthetimesetwillbedisplayedbyflickerandthecontrollerwillhaveinstructionsofappointment,heatpreservationandheating.Abletolookoverandrevisethetimeofsystem.Equippedwithremotecontroller,thecontrolwillbeeasyandsimple.Cutthepowerswiftlywhentemperatureistoohighandalarm.Whenelectricityleaks,cutthepowerswiftlyandproposealarming.Whenthepoweriscut,thedatasetcanbepreserved.3.2TheStructureoftheSystemThesystemconsistsoftwomainparts:themaincontrollerofwater-heaterandtheremotecontroller,realizedbytwopiecesof68hc908gr8respectively.3.2.1ThePowerSupplyandtheClockCircuitThepowercircuitconsistsofthetransformationbridge,therectificationbridge,thefilterresistance,thepressuresensitiveresistanceandintegrationvoltage-stabilizercircuitMC7812TandMC7805T,whichcanprovide+5Vandthe+12Vpowersourceforthecontroller.OutsideOSC1andOSC2,8kHzcrystaloscillatorisconnectedwiththecircuit.3.2.2TheKeyboardThefunctionofcontrollingandtheenactmentofparametersarerealizedbythepressingthekeys.Thetwokeysofthesystem’smaincontrollercompletedirectlythefunctionsofheatingandtheinquiringofthewaterlevel,usingthekeyboardseverancepatternandPTA2,PTA3astheinputentranceofthepressing.Thekeyboardoftheremotecontrollerisdesignedintomatrixtype.Thepressingofthekeyswillinitiatethekeyboardseverance,byscanningfromlinetoline;thenumberofthekeycanbejudgedandthensenttotheregisterforpreservationandthedelivering.Themainprocedurewilldealwithitinthekeyboardprocedureafterreceivingthenumberofthekey.Sincetherewillbevibrationatthemomentofturningonandoff,thedesignusessoftwaretimedelaytoeliminatethevibration.3.2.3TheDisplayCircuitConsideringthattheworkingenvironmentishumid,themaincontrollertakesLEDNixietubetodisplay.IttakesthemainwayofSPItoexpandtwopieceof74LS164astheoutputorificeofthestaticdemonstrationoftheseven-segmentdisplay.Whenthereisnopressing,themaincontrollerwilldisplaythecurrenttemperatureofwaterandtheremotecontrollerwilldisplaythecurrenttime;whensettingorinquiring,theremotecontrollerandmaincontrollerwillflashtodisplaytheinformationsetorinquiredwhilewhenstoppingpressing,thedisplaywillautomaticallybacktonormal.3.2.4TheReal-timeTemperatureofWaterandtheCircuitofWater-LevelDetectingThethermistorwilltransmitthetemperatureinformationintothevoltageinformationandthenwillbeinputintoCPUbythePTB0A/Dtransformationmodule.Afterchecking,thereal-timetemperaturewillbededuced.Thecircuitofwater-leveldetectingconsistsoftheparallelconnectionofthreeresistanceswithdifferentresistancevalue.Theelectricityoftheelectrodeissmall(onlyseveralmicroamperes),thustheerosionislittlewhichsuitsthewiderangevarietyoftheresistanceofwater(10K一100KO).Whenthewateroflevelofcertainresistancedoesn’tarrivewheretheresistanceis,theresistancewillnotwork;whenthewater-levelarrives,thethreeresistancesarelinkedintoparallelconnection.Theinformationofwater-levelcanbejudgedbytransformingvoltagesfromdifferentresistancesthroughPTB13.2.5TheDetectingofElectricityLeakingandAlarmingCircuitSincetheworkingenvironmentofwater-heaterishumid,thecontrollershouldbeabletodetecttheelectricityleakingtoensurethesafetyoftheuser.Undernormalcircumstance,theelectriccurrentpassingthemagneticcircleisthesamebutwithoppositedirections.Themagneticdetectingcirclewouldn’tsenseanysignalofelectriccurrentandtheintegratedcircuitofelectricityleakingdetectingwilloutputlowelectriclevel.Whentheelectriccurrentleaks,theelectriccurrentpassingthemagneticcircleislopsided.ThedetectingcircuitwilldetectthesignalofelectricityleakingandmagnifytheelectricleveloutputthroughtheintegratedcircuitM54123LandthenwillbeoutputintoCPUafterinvertingbyaudion.Receivingthesignalofelectricityleaking,theCPUwillstopheatingandpreservationandtheoperationofkeyboards,endstheoperationandsendsalarmingsignal.Theelectricitylightwillflickertowarnandthebuzzerwillbuzzcontinuously.Generallyspeaking,CPUwillsendoutareliablepulseforleakingprotectionevery10mstoreplacetheordinarydetectingswitchandcontroltheconnectionofcrystaltube.Sotheelectriccurrentpassingthemagneticcircleislargerthan10MA,whichwillbedetectedbythedetectingmagneticcircleasstimulantsignalforleaking,magnifiedbyM54123LandinvertedbyaudionandthenoutputtoCPU.CPUwilljudgewhetherthedetectioniseligible.Ifthereissignal,thedetectioniseligibleandcangoonworking;ifthereisnosignal,thedetectionisnoteligibleandheating,preservationandkeyboardoperationswillstopautomatically.CPUwillendwholeoperationsandsendoutalarm.Thelightforpowerwillflickertowarnandthebuzzerwillbuzzcontinuouslytoensurethesafeuseoftheelectricwater-heater.Whentheleakingdetectionprotectionanddetectionarenoteligible,wehavetoturnoffthepower,obviatetheobstacles,switchonagainandthenthewater-heaterwillwork.3.2.6TheProtectionCircuitWhenHeatingandRelayAreOutofControlUndernormalworkingconditions,thetworepayscancarryondouble-poleseparationofpowertoensurethatwhenheatingstops,theheatingsystemiscompletelyisolatedfromtheelectricityoutside.Itisalmostimpossiblefortworelaytohaveascrewloosesimultaneously,however,duringthenormallifeofelectricwater-heater,itispossiblethatonerelaywillhaveascrewloose.Ifitisnotdealtwithintime,theotherrelaywillpossiblyhavethesameproblemlaterwhichmayresultrealdanger.Sothekeytosolvethisproblemisthatthesystemcandetectassoonasonerelayhasproblemsandcanrelayontheothernormalrelaytocarryontheprotectionmeasuresofthesystemanddetectthestickinganddisconnectionofthetworelays.3.2.7TheRemoteControllerTheremotecontrollerutilizessimplecontrollingcircuitwhichdoesn’tdecreasethefunctions.Somehardwarecircuitswillberealizedbysoftwareandtheinterferenceresistinghasbeenconsidered.Sincethesupplyforbutteryhastosaveenergy,theremotecontrollerusesthelow-consumptionmodel.Whenthesystemisnotworking,itstops.Whenitbeginsworking,onehastousethekeyboardsignaltoendthelow-consumptionmodelandturnintonormal(pressthekeytoevokethesystem).ThelowvoltageresettingcanbeachievedbyMC34064.ThekeyboardisdesignedintomatrixtypewithtwolinesandhasconnectedbyPTA0~PTA3orifice.Whensetforkeyboard,thepressingofkeyboardwillresulttothestopping,makingthesystembacktonormal.Thecrystaloscillatoris6MHZ.Theinfraredsignaloutputusesthesoftwareencodingmethod.Thesoftwareofthemaincontrollerwilldecode.Inordertoreducecost,LCDdisplayisused.4543driveanddecodingusedfordriving.4.TheSoftwareDesignThewholeprogramsconsistofthemainprogram,serviceintermittingprogramandnumeroussubprogramoffunctionalmodel.Amongthem,themainprogramincludesthetransmittingsubprogram(thelevelandtemperatureofwater),subprogramofkeyboarddealinganddisplaying,subprogramofheatingcontrolling(thefunctionofoutputcomparisonisused),subprogramofinfraredsignalreceiving,thesubprogramofleakingandburningprotection,subprogramofcalendricclockoftheTBMmodule,subprogramofdata-preserving,subprogramfordelaying,etc.Theintermittingincludestimeintermitting,keyboardinputtingintermitting,TIMinputtingintermitting,TBMmoduleintermitting,etc.Theprogramsofremoteincludessubprogramofpressingdealing,subprogramofinfraredsignalsending,subprogramofLCDdisplaying,subprogramofcalendricclockoftheTBMmodule.4.1TheMainProgramThemainprogramhastoinitializetheworkingparametersofthesystem,mainlythatofCPUtimer,COPmodule,A/Dtransforming,theintermittingofkeys,etc.Later,themainprogramalternativelyusesthesubprogramsofeachfunctionalmodule.Thedealingtherelativeincidentsreliesontheflagbitandthejudgmentofflagbit.4.2ThesubprogramofkeyboarddealinganddisplayingThisprogramismainlydesignedtojudgetheelectricleveloftheorificeI/O.whenthekeysarepressed,thekeyboardisinastaticstate,whilewhenstoppingpressing,relativedealingswillbecarriedon.Whensettingandinquiring,thekeyswillflickertodisplaytheresultofsettingandinquiring,orthereal-timetemperatureofwaterisdisplayed.4.3TheSubprogramofHeatingControllingThisprogramisusedtojudgewhetherthereisappointmentandheatingandtodealwithitaccordingtotheprocedures.Toavoidthefrequentstartingoftheheatingwire,theheatingcontrollingadoptsthehystereticerrorcontrolling.Whenheatingstops,theheatingwirewillstartworkonlywhenthereal-timetemperatureofwaterislowerthanthetargettemperatureforsomedistance.Therearetwokindsofheatingtosatisfydifferentpowers:rapidheatingandordinaryheating.Innormalandappointment,ordinaryheatingisusestocontrolthepowerofelectricity.4.4TheSubprogramofRemoteSignalDealingSending:pressthekeywithremotecontroller,settheflagbit,getthenumberofthekeythroughdynamicscanningandsendthecodingbyoutputcomparisonaccordingtotheflagbitandthenumberofthekey;Receiving:getthesignalbyinputcatching,settheflagbitandreadthenumberofthekeyandsubmittomainprogramtodealwith.4.5TheSubprogramforDelayingThewholesystemwouldusethesubprogramfortiminganddelayinginmanysituations,likewhenthekeyboardjudgestoeliminatevibration,thedisplayofflickerandfadingdisplay,inputcatchingandcalendricclock,etc.4.6TheprotectionSubprogramInnormalsituation,theleakingdetectionwilloutputlowelectriclevel.Oncetheelectricityleaks,theelectricityoutputishighandwillbecutoff.Thewholecircuitofpowerwillbecutoffassoonaspossiblebytheprotectioncircuittoensurethesafetyoftheuser.Whenthetemperatureistoohighortoolow,theheatingwillbeturnedoffautomaticallyandthebuzzerwillbuzztowarn.5.TheExtensionoftheDesignWiththedevelopmentofinformationtechnology,intelligentdomesticapplianceswillgraduallystepintofamilies.Basedonthisdesign,makinguseoftheresourcesof68HC908GR8andSCIandUSBmoduletoconnectdomesticapplianceswithcomputerandinternetbytelephonewire,theycanbecontrolledfromlong-distance,thusmakinglifeeasyandconvenient..智能家用电热水器控制器1.应用前景热水器是一种可供浴室,洗手间及厨房使用的家用电器。目前市场上热水器主要品种有:电热水器、太阳能热水器、燃气热水器。就中国的具体情况而言,由于太阳能热水器的使用受天气原因的限制,使用范围狭窄,燃气热水器由于以石油、天然气为燃料,而燃料供应量又难以满足人们日益增长的需求,且不利于环境,因此电热水器越来越受到消费者的青睐。根据中国商业联合会前不久的统计,电热水器的市场份额在销售数量和销售收入两个方面都已经超过了长期以来占优势的燃气热水器。该中心预计,在城市电网更大范围改造和城市住房市场大规模启动的带动下,今后几年我国电热水器市场将呈现强劲增长势头。2.设计目标目前市场上的电热水器有两种,连续水流式和贮水式。由于考虑到热水器的潮湿的工作环境对单片机的特殊要求,我们采用了摩托罗拉新推出MC68HC08系列的单片机作为控制中心。它具有抗干扰能力强,工作可靠稳定,自带flash闪存等特点,完全满足高性能的电热水器的控制要求。同时考虑到家电业的激烈竞争,节约生产成本,我们用尽量简单的器件实现这些功能,并充分利用内外围功能,以提高产品的性价比,稍加改进,便能以较低成本应用于实际批量生产中。3.LZC-CI硬件设计3.1技术指标及特点:控制器的最主要目的是对水温进行控制,除此之外还实现下述功能:实时显示水温,范围为0~99可在20~80℃具有预约功能,24h任意设定开机时间具有LED数码显示实时温度,进行设定操作时闪烁显示设定水温、时间,并有预约、保温/加热指示可随时察看和校正系统时钟配有遥控器,控制更加简单方便超温断电保护并报警功能出现流故障时,迅速切断电源并提示报警功能系统断电能保护设定数据3.2系统结构系统分两个主要部分:热水器主控制器与遥控器,采用两片68hc908gr8分别实现。3.2.1电源与时钟电路。电源电路由变压桥、整流桥、滤波电阻、压敏电阻和集成稳压电路MC7812T及MC7805T组成,可为控制器提供+5V和+12V电源。OSC1,OSC2外接8kHz晶体振荡器。3.2.2键盘。控制器的功能及参数设定都是通过按键来实现,本系统主控制器两个按键完成直接加热及查询水位的功能,采用键盘中断模式,PTA2,PTA3作为按键的输入口。遥控器键盘采用矩阵式,当有按键按下是引发键盘中断,通过逐行扫描判断所按键号,送寄存器保存并发送,主程序接收到键号后在键盘处理程序中进行处理。机械式开

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论