資源描述:
《基于超聲波的液位測距系統(tǒng)設計_畢業(yè)設計論文》由會員上傳分享,免費在線閱讀,更多相關內容在學術論文-天天文庫。
1、基于超聲波的液位測距系統(tǒng)設計摘要本文是利用超聲波測距的原理而設計的一種液位測距系統(tǒng)。該系統(tǒng)采用STC12C5A08S2單片機為核心控制器,并為超生測距模塊提供觸發(fā)控制信號,在發(fā)射超聲波的同時,啟動單片機的內部定時器開始計時,超聲波在空氣中傳播遇到障礙物后反射回波,超聲波接收電路檢測到回波信號時停止計時,則根據公式:S=Vt/2即可計算出液位距離。文中設計的系統(tǒng)著重解決了超聲波測距的時間計算和溫度補償問題。其中通過溫度傳感器將溫度值采集到單片機中,經過一定的數值修正即可得到當時溫度值下的超聲波傳播速度V。本文采用了硬件和軟件相結合的設計方法,在軟件方面,采用了匯編語言進行程序編寫。在數據處理
2、上充分利用匯編語言的查表優(yōu)勢,建立了速度修正值表和數碼管顯示值表,可以便捷、明了地進行數據處理和顯示。關鍵詞:超聲波測距STC12C5A08S2溫度補償液位測距系統(tǒng)IIITitleDesignofliquidlevelbasedonultrasonicdistancemeasurementsystemAbstractThisarticledesignsaliquidlevelmeasurementsystemwhichisbasedontheprincipleofultrasonicdistancemeasurement.ThesystemtakesSTC12C5A08S2asthecor
3、eofthesystemcontroller.TheSCMprovidescontrolsignalsforultrasonicdistancemeasurementmodules,andstartsthemonolithicintegratedcircuitinternaltimertoworkwhileemittingultrasonic.Ultrasonicreflectionechoafterthecommunicationobstaclesintheair,andtheSCMstopstimingwhentheechosignalisdetectedbytheultrasonic
4、receiver.Accordingtotheformula:S=Vt/2,theliquidleveldistanceiscalculated.Thesystemisdesignedtofocusonthetimeandtemperaturecompensationofultrasonicdistancemeasurement.ThetemperaturevalueiscollectedintheSCMthroughthetemperaturesensor,undergoingacertainnumericalcorrectiontogettheultrasonicwavepropaga
5、tionvelocityunderthetemperature.Thisarticleusesacombinationofhardwareandsoftwaredesign.Insoftware,weuseassemblylanguagetoprogram.FulluseofAssemblylanguagereferencetableadvantagesindataprocessing,weestablishedthespeedcorrectiontableandthedigitaldisplayvaluestablewhichcanbeconvenientandclearfordatap
6、rocessinganddisplay.Keywords:Ultrasonicdistance-measuring;STC12C5A08S2;Temperaturecompensation;LiquidlevelmeasurementsystemIII目錄1引言11.1測距在工業(yè)方面的應用11.2現有的測距方法及其優(yōu)缺點11.3超聲波測距的原理及優(yōu)點21.4課題研究的意義22總體方案論證22.1系統(tǒng)方案簡化32.2系統(tǒng)軟件設計說明43系統(tǒng)硬件電路設計43.1HC—SR04超聲波測距模塊簡介43.2單片機的選型(STC12C5A08S2)63.3顯示電路的設計93.4溫度傳感器的選型104系
7、統(tǒng)軟件設計114.1主程序設計124.2子程序設計134.3數碼管顯示程序185系統(tǒng)調試與分析19結論21致謝22參考文獻23附錄A匯編程序清單24圖一系統(tǒng)完整電氣原理圖26III1引言1.1測距在工業(yè)方面的應用在現代工業(yè)現場,測距技術的應用可以說是無處不在。在水利水電、污水處理領域,利用測距技術可對水面高度實現實時監(jiān)測。在冶金、物料液位、管道等不宜直接接觸的場合,非接觸式測量技術發(fā)揮了重要作用。激光測距技術作為非接觸式