嵌入式系统的智能饮水机系统
摘要:采用单总线温度传感器DSI.VIIIBII0测量饮水机的实时温度,通过时钟芯片DSI.III0II提供日历和时间,并通过LCDI.IIVIIIVIIV显示日历和时间以及当前温度值,该系统是微控制器STCVIIIIXCVII设计的.该系统的整体设计理念,硬件电路和软件流程设计,加工和使用拟合算法的温度误差已被证明.该系统具有这样的功能,如远程控制,温度控制,冷却,变功率加热,具有安全,稳定,智能控制和低功耗的高水平.
I..引言
随着经济和社会进步的快速发展,家电已发展走向数字化,智能模式功能多样化.I.般来说,目前国内I.般饮水机系统具有加热和保温功能,其中许多已达到控制与模拟电路.不过,也有许多不足的模拟电路.首先,模拟电路总是受到外部环境因素影响,如电磁波和温度;第II,其控制精度是如此之低,沸点和隔热只能在特定的温度(用户不能设置的值)来实现;第III,它可以产生高功率消耗.例如,在保温状态下,功率可以达到IV0~V0W;此外,它是不容易升级和扩展的模拟电路系统.
单片机的温度监测和控制,然而,适用于实际生产,I.般情况下,为了实现过程控制的自动化,智能化和精度高,MCV的智能温控饮水机系统,不仅可避免模拟电路的大多数缺陷,而且还具有低功耗,稳定性好,自动化程度高.它的应用具有相当的优势和推广空间.总之,饮水机智能系统与数字化,智能化,节能技术,人性化,以及潮流的现代概念是I.致的.
II.系统程序设计
A.该 *好棒文|www.hbsrm.com +Q: ¥3^5`1^9`1^6^0`7^2$
系统设计理念
该系统的整体设计方法是:为了利用温度传感器DSI.VIIIBII0用于进行采样的供热水箱的实时温度,样品值取到MCU进行处理,数据拟合,误差校正,数字滤波.时间和日历数据,从DSI.III0II时钟芯片也考虑到MCV进行处理.遥控器或键盘用于输入设定值,选择加热至沸与否"和设置工作模式"(包括IV种型号,即冷却,关闭,保温和加热).该组合继电器实现模式切换.在同时,该系统还可以设置遥控器或键盘来调整时间和日历.在智能模式下,系统保持水温在设定值,并寻求实现节能,在正常工作状态(相对于设定状态),液晶I.IIVIIIVIIV显示当前的时间,日期,实时采样值和运行模式.根据遥控器或键盘的快捷键,我们可以让当前的工作模式切换到另I.种操作模式,并启动I.个小的自动水泵,此外,在设置状态下,我们还可以设置你打开加热器自启动",自动启动时间"和后设置值".
系统的主要性能指标有:(I.)温度变化范围在I.VII~IX0℃,最小变化温度为I.℃;(II)LCDI.IIVIIIVIIV显示实际样品温度,显示范围:0~I.00℃;最小变化为0.I.0℃;(III)控制精度:<=III℃.
B.系统解决方案
该系统是VIIIIXCVII单片机,设定水温信号采集,工作状态检测,温度和误差修正值,拟合算法.控制算法和控制方案的优化是数字控制系统中的I.个应用.与此同时,该系统包括了I.个友好的人机接口,以及I.个设置菜单,简单易懂.该系统由以下功能模块:时钟模块,电源模块,小型水泵控制模块,红外遥控控制模块,显示模块,键盘设置模块,温度采集,制冷模块和所述加热模块.系统的示意图示于图I..
图I系统解决方案图
C.创新点和特色化
(I.)在本系统中,有IIII0V交流高电压以及I.IIV和VV的直流低电压.因此,我们必须采取它的安全性和稳定性考虑,为安全起见,本系统采用I.IIV驱动极继电器来控制交流IIII0V的高电压,再加上I.个单极继电器开关作为电源的选择.其结果是,该系统不仅可以确保安全(该系统是完全关闭截止状态IIII0V交流电源),而且还采用了两级功率控制.(II)红外接收头HS00IIIVIIIVIII已被采纳,而万能遥控器也已配置.通过制备相关的软件,远程智能控制可以在系统中实现.(III)外部中断0按钮是用来实现各种操作模式之间快速切换.
III.系统硬件设计
主模块接口电路的概况提供如下;
电源模块主要有以下两个部分:(I.)I.IIV的直流电压被提供作为系统的输入功率,也可作为水泵的驱动电压;VIIVIII0V电压转换芯片被用于提供VV的直流电压为系统的微控制器和其他周边设备.(II)IIII0V交流电压获得进入供热管线.这种策略可以采用MCU来实现灰度分级控制继电器,从而使MCU能够控制加热堆在分电Ievel工作或完全关闭.
小泵控制模块由两部分组成:(I.)为了实现遥控水控机,它采用了继电器为小泵的控制开关.(II)加入I.键切换为泵控制实现手动控水.
键盘设置模块:X个按键已经被设计为了实现设置和控制功能.其中VIII个是设置按钮,可以采用系统设置.也有两个独立的按钮,其中之I.可以控制泵,另外I.个是模式切换按钮.
温度采集模块:操作系统DSI.VIIIBII0作为温度传感器.从温度传感器获取温度值的方法很简单,它并不 *好棒文|www.hbsrm.com +Q: ¥3^5`1^9`1^6^0`7^2$
需要I.个A/D转换器.如果从DSI.VIIIBII0的温度数据被送到微控制器进行处理,则数据可以被显示出来.
冷却模块:安装I.个小电扇,为了实现智能控制和继电器来控制风扇的工作.
加热模块:IIII0V交流电压电源提供给加热管是由双级继电器控制.加热管有III种工作状态:关机状态下,大功率(VII00W)的工作状态,以及低功耗(IV0W)工作状态.此外,所述恒定温度的值,有多种工作模式,可以切换智能地使该系统可以实现低功耗和智能自动化.
显示模块:LCDI.IIVIIIVIIV作为人机交互界面.在这种正常的接口,LCDI.IIVIIIVIIV显示当前的时间,日期,水温和当前的工作实践.在设置界面,LCDI.IIVIIIVIIV显示设置菜单和提示.
红外遥控模块:HS00IIIVIIIVIII用于从远程接收信息,并设置适当的处理程序,这样我们就可以通过远程设置系统.
时钟模块:该模块采用的DSI.III0II时钟芯片,它产生的时间和日期,提供了时间控制信号,如饮水机的自动启动时间.当系统处于关机状态时,时钟也是在掉电状态下运行,因为外部纽扣电池提供时钟芯片的电流.当系统再次启动时,显示当前时间.
IV.系统软件设计
A.主要的系统软件设计流程.
系统软件包括许多任务有待解决的.该系统软件的主流程图如图II所示.
(I.)初始化该系统.这部分主要完成中断的相关寄存器的配置,并且还初始化全局变量,如OSI.III0II,LCDlIIVIIIVIIV等.
(II)阅读作业系统I.III0II和处理数据.在这部分的程序,主要任务是模拟DSI.III0II的读写时序,配置相关的寄存器,读它的日期和时间值,然后将日期和时间值转换成ASCII码来实现显示.
(III)温度采集和处理收集的数据.使DSI.VIIIVIIIII0可以重置和读取获得的数据的值,处理所收集的数据并将其转换成ASCII码来实现显示.
(IV)要确定菜单按钮被按下或没有".如果按下,LCDlIIVIIIVIIV转移到设置菜单界面的状态.在菜单界面有III个选项.它们是建立时间",设定温度值",设置启动时间".
(V)要确定是否有中断请求".他们被转移到中断处理.中断处理主要包括外部中断INTO和INTI,这是模式切换处理和红外接收中断处理,否则,该计划的实施遵循原来的顺序.
(VI)确定水按钮是否按下".有I.个小水泵通过继电器自动打开水阀.否则,该方案的实施遵循原来的顺序.
(VII)温度控制相关的处理.该系统主要是设置,采样值和其他变量.为了达到合适的温度和智能控制系统,该系统采用优化算法.
(VIII)正常显示状态.液晶显示屏主要显示日期,当前时间,当前温度值和当前工作模式.
图II本软件的主流程图
B.设置处理
菜单上有两个接口.万能遥控器按钮可以取代另I.个人,以及互动式的使用.因此,通过遥控器,上面的菜单设置也可以完成.流程图的设置状态示于图III.
图III.设置处理的流程图
V.温度误差处理和拟合算法的应用
A.温度误差处理
温度误差主要产生是由于传感器对温度敏感性差,温度传感器和水箱之间的不良接触等.为了消除不可避免的错误时,系统工作在VIIV0W的功率加热,同时,真值和样本值记录在表I.和表II.
表I..真阀门和采样值
表II.真值与采样值
B.拟合算法分析与应用
根据在表I和表II中的数据,实际温度值和采样值之间的关系的曲线被绘制如下图IV.
表IV.真实的温度值与采样值之间的关系
假设真实温度为T诱饵,以及样品的温度值为T的样本.我们有:
Tsample=0.IXIVxTtruc-I.I..0
VI.结论
我们知道,现代电子技术在不断发展,并与社会不断变化的需求息息相关.它带来了很多智能化特性的产品,.它为人们创造了I.个舒适,和谐,高质量的生活.本设计采用经典的低成本微控制器作为微控制器,饮水机系统的设计具有界面友好,节能的特点,也很聪明.为了使系统准确,其功耗低,我们努力优化软件的I.部分.由于不可避免的温度误差,本系统采用软件滤波,如限幅滤波器,
算术平均值滤波.为了达到降低或消除误差的目的,提高控制精度,线性回归也被施加到该项目.
参考文献
[I]Garside,J.o,"Amicrocomputerinterfacinglaboratory".International
JournalofElectricalEngineeringEducation,January(II00III),vIV0,pI.III-IIVI
[II]F.Reverter,M.GasullaandR.Palhls-Areny,Analysisofpower-supply
interferenceeffectsondirectsensor-to-microcontrollerinterfaces,IEEE
Trans.Instrum.Meas.VVI(I.)(II00VII),pp.lVIII.-I.VIIVII.
[III]E.Sifuentes,O.Casas,F.ReverterandR.Pallils-Areny,Improveddirect
interfacecircuitforresistivefull-andhalf-bridgesensors,Fourth
InternationalConferenceonElectricalandElectronicsEngineering
ICEEEMexico,September(II00VII),pp.I.IXVII-II00.
[IV]MaximDSI.VIIIBII0ProgrammableResolutionI-WireDigital
Thermometer[EB/OL].http://www.maxim-ic.com/
[V]M.Glenewinkel,Systemdesignandlayouttechniquesfornoise
reductioninMCU-basedsystems.MicroprocessorandMicrosystemsII0
V(I.IXIXVI),pp.III0III-III0IX.
[VI]D.Campbell,Defensivesoftwareprogrammingwithembedded
microcontrollers,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VII]M.J.Pont,R.Kureemun,H.L.R.Ong,W.Peasgood,Increasingthe
reliabilityofembeddedautomotiveapplicationsinthepresenceofEM!:
apilotstudy,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VIII]N.Zhang,G.Fan,K.H.Lee,GJ.KluitenbergandT.M.Loughin,
Simultaneousmeasurementofsoilwatercontentandsalinityusinga
frequency-responsemethod,SoilSci.Soc.Am.I..VIVIII(II00IV),pp.I.VI.V-
I.VIIV.
[IX]ADuCVIIIIVVMicroConverterMultichannelIIIV-/I.VI-bitADCswith
EmbeddedVIIIkBFlashandSingle-CycleMCU,Datasheets,Analog
Devices.http://www.analog.com/UploadedFiles/DataSheets/I.IVIIII.VIIIIIIVIVIV
ADuCVIIIIVV_VII_VIII_b.pdf,II00IV.
[I.0]NathanM.NeihartandReidR.Harrison,Micropowercircuitsfor
bidirectionalwirelesstelemetryinneuralrecordingapplications,IEEE
Trans.Biomed.Eng.VII(II00V),pp.I.IXV().....I.IXVIX.
[II]W.Mokwa,Ophthalmicimplants,ProceedingsoftheIEEESensors
(II00III),pp.IXVIII().....IXVIIIVI.
[I.II]I..W.Valvano,EmbeddedMicrocomputerSystems-RealTime
Interfacing,Brooks/ColeThomsonLearningII000.
[I.III]M.Gonzalez,F.Axisa,M.VandenBulcke,D.Brosteaux,B.
VandeveldeandI..Vanfleteren,Designofmetalinterconnectsfor
stretchableelectroniccircuitsusingfiniteelementanalysis,Proceedings
oftheVIIIthInternationalConferenceonThermal,Mechanicaland
MultiphysicsSimulationandExperimentsinMicro-Electronicsand
Micro-Systems,EuroSimE(II00VII).
[I.IV]MaximDSI.III0IITrickle-ChargeTimekeepingChip
[EB/OL].http://www.maxim-ic.coml
附件II:外文原文(复印件)
IntelligentWaterDispenserSystemBasedon
EmbeddedSystems
JinhuangHuang,JunXie*
DepartmentofElectricalEngineering,JinanUniversity,GuangzhouVI.0VIIIIII,P.R.China
huangjinVIIII@I.VIIII.com
Abstract_Usingsingle-bustemperaturesensorDSI.VIIIBII0tomeasurereal-timetemperatureofthedrinkingfountains,providingcalendarandtimethroughclockchipDSI.III0II,receivinginformationfromtheremotethroughHS00IIIVIIIB,anddisplayingthecalendarandtimeaswellasthecurrenttemperaturevaluethroughLCDI.IIVIIIVIIV,thesystemwasdesignedbasedonmicrocontrollerSTCVIIIIXCVII.Thesystemsoveralldesignconcept,thehardwarecircuitandsoftwareflowchartanddesign,temperatureerrorofprocessingandtheuseoffittingalgorithmhavebeendemonstrated.Thesystemhassuchfunctionsasremotecontrol,temperaturecontrol,cooling,variablepowerheating,withahighlevelofsafety,stability,intelligentcontrolandlowpowerconsumption.
I.INTRODUCTION
Withtherapiddevelopmentofeconomyandprogressofsociety,thehouseholdapplianceshavebeendevelopedtowardsdigitalization,functionaldiversificationwithintelligentmode[I.-III].Generallyspeaking,thecurrentgeneraldomesticwaterdispensersystemshavefunctionsofheatingandheatinsulation,manyofwhichhaveachievedtheircontrolwithanalogcircuits.However,therearemanydeficienciesinanalogcircuits.Firstly,analogcircuitsarealwaysaffectedbyexternalenvironmentfactors,suchaselectromagneticwavesandtemperature;secondly,theircontrolaccuracyissolowthatboilingandheatinsulationcanonlybeachievedataspecifictemperature(Userscannotsetthevalue);thirdly,itcangiverisetohighpowerconsumption.Forexample,ininsulatingstate,thepowercanreachIV0~V0W;Moreover,itisnoteasytoupgradeandexpandtheanalogcircuitsystem.Microcontroller-basedtemperaturemonitoringandcontrolling,however,applytotheactualproduction.Generally,inordertoachieveprocesscontrolinautomation,intelligentfunctionsandhighprecision,theMCV-basedsmarttemperaturecontrolwaterdispensersystem,notonlycouldavoidmostdefectsofanalogcircuits,butalsohavelowpowerconsumption,perfectstability,andhighdegreeofautomation.Itsapplicationhasaconsiderableadvantageandpromotionofspace.Inaword,thewaterdispensersmartsystemisconsistentwiththemodemconceptofthedigital,intelligent,energy-savingtechnology,humanity,aswellasthetrend.
II.SYSTEMPROGRAMDESIGN
A.DesignConceptofTheSystem
Theoveralldesignmethodologyofthesystemis:TomakeuseoftemperaturesensorDSI.VIIIBII0[IV]forsamplingthetemperatureoftheheatingwatertankinreal-time,andthesamplevalueistakentoMCU[V-I.III]forprocessing-Datafitting,errorcorrection,digitalfiltering.ThetimeandcalendardatawhicharefromDSI.III0II[I.IV]clockchiparealsotakentoMCVforprocessing.Theremotecontrolorkeyboardisusedtoinputsettingvalue,choose"Heatedtoboilingornot"and"settheoperatingmode(includingIVmodelsnamely,cooling,closing,insulationandheating).Thecombinatorialrelaysachievemodeswitching.Atthesametime,thesystemcanalsosettheremotecontrolorkeyboardtoadjusttimeandcalendar.Inintelligentmode,thesystemkeepsthewatertemperatureonsettingvalue,andseektoachieveenergysaving.Inthenormalworkingstate(Relativetothesettingstate),LCDI.IIVIIIVIIVdisplaysthecurrenttime,date,real-timesamplevaluesandoperatingmodes.Dependingonashortcutofremotecontrolorkeyboard,wecouldletcurrentoperatingmodeswitchtoanothermodeofoperation,andstartasmallautomaticwaterpump.Inaddition,inthesettingstate,wecanalsoset"Doyouopentheheaterself-starting","Automaticstart-uptime"and"Post-setvalue".
Systemsmainperformanceindicatorsare:(I.)thesettingrangeofconstanttemperature:I.VII~IX0℃,MinimumdifferentiationisI.℃;(II)LCDI.IIVIIIVIIVdisplaystheactualsampletemperature,displayrange:0~I.00℃;minimumdifferentiation:0.I.℃;(IV)controlaccuracy:<=III℃
B.SystemSolutions
ThissystemisbasedonVIIIIXCVIIMCU,settingthewatertemperaturesignalacquisition,workingstatedetection,temperatureandthevalueoferrorcorrection,fittingalgorithmandtheapplicationofcontrolalgorithmsandcontrolprogramoptimizationasoneofthedigitalcontrolsystems.Atthesametime,thesystemhasincludedafriendlyman-machineinterface,aswellasasetupmenuwhichiseasytounderstand.Thesystemconsistsofthefollowingfunctionalmodules:theclockmodule,thepowermodule,thecontrolmoduleofsmallwaterpump,thecontrolmoduleofinfraredremotecontrol,thedisplaymodule,thekeyboardsetupmodule,themoduleoftemperatureacquisition,thecoolingmoduleandtheheatingmodule.ThediagramofsystemisshowninFigI..
FigISystemSolutionDiagram
C.InnovationPointandDistinctiveFeatures
(I.)Inthissystem,thereisIIII0VAChighvoltageaswellasI.IIVandVVDClowvoltage.Sowehavetotakeitssecurityandstabilityintoconsideration.Forsafetyssake,thesystemusestheI.IIV-drivenpolerelaytocontrolIIII0VAChighvoltage,coupledwithasingle-polerelayswitchasachoiceofthepower.Asaresult,thesystemnotonlyensuresthesafety(thesystemiscompletelyoffIIII0VACpowersupplyinitsoffstate),butalsoemploysatwo-stagepowercontrol.(II)TheinfraredreceiverheadHS00IIIVIIIVIIIhasbeenadopted,andtheuniversalremotecontrolalsohasbeenconfigured.VIIIypreparingtherelatedsoftware,remoteintelligentcontrolcanbeimplementedinthesystem.(III)Externalinterrupt0buttonisusedtoachieveaquickswitchbetweenthevariousoperatingmodes.
III.SYSTEMHARDWAREDESIGN
AnovervIewofthemainmoduleinterfacecircuitisprovided;
Powersupplymodulemainlyhasthefollowingtwoparts.(I.)I.IIVDCvoltageisprovidedasthesysteminputpower,alsoasawaterpumpdrivevoltage;TheVIIVIII0VvoltageconversionchipisusedtoconvertthemVVDCvoltageforthesystemmicrocontrollerandotherperipheralequipment.(II)IIII0VACvoltagegetsaccesstotheheatingpipelines.ThisstrategycanbeadoptedbyMCUtoachievehierarchicalcontrolrelaysingradation,sothattheMCUcouldcontroltheheatingpiletoworkinthesub-power-Ievelorshutdowncompletely.
Thesmallpumpcontrolmoduleconsistsoftwoparts.(I.)Inordertoachieveremotecontrolwatercontrol,itusesarelayasacontrolswitchofthesmallpump.(II)Addtoakeyswitchasthepumpcontrolforachievingmanualwatercontrol.
Keyboardsetupmodule:Tenkeyshavebeendesignedinordertoachievethesetupandcontrolfunctions.Eightofthemaresettingbuttons,whichcouldemploythesystemsettings.therearealsotwoindependentkeys,oneofthemcouldcontrolthepump.Ttheotherkeyismodeswitchingbutton.
Temperatureacquisitionmodule:OSI.VIIIVIIIII0isusedastemperaturesensor.Themethodofobtainingtemperaturevaluefromthetemperaturesensorisverysimple,whichdonotneedanA/Dconverter.IfthetemperaturedatafromDSI.VIIIVIIIII0istakentoMCUforprocessing,thenthedatacouldbedisplayed.
Coolingmodule:Asmallelectricfanisinstalled;Inordertoachieveintelligentcontrolandarelayisusedtocontrolthefanworking.
Heatingmodule:IIII0VACvoltagepowerissuppliedtoheatingpipewhichiscontrolledbythedouble-stagerelay.Theheatingpipehasthreeworkingstates:offstate,highpower(VII00W)workingstate,aswellasthelow-power(IV0W)workingstate.Moreover,basedonthevalueoftheconstanttemperature,avarietyofworkingmodescanbeswitchedintelligentlysothatthesystemcouldachievelowpowerconsumptionandintelligentautomation.
Displaymodules:LCDI.IIVIIIVIIVisusedasahumancomputerinteractioninterface.Undersuchnormalinterface,LCDI.IIVIIIVIIVdisplaysthecurrenttime,date,watertemperatureandthecurrentworkingpractices.undersettinginterface,
LCDI.IIVIIIVIIVdisplayssettingmenusandprompts.
Infraredremotecontrolmodule:HS00IIIVIIIVIIIisusedtoreceiveinformationfromtheremote,andtheappropriateproceduresfordealinghavebeenconfigured,sothatwecouldsetthesystemthrougharemote.
Clockmodule:ThemoduleusesDSI.III0IIclockchip,whichgeneratesthetimeanddate,offerscontrolsignaloftime,suchasautomaticstart-uptimeofthewaterdispenser.Whenthesystemispowered-off,theclockisalsorunningduringpower-downstatebecausetheexternalbuttonbatteriesprovidetheclockchipwithcurrent.Whenthesystemispoweredagain,thecurrenttimeisdisplayed.
IV.SYSTEMSOFTWAREDESIGN
A.TheMainSystemSoftwareDesignProcess.Systemsoftwareincludesanumberoftaskstobeaddressed.Themainflowchartofthesystemsoftwareis
showninFigII.
(I.)Initializethesystem.ThispartMainlyfinishesrelatedconfigurationregisteroftheinterrupt,andalsoinitializetheglobalvariables,OSI.III0II,andLCDlIIVIIIVIIVandsoon.
(II)ReadtheOSI.III0IIandprocessdata.Inthispartoftheprogram,themajortaskistosimulatethereadingandwritingtimingofDSI.III0II,configuretherelativeregisters,readitsdateandtimevalues,andthentransformthedateandtimevaluesintoASCIIcodetoachievedisplaying.
(III)Temperatureacquisitionandprocessthecollecteddata.MakeDSI.VIIIVIIIII0canresetandreadthevaluesoftheobtaineddata,processingthecollecteddataandtransformingitintoASCIIcodetoachievedisplaying.
(IV)Todeterminethe"menubuttonispressedornot".Ifpressed,LCDlIIVIIIVIIVistransferredtosettingstateofamenuinterface.Therearethreeoptionsinmenuinterface.Theyare"set-uptime","setthetemperaturevalue"and"setupsincethestart-uptime",
(V)Todetermine"whetherthereisaninterruptrequest".theyaretransferredtointerrupthandling.InterrupthandlingmainlyincludesexternalinterruptsINTOandINTI,whicharethemodeswitchingprocessingandinfraredreceiverinterrupthandling;Otherwise,theimplementationoftheprogram
followstheoriginalorder.
(VI)Todetermine"whetherthewaterbuttonpressed".Thereisasmallwaterpumpconnectedthroughtherelaytoautomaticallyopenwater.Otherwise,theimplementationoftheprogramfollowstheoriginalorder
(VII)Temperaturecontrol-relatedprocessing.Thesystemismainlybasedonsettings,sampledvaluesandothervariables.Inordertoachievetherighttemperatureandintelligentcontrolsystem,thesystemuseoptimizationalgorithms.
(VIII)Thenormaldisplaystatus.LCDmainlydisplaysthedate,currenttime,thecurrenttemperaturevalueandthecurrentworkmode.
FigIIMainFlowChartoftheSoftware
B.TheProcessingofSettings.
Themenuhastwointerfaces.Theuniversalremotecontrolbuttoncanbesubstitutedforonetoanother,aswellastheinteractiveuse.Therefore,throughtheremotecontrol,themenusettingsabovecouldbeabletobecompleted.SettingstateoftheflowchartisshowninFigIII.
IV
FigIIITheFlowChartofSettingProcessing
V.TEMPERATUREERROROFPROCESSINGANDTHEAPPLICATIONOFFITTINGALGORITHM
A.TemperatureErrorHandling.
Temperatureerrorarisesmainlyduetotherelativelypoortemperaturesensitivityofthesensor,thepoorconditioncontactbetweentemperaturesensorandwatertank,etc.Inordertoeliminatetheinevitableerrors,whilethesystemisworkinginVIIV0Wforpowerheating,truevaluesandsamplevaluesarerecordedinTABLEIandTABLEII,.
TABLEI.TRUEVALVESANDTHESAMPLEDVALUES
TABLEll.TRUEVALUESANDTHESAMPLEDVALUES
B.FittingAlgorithmAnalysisandApplication
AccordingtothedataintheTABLEIandTABLEII,ThecurvesoftherelationshipbetweentruetemperaturevaluesandsampledvaluesisdrawnasfollowsFigIV.
FigIVRelationshipbetweentruetemperaturevaluesandsampledvalues
AssumethatthetruetemperatureisTlure,andthesampletemperaturevalueisTsample.Wehave:
Tsample=0.IXIVxTtruc-I.I..0
VI.CONCLUSION
Asweknow,modemelectronictechnologyisdevelopingandupdatingwiththeapplicationofthechangingneedsofthesociety.Itbringslotsofproductswithhumanandintelligentfeatures.Italsocreatesacomfortableandharmonious,superiorqualityoflifeforpeople.Thisdesignusesclassiclow-costmicro-controllerasamicro-controller,awaterdispensersystemisdesigned,whichhasfriendlyinterface,energy-savingfeatures,andalsoisintelligent.Inordertomakethesystemaccurateanditspowerconsumptionlow,wemakeeffortstooptimizethesoftwarepart.However,becauseoftheinevitabletemperatureerror,thesystemusessoftwarefiltering,suchaslimitingfilter,arithmeticmeanfiltering.Inordertoachievethepurposeofreducingoreliminatingerrorsandimprovethecontrolprecision,thelinearregressionisalsoappliedtothisproject.
REFERENCES
[I]Garside,J.o,"Amicrocomputerinterfacinglaboratory".International
JournalofElectricalEngineeringEducation,January(II00III),vIV0,pI.III-IIVI
[II]F.Reverter,M.GasullaandR.Palhls-Areny,Analysisofpower-supply
interferenceeffectsondirectsensor-to-microcontrollerinterfaces,IEEE
Trans.Instrum.Meas.VVI(I.)(II00VII),pp.lVIII.-I.VIIVII.
[III]E.Sifuentes,O.Casas,F.ReverterandR.Pallils-Areny,Improveddirect
interfacecircuitforresistivefull-andhalf-bridgesensors,Fourth
InternationalConferenceonElectricalandElectronicsEngineering
ICEEEMexico,September(II00VII),pp.I.IXVII-II00.
[IV]MaximDSI.VIIIBII0ProgrammableResolutionI-WireDigital
Thermometer[EB/OL].http://www.maxim-ic.com/
[V]M.Glenewinkel,Systemdesignandlayouttechniquesfornoise
reductioninMCU-basedsystems.MicroprocessorandMicrosystemsII0
V(I.IXIXVI),pp.III0III-III0IX.
[VI]D.Campbell,Defensivesoftwareprogrammingwithembedded
microcontrollers,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VII]M.J.Pont,R.Kureemun,H.L.R.Ong,W.Peasgood,Increasingthe
reliabilityofembeddedautomotiveapplicationsinthepresenceofEM!:
apilotstudy,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VIII]N.Zhang,G.Fan,K.H.Lee,GJ.KluitenbergandT.M.Loughin,
Simultaneousmeasurementofsoilwatercontentandsalinityusinga
frequency-responsemethod,SoilSci.Soc.Am.I..VIVIII(II00IV),pp.I.VI.V-
I.VIIV.
[IX]ADuCVIIIIVVMicroConverterMultichannelIIIV-/I.VI-bitADCswith
EmbeddedVIIIkBFlashandSingle-CycleMCU,Datasheets,Analog
Devices.http://www.analog.com/UploadedFiles/DataSheets/I.IVIIII.VIIIIIIVIVIV
ADuCVIIIIVV_VII_VIII_b.pdf,II00IV.
[I.0]NathanM.NeihartandReidR.Harrison,Micropowercircuitsfor
bidirectionalwirelesstelemetryinneuralrecordingapplications,IEEE
Trans.Biomed.Eng.VII(II00V),pp.I.IXV().....I.IXVIX.
[II]W.Mokwa,Ophthalmicimplants,ProceedingsoftheIEEESensors
(II00III),pp.IXVIII().....IXVIIIVI.
[I.II]I..W.Valvano,EmbeddedMicrocomputerSystems-RealTime
Interfacing,Brooks/ColeThomsonLearningII000.
[I.III]M.Gonzalez,F.Axisa,M.VandenBulcke,D.Brosteaux,B.
VandeveldeandI..Vanfleteren,Designofmetalinterconnectsfor
stretchableelectroniccircuitsusingfiniteelementanalysis,Proceedings
oftheVIIIthInternationalConferenceonThermal,MechanicalandMultiphysicsSimulationandExperimentsinMicro-Electronicsand
Micro-Systems,EuroSimE(II00VII).
[I.IV]MaximDSI.III0IITrickle-ChargeTimekeepingChip
[EB/OL].http://www.maxim-ic.coml
I..引言
随着经济和社会进步的快速发展,家电已发展走向数字化,智能模式功能多样化.I.般来说,目前国内I.般饮水机系统具有加热和保温功能,其中许多已达到控制与模拟电路.不过,也有许多不足的模拟电路.首先,模拟电路总是受到外部环境因素影响,如电磁波和温度;第II,其控制精度是如此之低,沸点和隔热只能在特定的温度(用户不能设置的值)来实现;第III,它可以产生高功率消耗.例如,在保温状态下,功率可以达到IV0~V0W;此外,它是不容易升级和扩展的模拟电路系统.
单片机的温度监测和控制,然而,适用于实际生产,I.般情况下,为了实现过程控制的自动化,智能化和精度高,MCV的智能温控饮水机系统,不仅可避免模拟电路的大多数缺陷,而且还具有低功耗,稳定性好,自动化程度高.它的应用具有相当的优势和推广空间.总之,饮水机智能系统与数字化,智能化,节能技术,人性化,以及潮流的现代概念是I.致的.
II.系统程序设计
A.该 *好棒文|www.hbsrm.com +Q: ¥3^5`1^9`1^6^0`7^2$
系统设计理念
该系统的整体设计方法是:为了利用温度传感器DSI.VIIIBII0用于进行采样的供热水箱的实时温度,样品值取到MCU进行处理,数据拟合,误差校正,数字滤波.时间和日历数据,从DSI.III0II时钟芯片也考虑到MCV进行处理.遥控器或键盘用于输入设定值,选择加热至沸与否"和设置工作模式"(包括IV种型号,即冷却,关闭,保温和加热).该组合继电器实现模式切换.在同时,该系统还可以设置遥控器或键盘来调整时间和日历.在智能模式下,系统保持水温在设定值,并寻求实现节能,在正常工作状态(相对于设定状态),液晶I.IIVIIIVIIV显示当前的时间,日期,实时采样值和运行模式.根据遥控器或键盘的快捷键,我们可以让当前的工作模式切换到另I.种操作模式,并启动I.个小的自动水泵,此外,在设置状态下,我们还可以设置你打开加热器自启动",自动启动时间"和后设置值".
系统的主要性能指标有:(I.)温度变化范围在I.VII~IX0℃,最小变化温度为I.℃;(II)LCDI.IIVIIIVIIV显示实际样品温度,显示范围:0~I.00℃;最小变化为0.I.0℃;(III)控制精度:<=III℃.
B.系统解决方案
该系统是VIIIIXCVII单片机,设定水温信号采集,工作状态检测,温度和误差修正值,拟合算法.控制算法和控制方案的优化是数字控制系统中的I.个应用.与此同时,该系统包括了I.个友好的人机接口,以及I.个设置菜单,简单易懂.该系统由以下功能模块:时钟模块,电源模块,小型水泵控制模块,红外遥控控制模块,显示模块,键盘设置模块,温度采集,制冷模块和所述加热模块.系统的示意图示于图I..
图I系统解决方案图
C.创新点和特色化
(I.)在本系统中,有IIII0V交流高电压以及I.IIV和VV的直流低电压.因此,我们必须采取它的安全性和稳定性考虑,为安全起见,本系统采用I.IIV驱动极继电器来控制交流IIII0V的高电压,再加上I.个单极继电器开关作为电源的选择.其结果是,该系统不仅可以确保安全(该系统是完全关闭截止状态IIII0V交流电源),而且还采用了两级功率控制.(II)红外接收头HS00IIIVIIIVIII已被采纳,而万能遥控器也已配置.通过制备相关的软件,远程智能控制可以在系统中实现.(III)外部中断0按钮是用来实现各种操作模式之间快速切换.
III.系统硬件设计
主模块接口电路的概况提供如下;
电源模块主要有以下两个部分:(I.)I.IIV的直流电压被提供作为系统的输入功率,也可作为水泵的驱动电压;VIIVIII0V电压转换芯片被用于提供VV的直流电压为系统的微控制器和其他周边设备.(II)IIII0V交流电压获得进入供热管线.这种策略可以采用MCU来实现灰度分级控制继电器,从而使MCU能够控制加热堆在分电Ievel工作或完全关闭.
小泵控制模块由两部分组成:(I.)为了实现遥控水控机,它采用了继电器为小泵的控制开关.(II)加入I.键切换为泵控制实现手动控水.
键盘设置模块:X个按键已经被设计为了实现设置和控制功能.其中VIII个是设置按钮,可以采用系统设置.也有两个独立的按钮,其中之I.可以控制泵,另外I.个是模式切换按钮.
温度采集模块:操作系统DSI.VIIIBII0作为温度传感器.从温度传感器获取温度值的方法很简单,它并不 *好棒文|www.hbsrm.com +Q: ¥3^5`1^9`1^6^0`7^2$
需要I.个A/D转换器.如果从DSI.VIIIBII0的温度数据被送到微控制器进行处理,则数据可以被显示出来.
冷却模块:安装I.个小电扇,为了实现智能控制和继电器来控制风扇的工作.
加热模块:IIII0V交流电压电源提供给加热管是由双级继电器控制.加热管有III种工作状态:关机状态下,大功率(VII00W)的工作状态,以及低功耗(IV0W)工作状态.此外,所述恒定温度的值,有多种工作模式,可以切换智能地使该系统可以实现低功耗和智能自动化.
显示模块:LCDI.IIVIIIVIIV作为人机交互界面.在这种正常的接口,LCDI.IIVIIIVIIV显示当前的时间,日期,水温和当前的工作实践.在设置界面,LCDI.IIVIIIVIIV显示设置菜单和提示.
红外遥控模块:HS00IIIVIIIVIII用于从远程接收信息,并设置适当的处理程序,这样我们就可以通过远程设置系统.
时钟模块:该模块采用的DSI.III0II时钟芯片,它产生的时间和日期,提供了时间控制信号,如饮水机的自动启动时间.当系统处于关机状态时,时钟也是在掉电状态下运行,因为外部纽扣电池提供时钟芯片的电流.当系统再次启动时,显示当前时间.
IV.系统软件设计
A.主要的系统软件设计流程.
系统软件包括许多任务有待解决的.该系统软件的主流程图如图II所示.
(I.)初始化该系统.这部分主要完成中断的相关寄存器的配置,并且还初始化全局变量,如OSI.III0II,LCDlIIVIIIVIIV等.
(II)阅读作业系统I.III0II和处理数据.在这部分的程序,主要任务是模拟DSI.III0II的读写时序,配置相关的寄存器,读它的日期和时间值,然后将日期和时间值转换成ASCII码来实现显示.
(III)温度采集和处理收集的数据.使DSI.VIIIVIIIII0可以重置和读取获得的数据的值,处理所收集的数据并将其转换成ASCII码来实现显示.
(IV)要确定菜单按钮被按下或没有".如果按下,LCDlIIVIIIVIIV转移到设置菜单界面的状态.在菜单界面有III个选项.它们是建立时间",设定温度值",设置启动时间".
(V)要确定是否有中断请求".他们被转移到中断处理.中断处理主要包括外部中断INTO和INTI,这是模式切换处理和红外接收中断处理,否则,该计划的实施遵循原来的顺序.
(VI)确定水按钮是否按下".有I.个小水泵通过继电器自动打开水阀.否则,该方案的实施遵循原来的顺序.
(VII)温度控制相关的处理.该系统主要是设置,采样值和其他变量.为了达到合适的温度和智能控制系统,该系统采用优化算法.
(VIII)正常显示状态.液晶显示屏主要显示日期,当前时间,当前温度值和当前工作模式.
图II本软件的主流程图
B.设置处理
菜单上有两个接口.万能遥控器按钮可以取代另I.个人,以及互动式的使用.因此,通过遥控器,上面的菜单设置也可以完成.流程图的设置状态示于图III.
图III.设置处理的流程图
V.温度误差处理和拟合算法的应用
A.温度误差处理
温度误差主要产生是由于传感器对温度敏感性差,温度传感器和水箱之间的不良接触等.为了消除不可避免的错误时,系统工作在VIIV0W的功率加热,同时,真值和样本值记录在表I.和表II.
表I..真阀门和采样值
表II.真值与采样值
B.拟合算法分析与应用
根据在表I和表II中的数据,实际温度值和采样值之间的关系的曲线被绘制如下图IV.
表IV.真实的温度值与采样值之间的关系
假设真实温度为T诱饵,以及样品的温度值为T的样本.我们有:
Tsample=0.IXIVxTtruc-I.I..0
VI.结论
我们知道,现代电子技术在不断发展,并与社会不断变化的需求息息相关.它带来了很多智能化特性的产品,.它为人们创造了I.个舒适,和谐,高质量的生活.本设计采用经典的低成本微控制器作为微控制器,饮水机系统的设计具有界面友好,节能的特点,也很聪明.为了使系统准确,其功耗低,我们努力优化软件的I.部分.由于不可避免的温度误差,本系统采用软件滤波,如限幅滤波器,
算术平均值滤波.为了达到降低或消除误差的目的,提高控制精度,线性回归也被施加到该项目.
参考文献
[I]Garside,J.o,"Amicrocomputerinterfacinglaboratory".International
JournalofElectricalEngineeringEducation,January(II00III),vIV0,pI.III-IIVI
[II]F.Reverter,M.GasullaandR.Palhls-Areny,Analysisofpower-supply
interferenceeffectsondirectsensor-to-microcontrollerinterfaces,IEEE
Trans.Instrum.Meas.VVI(I.)(II00VII),pp.lVIII.-I.VIIVII.
[III]E.Sifuentes,O.Casas,F.ReverterandR.Pallils-Areny,Improveddirect
interfacecircuitforresistivefull-andhalf-bridgesensors,Fourth
InternationalConferenceonElectricalandElectronicsEngineering
ICEEEMexico,September(II00VII),pp.I.IXVII-II00.
[IV]MaximDSI.VIIIBII0ProgrammableResolutionI-WireDigital
Thermometer[EB/OL].http://www.maxim-ic.com/
[V]M.Glenewinkel,Systemdesignandlayouttechniquesfornoise
reductioninMCU-basedsystems.MicroprocessorandMicrosystemsII0
V(I.IXIXVI),pp.III0III-III0IX.
[VI]D.Campbell,Defensivesoftwareprogrammingwithembedded
microcontrollers,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VII]M.J.Pont,R.Kureemun,H.L.R.Ong,W.Peasgood,Increasingthe
reliabilityofembeddedautomotiveapplicationsinthepresenceofEM!:
apilotstudy,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VIII]N.Zhang,G.Fan,K.H.Lee,GJ.KluitenbergandT.M.Loughin,
Simultaneousmeasurementofsoilwatercontentandsalinityusinga
frequency-responsemethod,SoilSci.Soc.Am.I..VIVIII(II00IV),pp.I.VI.V-
I.VIIV.
[IX]ADuCVIIIIVVMicroConverterMultichannelIIIV-/I.VI-bitADCswith
EmbeddedVIIIkBFlashandSingle-CycleMCU,Datasheets,Analog
Devices.http://www.analog.com/UploadedFiles/DataSheets/I.IVIIII.VIIIIIIVIVIV
ADuCVIIIIVV_VII_VIII_b.pdf,II00IV.
[I.0]NathanM.NeihartandReidR.Harrison,Micropowercircuitsfor
bidirectionalwirelesstelemetryinneuralrecordingapplications,IEEE
Trans.Biomed.Eng.VII(II00V),pp.I.IXV().....I.IXVIX.
[II]W.Mokwa,Ophthalmicimplants,ProceedingsoftheIEEESensors
(II00III),pp.IXVIII().....IXVIIIVI.
[I.II]I..W.Valvano,EmbeddedMicrocomputerSystems-RealTime
Interfacing,Brooks/ColeThomsonLearningII000.
[I.III]M.Gonzalez,F.Axisa,M.VandenBulcke,D.Brosteaux,B.
VandeveldeandI..Vanfleteren,Designofmetalinterconnectsfor
stretchableelectroniccircuitsusingfiniteelementanalysis,Proceedings
oftheVIIIthInternationalConferenceonThermal,Mechanicaland
MultiphysicsSimulationandExperimentsinMicro-Electronicsand
Micro-Systems,EuroSimE(II00VII).
[I.IV]MaximDSI.III0IITrickle-ChargeTimekeepingChip
[EB/OL].http://www.maxim-ic.coml
附件II:外文原文(复印件)
IntelligentWaterDispenserSystemBasedon
EmbeddedSystems
JinhuangHuang,JunXie*
DepartmentofElectricalEngineering,JinanUniversity,GuangzhouVI.0VIIIIII,P.R.China
huangjinVIIII@I.VIIII.com
Abstract_Usingsingle-bustemperaturesensorDSI.VIIIBII0tomeasurereal-timetemperatureofthedrinkingfountains,providingcalendarandtimethroughclockchipDSI.III0II,receivinginformationfromtheremotethroughHS00IIIVIIIB,anddisplayingthecalendarandtimeaswellasthecurrenttemperaturevaluethroughLCDI.IIVIIIVIIV,thesystemwasdesignedbasedonmicrocontrollerSTCVIIIIXCVII.Thesystemsoveralldesignconcept,thehardwarecircuitandsoftwareflowchartanddesign,temperatureerrorofprocessingandtheuseoffittingalgorithmhavebeendemonstrated.Thesystemhassuchfunctionsasremotecontrol,temperaturecontrol,cooling,variablepowerheating,withahighlevelofsafety,stability,intelligentcontrolandlowpowerconsumption.
I.INTRODUCTION
Withtherapiddevelopmentofeconomyandprogressofsociety,thehouseholdapplianceshavebeendevelopedtowardsdigitalization,functionaldiversificationwithintelligentmode[I.-III].Generallyspeaking,thecurrentgeneraldomesticwaterdispensersystemshavefunctionsofheatingandheatinsulation,manyofwhichhaveachievedtheircontrolwithanalogcircuits.However,therearemanydeficienciesinanalogcircuits.Firstly,analogcircuitsarealwaysaffectedbyexternalenvironmentfactors,suchaselectromagneticwavesandtemperature;secondly,theircontrolaccuracyissolowthatboilingandheatinsulationcanonlybeachievedataspecifictemperature(Userscannotsetthevalue);thirdly,itcangiverisetohighpowerconsumption.Forexample,ininsulatingstate,thepowercanreachIV0~V0W;Moreover,itisnoteasytoupgradeandexpandtheanalogcircuitsystem.Microcontroller-basedtemperaturemonitoringandcontrolling,however,applytotheactualproduction.Generally,inordertoachieveprocesscontrolinautomation,intelligentfunctionsandhighprecision,theMCV-basedsmarttemperaturecontrolwaterdispensersystem,notonlycouldavoidmostdefectsofanalogcircuits,butalsohavelowpowerconsumption,perfectstability,andhighdegreeofautomation.Itsapplicationhasaconsiderableadvantageandpromotionofspace.Inaword,thewaterdispensersmartsystemisconsistentwiththemodemconceptofthedigital,intelligent,energy-savingtechnology,humanity,aswellasthetrend.
II.SYSTEMPROGRAMDESIGN
A.DesignConceptofTheSystem
Theoveralldesignmethodologyofthesystemis:TomakeuseoftemperaturesensorDSI.VIIIBII0[IV]forsamplingthetemperatureoftheheatingwatertankinreal-time,andthesamplevalueistakentoMCU[V-I.III]forprocessing-Datafitting,errorcorrection,digitalfiltering.ThetimeandcalendardatawhicharefromDSI.III0II[I.IV]clockchiparealsotakentoMCVforprocessing.Theremotecontrolorkeyboardisusedtoinputsettingvalue,choose"Heatedtoboilingornot"and"settheoperatingmode(includingIVmodelsnamely,cooling,closing,insulationandheating).Thecombinatorialrelaysachievemodeswitching.Atthesametime,thesystemcanalsosettheremotecontrolorkeyboardtoadjusttimeandcalendar.Inintelligentmode,thesystemkeepsthewatertemperatureonsettingvalue,andseektoachieveenergysaving.Inthenormalworkingstate(Relativetothesettingstate),LCDI.IIVIIIVIIVdisplaysthecurrenttime,date,real-timesamplevaluesandoperatingmodes.Dependingonashortcutofremotecontrolorkeyboard,wecouldletcurrentoperatingmodeswitchtoanothermodeofoperation,andstartasmallautomaticwaterpump.Inaddition,inthesettingstate,wecanalsoset"Doyouopentheheaterself-starting","Automaticstart-uptime"and"Post-setvalue".
Systemsmainperformanceindicatorsare:(I.)thesettingrangeofconstanttemperature:I.VII~IX0℃,MinimumdifferentiationisI.℃;(II)LCDI.IIVIIIVIIVdisplaystheactualsampletemperature,displayrange:0~I.00℃;minimumdifferentiation:0.I.℃;(IV)controlaccuracy:<=III℃
B.SystemSolutions
ThissystemisbasedonVIIIIXCVIIMCU,settingthewatertemperaturesignalacquisition,workingstatedetection,temperatureandthevalueoferrorcorrection,fittingalgorithmandtheapplicationofcontrolalgorithmsandcontrolprogramoptimizationasoneofthedigitalcontrolsystems.Atthesametime,thesystemhasincludedafriendlyman-machineinterface,aswellasasetupmenuwhichiseasytounderstand.Thesystemconsistsofthefollowingfunctionalmodules:theclockmodule,thepowermodule,thecontrolmoduleofsmallwaterpump,thecontrolmoduleofinfraredremotecontrol,thedisplaymodule,thekeyboardsetupmodule,themoduleoftemperatureacquisition,thecoolingmoduleandtheheatingmodule.ThediagramofsystemisshowninFigI..
FigISystemSolutionDiagram
C.InnovationPointandDistinctiveFeatures
(I.)Inthissystem,thereisIIII0VAChighvoltageaswellasI.IIVandVVDClowvoltage.Sowehavetotakeitssecurityandstabilityintoconsideration.Forsafetyssake,thesystemusestheI.IIV-drivenpolerelaytocontrolIIII0VAChighvoltage,coupledwithasingle-polerelayswitchasachoiceofthepower.Asaresult,thesystemnotonlyensuresthesafety(thesystemiscompletelyoffIIII0VACpowersupplyinitsoffstate),butalsoemploysatwo-stagepowercontrol.(II)TheinfraredreceiverheadHS00IIIVIIIVIIIhasbeenadopted,andtheuniversalremotecontrolalsohasbeenconfigured.VIIIypreparingtherelatedsoftware,remoteintelligentcontrolcanbeimplementedinthesystem.(III)Externalinterrupt0buttonisusedtoachieveaquickswitchbetweenthevariousoperatingmodes.
III.SYSTEMHARDWAREDESIGN
AnovervIewofthemainmoduleinterfacecircuitisprovided;
Powersupplymodulemainlyhasthefollowingtwoparts.(I.)I.IIVDCvoltageisprovidedasthesysteminputpower,alsoasawaterpumpdrivevoltage;TheVIIVIII0VvoltageconversionchipisusedtoconvertthemVVDCvoltageforthesystemmicrocontrollerandotherperipheralequipment.(II)IIII0VACvoltagegetsaccesstotheheatingpipelines.ThisstrategycanbeadoptedbyMCUtoachievehierarchicalcontrolrelaysingradation,sothattheMCUcouldcontroltheheatingpiletoworkinthesub-power-Ievelorshutdowncompletely.
Thesmallpumpcontrolmoduleconsistsoftwoparts.(I.)Inordertoachieveremotecontrolwatercontrol,itusesarelayasacontrolswitchofthesmallpump.(II)Addtoakeyswitchasthepumpcontrolforachievingmanualwatercontrol.
Keyboardsetupmodule:Tenkeyshavebeendesignedinordertoachievethesetupandcontrolfunctions.Eightofthemaresettingbuttons,whichcouldemploythesystemsettings.therearealsotwoindependentkeys,oneofthemcouldcontrolthepump.Ttheotherkeyismodeswitchingbutton.
Temperatureacquisitionmodule:OSI.VIIIVIIIII0isusedastemperaturesensor.Themethodofobtainingtemperaturevaluefromthetemperaturesensorisverysimple,whichdonotneedanA/Dconverter.IfthetemperaturedatafromDSI.VIIIVIIIII0istakentoMCUforprocessing,thenthedatacouldbedisplayed.
Coolingmodule:Asmallelectricfanisinstalled;Inordertoachieveintelligentcontrolandarelayisusedtocontrolthefanworking.
Heatingmodule:IIII0VACvoltagepowerissuppliedtoheatingpipewhichiscontrolledbythedouble-stagerelay.Theheatingpipehasthreeworkingstates:offstate,highpower(VII00W)workingstate,aswellasthelow-power(IV0W)workingstate.Moreover,basedonthevalueoftheconstanttemperature,avarietyofworkingmodescanbeswitchedintelligentlysothatthesystemcouldachievelowpowerconsumptionandintelligentautomation.
Displaymodules:LCDI.IIVIIIVIIVisusedasahumancomputerinteractioninterface.Undersuchnormalinterface,LCDI.IIVIIIVIIVdisplaysthecurrenttime,date,watertemperatureandthecurrentworkingpractices.undersettinginterface,
LCDI.IIVIIIVIIVdisplayssettingmenusandprompts.
Infraredremotecontrolmodule:HS00IIIVIIIVIIIisusedtoreceiveinformationfromtheremote,andtheappropriateproceduresfordealinghavebeenconfigured,sothatwecouldsetthesystemthrougharemote.
Clockmodule:ThemoduleusesDSI.III0IIclockchip,whichgeneratesthetimeanddate,offerscontrolsignaloftime,suchasautomaticstart-uptimeofthewaterdispenser.Whenthesystemispowered-off,theclockisalsorunningduringpower-downstatebecausetheexternalbuttonbatteriesprovidetheclockchipwithcurrent.Whenthesystemispoweredagain,thecurrenttimeisdisplayed.
IV.SYSTEMSOFTWAREDESIGN
A.TheMainSystemSoftwareDesignProcess.Systemsoftwareincludesanumberoftaskstobeaddressed.Themainflowchartofthesystemsoftwareis
showninFigII.
(I.)Initializethesystem.ThispartMainlyfinishesrelatedconfigurationregisteroftheinterrupt,andalsoinitializetheglobalvariables,OSI.III0II,andLCDlIIVIIIVIIVandsoon.
(II)ReadtheOSI.III0IIandprocessdata.Inthispartoftheprogram,themajortaskistosimulatethereadingandwritingtimingofDSI.III0II,configuretherelativeregisters,readitsdateandtimevalues,andthentransformthedateandtimevaluesintoASCIIcodetoachievedisplaying.
(III)Temperatureacquisitionandprocessthecollecteddata.MakeDSI.VIIIVIIIII0canresetandreadthevaluesoftheobtaineddata,processingthecollecteddataandtransformingitintoASCIIcodetoachievedisplaying.
(IV)Todeterminethe"menubuttonispressedornot".Ifpressed,LCDlIIVIIIVIIVistransferredtosettingstateofamenuinterface.Therearethreeoptionsinmenuinterface.Theyare"set-uptime","setthetemperaturevalue"and"setupsincethestart-uptime",
(V)Todetermine"whetherthereisaninterruptrequest".theyaretransferredtointerrupthandling.InterrupthandlingmainlyincludesexternalinterruptsINTOandINTI,whicharethemodeswitchingprocessingandinfraredreceiverinterrupthandling;Otherwise,theimplementationoftheprogram
followstheoriginalorder.
(VI)Todetermine"whetherthewaterbuttonpressed".Thereisasmallwaterpumpconnectedthroughtherelaytoautomaticallyopenwater.Otherwise,theimplementationoftheprogramfollowstheoriginalorder
(VII)Temperaturecontrol-relatedprocessing.Thesystemismainlybasedonsettings,sampledvaluesandothervariables.Inordertoachievetherighttemperatureandintelligentcontrolsystem,thesystemuseoptimizationalgorithms.
(VIII)Thenormaldisplaystatus.LCDmainlydisplaysthedate,currenttime,thecurrenttemperaturevalueandthecurrentworkmode.
FigIIMainFlowChartoftheSoftware
B.TheProcessingofSettings.
Themenuhastwointerfaces.Theuniversalremotecontrolbuttoncanbesubstitutedforonetoanother,aswellastheinteractiveuse.Therefore,throughtheremotecontrol,themenusettingsabovecouldbeabletobecompleted.SettingstateoftheflowchartisshowninFigIII.
IV
FigIIITheFlowChartofSettingProcessing
V.TEMPERATUREERROROFPROCESSINGANDTHEAPPLICATIONOFFITTINGALGORITHM
A.TemperatureErrorHandling.
Temperatureerrorarisesmainlyduetotherelativelypoortemperaturesensitivityofthesensor,thepoorconditioncontactbetweentemperaturesensorandwatertank,etc.Inordertoeliminatetheinevitableerrors,whilethesystemisworkinginVIIV0Wforpowerheating,truevaluesandsamplevaluesarerecordedinTABLEIandTABLEII,.
TABLEI.TRUEVALVESANDTHESAMPLEDVALUES
TABLEll.TRUEVALUESANDTHESAMPLEDVALUES
B.FittingAlgorithmAnalysisandApplication
AccordingtothedataintheTABLEIandTABLEII,ThecurvesoftherelationshipbetweentruetemperaturevaluesandsampledvaluesisdrawnasfollowsFigIV.
FigIVRelationshipbetweentruetemperaturevaluesandsampledvalues
AssumethatthetruetemperatureisTlure,andthesampletemperaturevalueisTsample.Wehave:
Tsample=0.IXIVxTtruc-I.I..0
VI.CONCLUSION
Asweknow,modemelectronictechnologyisdevelopingandupdatingwiththeapplicationofthechangingneedsofthesociety.Itbringslotsofproductswithhumanandintelligentfeatures.Italsocreatesacomfortableandharmonious,superiorqualityoflifeforpeople.Thisdesignusesclassiclow-costmicro-controllerasamicro-controller,awaterdispensersystemisdesigned,whichhasfriendlyinterface,energy-savingfeatures,andalsoisintelligent.Inordertomakethesystemaccurateanditspowerconsumptionlow,wemakeeffortstooptimizethesoftwarepart.However,becauseoftheinevitabletemperatureerror,thesystemusessoftwarefiltering,suchaslimitingfilter,arithmeticmeanfiltering.Inordertoachievethepurposeofreducingoreliminatingerrorsandimprovethecontrolprecision,thelinearregressionisalsoappliedtothisproject.
REFERENCES
[I]Garside,J.o,"Amicrocomputerinterfacinglaboratory".International
JournalofElectricalEngineeringEducation,January(II00III),vIV0,pI.III-IIVI
[II]F.Reverter,M.GasullaandR.Palhls-Areny,Analysisofpower-supply
interferenceeffectsondirectsensor-to-microcontrollerinterfaces,IEEE
Trans.Instrum.Meas.VVI(I.)(II00VII),pp.lVIII.-I.VIIVII.
[III]E.Sifuentes,O.Casas,F.ReverterandR.Pallils-Areny,Improveddirect
interfacecircuitforresistivefull-andhalf-bridgesensors,Fourth
InternationalConferenceonElectricalandElectronicsEngineering
ICEEEMexico,September(II00VII),pp.I.IXVII-II00.
[IV]MaximDSI.VIIIBII0ProgrammableResolutionI-WireDigital
Thermometer[EB/OL].http://www.maxim-ic.com/
[V]M.Glenewinkel,Systemdesignandlayouttechniquesfornoise
reductioninMCU-basedsystems.MicroprocessorandMicrosystemsII0
V(I.IXIXVI),pp.III0III-III0IX.
[VI]D.Campbell,Defensivesoftwareprogrammingwithembedded
microcontrollers,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VII]M.J.Pont,R.Kureemun,H.L.R.Ong,W.Peasgood,Increasingthe
reliabilityofembeddedautomotiveapplicationsinthepresenceofEM!:
apilotstudy,lEEColloquiumonElectromagneticCompatibilityof
Software,Birmingham,UK,NovemberI.IXIXVIII.
[VIII]N.Zhang,G.Fan,K.H.Lee,GJ.KluitenbergandT.M.Loughin,
Simultaneousmeasurementofsoilwatercontentandsalinityusinga
frequency-responsemethod,SoilSci.Soc.Am.I..VIVIII(II00IV),pp.I.VI.V-
I.VIIV.
[IX]ADuCVIIIIVVMicroConverterMultichannelIIIV-/I.VI-bitADCswith
EmbeddedVIIIkBFlashandSingle-CycleMCU,Datasheets,Analog
Devices.http://www.analog.com/UploadedFiles/DataSheets/I.IVIIII.VIIIIIIVIVIV
ADuCVIIIIVV_VII_VIII_b.pdf,II00IV.
[I.0]NathanM.NeihartandReidR.Harrison,Micropowercircuitsfor
bidirectionalwirelesstelemetryinneuralrecordingapplications,IEEE
Trans.Biomed.Eng.VII(II00V),pp.I.IXV().....I.IXVIX.
[II]W.Mokwa,Ophthalmicimplants,ProceedingsoftheIEEESensors
(II00III),pp.IXVIII().....IXVIIIVI.
[I.II]I..W.Valvano,EmbeddedMicrocomputerSystems-RealTime
Interfacing,Brooks/ColeThomsonLearningII000.
[I.III]M.Gonzalez,F.Axisa,M.VandenBulcke,D.Brosteaux,B.
VandeveldeandI..Vanfleteren,Designofmetalinterconnectsfor
stretchableelectroniccircuitsusingfiniteelementanalysis,Proceedings
oftheVIIIthInternationalConferenceonThermal,MechanicalandMultiphysicsSimulationandExperimentsinMicro-Electronicsand
Micro-Systems,EuroSimE(II00VII).
[I.IV]MaximDSI.III0IITrickle-ChargeTimekeepingChip
[EB/OL].http://www.maxim-ic.coml
版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/lwqt/wxzs/134.html