




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
溫度控系統(tǒng)的計摘要:研究了基于AT89S單片機溫度制系統(tǒng)的原和功能,溫測量單元由單總線字溫度傳感DS18B20構(gòu)成。系統(tǒng)可進行度設(shè)定,時間顯示和存監(jiān)測數(shù)據(jù)如果溫度超任意設(shè)置的限和下限值,系統(tǒng)將報警可以和自動制的實現(xiàn),而達到溫度測智能一定范圍內(nèi)?;诮y(tǒng)的原理,容易使其他種非線性控系統(tǒng),只要軟件設(shè)計合理改變。該系已被證明是確的,可靠滿意通過現(xiàn)場實踐。關(guān)鍵詞:單片機;度;溫度I.導(dǎo)言溫度是在人類生活非常重要的數(shù)。在現(xiàn)代會中,溫度制(TC)不僅用于業(yè)生產(chǎn),還泛應(yīng)用于其領(lǐng)域。隨著活質(zhì)量的提高,我們可以現(xiàn)在酒店,廠和家庭,及比賽設(shè)備而比賽的趨勢將更好地服于整個社會因此它具有分重要的意測量和控制溫度。在AT89S51單片和溫度傳感DS18B20的礎(chǔ)上,系統(tǒng)環(huán)境溫度智能控制。溫可設(shè)定在一范圍內(nèi)動任。該系統(tǒng)可顯示在液晶顯示屏的時間并保存監(jiān)測據(jù),并自動控制溫度,環(huán)境溫度超過上限和下限值。這樣做為了保持溫不變。該系具有很高的抗干擾能力,制精度高,活的設(shè)計,也非常適合個惡劣的環(huán)境。它主要應(yīng)于人們的生,改善工作生活質(zhì)量。也是通用的,因此它可以便地擴大使該系統(tǒng)。因,設(shè)計具有刻的重要性。一般的設(shè)計硬件設(shè)計和件系統(tǒng)的設(shè)都包括在內(nèi)II.系統(tǒng)總體設(shè)計該系統(tǒng)硬件包括微制器,溫度測電路,鍵控制電路,鐘電路,顯示,報警驅(qū)動電路和部RAM?;鵄T89S51單片機DS18B20的將度信號傳送數(shù)字信號的測。和信號送到微控制進行處理。最后,度值顯示在晶12232F。些步驟是用實現(xiàn)溫度檢測。使用鍵盤口芯片HD7279設(shè)定溫度值使用微控制保持一定的溫度,并使液晶顯示的度控制設(shè)定。此外,時芯片DS1302用于顯示時和外部RAM6264是用保存監(jiān)測數(shù)。報警將給及時蜂鳴器如果溫超過了上限下限溫度值III.硬件設(shè)A.微控制器在AT89S51單片是一種低功,高性能CMOS8位4K的系統(tǒng)可編程閃存字節(jié)微控器。該設(shè)備采用Atmel高密度非易性內(nèi)存技術(shù),并與業(yè)界標(biāo)的80C51指令集和腳兼容。片閃存程序存器可以編程就可以在統(tǒng)或由傳統(tǒng)非易失性存器編程。通結(jié)合在系統(tǒng)靈活的8CPU集成在個芯片可編閃存,Atmel的單機AT89S51是一功能強大的控制器提供一個高度靈的和具有成效益的解決方案很嵌入式控制用。為了節(jié)監(jiān)測數(shù)據(jù),6264是用來作為外部RAM它是一個靜RAM芯片,功耗具有8K節(jié)的內(nèi)存。B.溫度檢測路溫度傳感器是該系的關(guān)鍵部分達拉斯DS18B20的使用它支持1-Wire總線接口,板上利是在內(nèi)部用。所有的感器部分和轉(zhuǎn)換電路集成在一晶體管集成路像[1]。其測量圍為-55℃?125℃,在-10℃85℃精度為0.5℃[2,3]。由DS18B20溫度采集傳輸在1-Wire總線的方,這種高度高了系統(tǒng)的干擾,使之適合在惡劣的環(huán)境場溫度測量[4]。兩個電源DS18B20的供應(yīng)方式。首先是外部電源供:DS18B20第一腳連接地面,第二腳用作信號線,三是連接到源。第二種式是寄生電[5]。由于寄生源會導(dǎo)致硬件電路,軟控制的難度芯片的性能降等,但DS18B20的(s)的復(fù)雜,可以連接I/O端口的單機在外部電供電方式,它更受歡迎。因此外部電源供使用,而第個接腳連接引腳P1.3可單片AT89S51。其實,果多有被檢,DS18B20(S)可以連接到1-Wire總線。但是當(dāng)數(shù)超過8有一個向駕和更復(fù)雜的軟件設(shè)計,以及-Wire總線長度關(guān)注。一般言,這是不過50米。為了現(xiàn)遠(yuǎn)程控制該系統(tǒng)可在個無線之一,旨在破了1-Wire總線度的限制[6]C.LCD顯示電路液晶顯示12232F用,這可以用來示字符,溫值和時間,提供一個友好的顯界面。該12232F一個具有8192128×32像素漢字?jǐn)?shù)據(jù)庫和12816×8像素ASCII字符圖形液晶顯。它主要由行驅(qū)動器/列動器和128×32點陣的充分示圖形,以7.5×2個漢字功能的液晶顯器。它是在行或串行方連接到外部CPU[7]。為了節(jié)約硬件資源12232F應(yīng)以串方式連接到片機AT89S51,只有4個輸出使的端口。液顯示屏灰度以通過調(diào)整變電阻連接液晶VLCD的PIN碼。CLK是用于傳串行通信時。SID是用傳輸串行數(shù)據(jù)。CS是用來能控制,液顯示。L+是來控制LCD光電源。D.時鐘電路達拉斯DS1302的使用這是一種高能,低功耗實時時鐘芯與RAM。在DS1302的服務(wù)于帶有歷時鐘系統(tǒng)用于監(jiān)測的間。讀取數(shù)據(jù)的時間由AT89S51單機,再由液顯示處理。外的時間可調(diào)整鍵盤。在DS1302的晶體振蕩器設(shè)為32768Hz的,建的補償電容是6pF。振器的頻率較,所以有可不連接的電器,這不會很大的不同的時間度。備用電可以連接到3.6V的可充電池。E.鍵盤控制路系統(tǒng)中的鍵盤接口HD7279A驅(qū)動下,它有個+5V單電源,這是連接,無需使用何有源設(shè)備鍵盤和顯示根據(jù)基本要和系統(tǒng)功能,只有6按鈕是必要。該系統(tǒng)的能是由輸入數(shù)據(jù)接收單機AT89S51。為節(jié)省外部電器,1×6使用盤和鍵盤代定義為:07h的,0FH17H條,1FH27H款,2Fh的該命令可以出通過閱讀代碼指令。HD7279A是接到單片機AT89S51的串行模式,有4個端口的需要。DIG0?DIG5和DP別列線和六個鍵是現(xiàn)鍵盤監(jiān)控解碼和識別關(guān)鍵代碼線端口。F.報警電路為了簡化電路,調(diào)方便,是一5V的蜂鳴器自動警電路中的應(yīng)用[8]。使得軟件編簡化。它是9012PNP晶體管的基連到AT89S51單片機引腳P2.5。當(dāng)度超過上限下限的值,P2.5輸出低電平使晶體管,然后由一報警蜂鳴器。G.驅(qū)動電路一個步進電機作為動裝置來控溫度。四相八打脈沖分模式是用來驅(qū)動電機簡單的延時序是用來處脈沖之間的間間隔,獲得不同的轉(zhuǎn)速。兩個步進電的輸出狀態(tài)一:當(dāng)溫度過上限值時,電機反向旋(以低的溫當(dāng)?shù)陀谙孪迺r,電機旋正常(提高溫度了不等預(yù)設(shè)值。二當(dāng)溫度在兩之間的某處束,等于設(shè)定值時電機停止。些步驟是用實現(xiàn)溫度控。此外,電機的轉(zhuǎn)速也可以整相對按鈕代碼數(shù)據(jù)是過港口答11A8的輸入(P2.3?P2.0是)的逆變器74LS04AT89S51單機和反向輸。最后,它被放大功2803A權(quán)力機。IV.軟件設(shè)計按照一般設(shè)計要求該系統(tǒng)的硬電路原理,及該程序的讀性,可移植性和改的調(diào)試方便軟件設(shè)計?;O到y(tǒng)流主要包括以下8個步:POST(加自檢統(tǒng)啟動,溫度檢測報警處理,溫度控制,時鐘芯DS1302的操作液晶顯示和盤操作。給點分析,上述8個務(wù),很容易發(fā)現(xiàn),過去年任務(wù)需要時操作。但溫度的檢測,可與TIMER0計時1秒,即出現(xiàn)度檢測達到秒。系統(tǒng)啟動包括全局變量的義,內(nèi)存啟,啟動特殊能寄存器和圍設(shè)備的啟動。全局變量定義,主要成對外部接連接到單片AT89S51芯片,內(nèi)存單位和些特殊的定的接口定義開始主要是RAM的內(nèi)存處理。例如,系統(tǒng)通電時碼將在內(nèi)部位地址或閃標(biāo)志存儲的信息將被清除特殊功能寄器包括加載動定時器初的開放中斷。例如,當(dāng)系通電定時器始化。外圍備的啟動,指設(shè)置外圍設(shè)備的初始值例如,當(dāng)系通電后,LCD應(yīng)該被始化,啟動示器應(yīng)該叫,溫度換命令時,須先發(fā)出的鐘芯片DS1302要被初始化。報警處理要是降低和度的提高使度保持在預(yù)范圍。當(dāng)溫度之間的上限下限的值,是不言而喻溫度控制處,即需要的溫度升高或降根據(jù)預(yù)設(shè)值這樣做的條溫度等于設(shè)值,從而達到溫度的目標(biāo)V.結(jié)論溫度控制系統(tǒng)具有好的人機交界面,硬件單,成本低溫度控制精度高(誤在±1℃范圍內(nèi)誤利性和多功性等,它可廣泛的場合使用優(yōu)點與-55℃至125℃范圍,且有一定實用價值。DesigntheTemperatureControlSystemBasedonAT89S51ABSTRACTTheprincipleandfunctionsofthetemperaturecontrolsystembasedonmicrocontrollerAT89S51arestudied,andthetemperaturemeasurementunitconsistsofthe1-WirebusdigitaltemperaturesensorDS18B20.Thesystemcanbeexpectedtodetectthepresettemperature,displaytimeandsavemonitoringdata.Analarmwillbegivenbysystemifthetemperatureexceedstheupperandlowerlimitvalueofthetemperaturewhichcanbesetdiscretionarilyandthenautomaticcontrolisachieved,thusthetemperatureisachievedmonitoringintelligentlywithinacertainrange.Basingonprincipleofthesystem,itiseasytomakeavarietyofothernon-linearcontrolsystemssolongasthesoftwaredesignisreasonablychanged.Thesystemhasbeenprovedtobeaccurate,reliableandsatisfiedthroughfieldpractice.KEYWORDS:AT89S51;microcontroller;DS18B20;temperatureI.INTRODUCTIONTemperatureisaveryimportantparameterinhumanlife.Inthemodernsociety,temperaturecontrol(TC)isnotonlyusedinindustrialproduction,butalsowidelyusedinotherfields.Withtheimprovementofthelifequality,wecanfindtheTCapplianceinhotels,factoriesandhomeaswell.AndthetrendthatTCwillbetterservethewholesociety,itisofgreatsignificancemeasureandcontrolthetemperature.BasedontheAT89S51andtemperaturesensorDS18B20,thissystemcontrolstheconditiontemperatureintelligently.Thetemperaturecanbesetdiscretionarilywithinacertainrange.ThesystemcanshowthetimeonLCD,andsavemonitoringdata;andautomaticallycontrolthetemperaturewhentheconditiontemperatureexceedstheupperandlowerlimitvalue.Bydoingsoitistokeepthetemperatureunchanged.Thesystemisofhighanti-jamming,highcontrolprecisionandflexibledesign;italsofitstheruggedenvironment.Itismainlyusedinpeople'slifetoimprovethequalityoftheworkandlife.Itisalsoversatile,sothatitcanbeconvenienttoextendtheuseofthesystem.Sothedesignisofprofoundimportance.Thegeneraldesign,hardwaredesignandsoftwaredesignofthesystemarecovered.II.SYSTEMGENERALDESIGNThehardwareblockdiagramoftheTCisshowninFig.1.Thesystemhardwareincludesthemicrocontroller,temperaturedetectioncircuit,keyboardcontrolcircuit,clockcircuit,Display,alarm,drivecircuitandexternalRAM.BasedontheAT89S51,theDS18B20willtransferthetemperaturesignaldetectedtodigitalsignal.Andthesignalissenttothemicrocontrollerforprocessing.AtlastthetemperaturevalueisshowedontheLCD12232F.Thesestepsareusedtoachievethetemperaturedetection.UsingthekeyboardinterfacechipHD7279tosetthetemperaturevalue,usingthemicrocontrollertokeepacertaintemperature,andusingtheLCDtoshowthepresetvalueforcontrollingthetemperature.Inaddition,theclockchipDS1302isusedtoshowtimeandtheexternalRAM6264isusedtosavethemonitoringdata.Analarmwillbegivenbybuzzerintimeifthetemperatureexceedstheupperandlowerlimitvalueofthetemperature.III.HARDWAREDESIGNA.MicrocontrollerTheAT89S51isalow-power,high-performanceCMOS8-bitmicrocontrollerwith4Kbytesofin-systemprogrammableFlashmemory.ThedeviceismanufacturedusingAtmel’shigh-densitynonvolatilememorytechnologyandiscompatiblewiththeindustry-standard80C51instructionsetandpinout.Theon-chipFlashallowstheprogrammemorytobereprogrammedin-systemorbyaconventionalnonvolatilememoryprogrammer.Bycombiningaversatile8-bitCPUwithin-systemprogrammableFlashonamonolithicchip,theAtmelAT89S51isapowerfulmicrocontrollerwhichprovidesahighly-flexibleandcost-effectivesolutiontomanyembeddedcontrolapplications.MinimumsystemofthemicrocontrollerisshowninFig.2.Inordertosavemonitoringdata,the6264isusedasanexternalRAM.ItisastaticRAMchip,low-powerwith8Kbytesmemory.B.TemperatureDetectionCircuitThetemperaturesensoristhekeypartinthesystem.TheDallasDS18B20isused,whichsupportsthe1-Wirebusinterface,andtheON-BOARDPatentedisusedinternally.Allthesensorpartsandtheconvertingcircuitareintegratedinintegratedcircuitlikeatransistor[1].Itsmeasurerangeis-55℃~125℃,andtheprecisionbetween-10℃~85℃±0.5℃[2,3].ThetemperaturecollectedbytheDS18B20istransmittedinthe1-Wirebusway,andthishighlyraisesthesystemanti-jammingandmakesitfitinsitutemperaturemeasurementoftheruggedenvironment[4].TherearetwopowersupplywaysfortheDS18B20.Thefirstisexternalpowersupply:thefirstpinoftheDS18B20isconnectedtotheground;thesecondpinservesassignalwireandthethirdisconnectedtothepower.Thesecondwayisparasitepowersupply[5].Astheparasitepowersupplywillleadtothecomplexityofthehardwarecircuit,thedifficultyofthesoftwarecontrolandtheperformancedegradationofthechip,etc.ButtheDS18B20(s)canbeconnectedtotheI/Oportofthemicrocontrollerintheexternalpowersupplywayanditismorepopular.ThereforetheexternalpowersupplyisusedandthesecondpinisconnectedtothepinP1.3oftheAT89S51.Actually,iftherearemultipointtobedetected,theDS18B20(s)canbeconnectedtothe1-Wirebus.Butwhenthenumberisover8,thereisaconcerntothedrivingandthemorecomplexsoftwaredesignaswellasthelengthofthe1-Wirebus.Normallyitisnomorethan50m.Toachievedistantcontrol,thesystemcanbedesignedintoawirelessonetobreakthelengthlimitofthe1-Wirebus[6].C.LCDCircuitTheLCD12232Fisused,whichcanbeusedtoshowcharacters,temperaturevalueandtime,andsupplyafriendlydisplayinterface.The12232FisaLCDwith8192128×32pixelsChinesecharacterdatabaseand12816×8pixelsASCIIcharactersetgraphics.Itmainlyconsistsofrowdrive/columndriveand128×32fulllatticeLCDwiththefunctionofdisplayinggraphicsaswellas7.5×2Chinesecharacters.ItisinaparallelorserialmodetoconnecttoexternalCPU[7].Inordertoeconomizethehardwareresource,the12232FshouldbeconnectedtotheAT89S51inserialmodewithonly4outputportsused.TheLCDgrayscalecanbechangedbyadjustingthevariableresistorconnectedthepinVlcdoftheLCD.CLKisusedtotransmitserialcommunicationclock.SIDisusedtotransmitserialdata.CSisusedtoenablecontroltheLCD.L+isusedtocontroltheLCDbacklightpower.D.ClockCircuitTheDallasDS1302isused,whichisahighperformance,low-powerandreal-timeclockchipwithRAM.TheDS1302servesinthesystemwithcalendarclockandisusedtomonitorthetime.ThetimedataisreadandprocessedbytheAT89S51andthendisplayedtheLCD.Alsothetimecanbeadjustedbythekeyboard.TheDS1302crystaloscillatorissetat32768Hz,andtherecommendedcompensationcapacitanceis6pF.Theoscillatorfrequencyislower,soitmightbepossiblenottoconnectthecapacitor,andthiswouldnotmakeabigdifferencetothetimeprecision.Thebackuppowersupplycanbeconnectedtoa3.6Vrechargeablebattery.E.KeyboardControlCircuitThekeyboardinterfaceinthesystemisdrivenbytheHD7279Awhichhasa+5Vsinglepowersupplyandwhichisconnectedtothekeyboardanddisplaywithoutusinganyactive-device.Accordingtothebasicrequirementsandfunctionsofthesystem,only6buttonsareneeded.Thesystem'sfunctionsaresetbytheAT89S51receivingtheentereddata.Inordertosavetheexternalresistor,the1×6keyboardisused,andthekeyboardcodesaredefinedas:07H,0FH,17H,1FH,27H,2FH.Theordercanbereadoutbyreadingthecodeinstruction.HD7279AisconnectedtotheAT89S51inserialmodeandonly4portsareneed.AsshowninFig.6,DIG0~DIG5andDParerespectivelythecolumnlinesandrowlineportsofthesixkeyswhichachievekeyboardmonitoring,decodingandkeycodesidentification.F.AlarmCircuitInordertosimplifythecircuitandconvenientdebugging,a5Vautomaticbuzzerisusedinthealarmcircuit[8].Andthismakethesoftwareprogrammingsimplified.AsshowninFig.7,itiscontrolledbythePNPtransistor9012whosebaseisconnectedtothepinP2.5oftheAT89S51.Whenthetemperatureexceedstheupperandlowerlimitvalue,theP2.5outputlowlevelwhichmakesthetransistorbeonandthenanalarmisgivenbythebuzzer.G.DriveCircuitAstepmotorisusedasthedrivedevicetocontrolthetemperature.Thefour-phaseandeight-beatpulsedistributionmodeisusedtodrivemotorandthesimpledelayprogramisusedtohandlethetimeintervalbetweenthepulsestoobtaindifferentrotationalspeed.Therearetwooutputstatesforthestepmotor.One:whenthetemperatureisovertheuppervalue,themotorrotatesreversely(tolowthetemperature),whilewhenlowerthanthelowerlimitvalue,themotorrotatesnormally(toraisethetemperature);besidesnotequalsthepresetvalue.Two:whenthetemperatureisatsomewherebetweenthetwoendsandequalsthepresetvalue,themotorstops.Thesestepsareusedtoachievethetemperaturecontrol.Inaddition,themotorspeedcanalsobeadjustedbyrelativebuttons.AsshowninFig.8,thecodedataisinputthroughportsA11~A8(beP2.3~P2.0)oftheAT89S51andinvertedoutputbytheinverter74LS04.Finallyitisamplifiedbythepoweramplifier2803Atopowerthemotor.IV.SOFTWAREDESIGNAccordingtothegeneraldesignrequirementandhardwarecircuitprincipleofthesystem,aswellastheimprovementoftheprogramreadability,transferabilityandtheconvenientdebugging,thesoftwaredesignismodularized.Thesystemflowmainlyincludesthefollowing8steps:POST(Power-onself-test),systeminitiation,temperaturedetection,alarmhandling,temperaturecontrol,clockchipDS1302operation,LCDandkeyboardoperation.ThemainprogramflowisshowninFig.9.Givealittleanalysistotheabove8tasks,itiseasytofindoutthatthelastfivetasksrequiretherealtimeoperation.Buttothetemperaturedetectionitcanbeachievedwithtimer0timing1second,thatistosaytemperaturedetectionoccurspersecond.Thesysteminitiationincludesglobalvariabledefinition,RAMinitiation,specialfunctionregisterinitiationandperipheralequipmentinitiation.Globalvariabledefinitionmainlyfinishestheinterfacedefinitionofexternalinterfacechipconnectedt
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度生豬養(yǎng)殖與農(nóng)業(yè)產(chǎn)業(yè)扶貧合作協(xié)議
- 二零二五年度制造業(yè)工傷責(zé)任保險合同
- 2025年度男方道歉夫妻共同生活保證協(xié)議
- 2025年度飯店短期勞務(wù)合同-客房服務(wù)員職業(yè)健康與安全協(xié)議
- 二零二五年度物業(yè)公司員工勞動合同(含社區(qū)文化活動)
- 監(jiān)理技術(shù)服務(wù)合同
- 綠色數(shù)據(jù)中心建設(shè)運營合同
- 環(huán)境影響評估結(jié)果展示表
- 股份制企業(yè)股權(quán)分配與管理制度文書
- 財務(wù)與成本控制管理細(xì)則
- 2025年山西省太原市衛(wèi)健委直屬單位招聘522人歷年高頻重點模擬試卷提升(共500題附帶答案詳解)
- 勞務(wù)合同協(xié)議書書
- 白城2025年吉林大安市事業(yè)單位面向上半年應(yīng)征入伍高校畢業(yè)生招聘5人筆試歷年參考題庫附帶答案詳解
- 全球人工智能產(chǎn)業(yè)發(fā)展現(xiàn)狀和趨勢
- 2025年內(nèi)蒙古化工職業(yè)學(xué)院高職單招職業(yè)技能測試近5年??及鎱⒖碱}庫含答案解析
- 民法典解讀之婚姻家庭編
- 2025年菏澤醫(yī)學(xué)??茖W(xué)校高職單招數(shù)學(xué)歷年(2016-2024)頻考點試題含答案解析
- 2025年漯河職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測試近5年??及鎱⒖碱}庫含答案解析
- Unit 2 What time is it?-A Let's spell(課件)-2024-2025學(xué)年人教PEP版英語四年級下冊
- 2024-2025學(xué)年人教版數(shù)學(xué)六年級下冊第二單元百分?jǐn)?shù)(二)(含答案)
- 創(chuàng)新教案:《歌唱二小放牛郎》在2025年音樂教學(xué)中的應(yīng)用
評論
0/150
提交評論