【正文】
設(shè)計(jì)并制作完成了超聲波油量測(cè)量儀的硬件部分,編制了相應(yīng)的運(yùn)行軟件,進(jìn)行了調(diào)試和試運(yùn)行,結(jié)果還是令人滿意的。所有的抗干擾不可能完全依靠硬件來解決,而采取軟件抗干擾措施,往往成本低,見效快,起到事半功倍的效果。由于此時(shí)單片機(jī)比較空閑,所以可以采用查詢方式進(jìn)行通訊。工作過程是:首先讓T1停止計(jì)時(shí),禁止外部中斷0中斷,然后根據(jù)T1產(chǎn)生中斷的次數(shù)以及定時(shí)器初值的變化得到超聲波的傳輸時(shí)間T,再調(diào)用計(jì)算子程序求出油量的深度和體積,并將計(jì)算結(jié)果暫存到指定單元。其結(jié)構(gòu)框圖如圖51所示 圖51 軟件設(shè)計(jì)總體框圖軟件部分共分兩大模塊,一是超聲波驅(qū)動(dòng)與數(shù)據(jù)處理模塊,二是功能模塊。圖42超聲波接收電路原理圖 8279接口電路與鍵盤顯示電路 8279接口電路設(shè)計(jì)根據(jù)硬件設(shè)計(jì)思想,在超聲波油量測(cè)量儀測(cè)量之前需要設(shè)定一些參數(shù),要有一些控制按鈕來執(zhí)行不同操作,同時(shí)有關(guān)數(shù)據(jù)需要顯示出來,即需要有顯示器和一個(gè)鍵盤陣列來實(shí)現(xiàn)這種人機(jī)對(duì)話的功能。,其驅(qū)動(dòng)能力達(dá)不到要求,所以用了一個(gè)大功率的CMOS管IRF640來驅(qū)動(dòng)超聲波傳感器的發(fā)射器。③需要有一些控制按鈕來執(zhí)行不同的操作,因此需要用到4個(gè)7段碼顯示器和一個(gè)3x4的鍵盤陣列。在超聲波油量測(cè)量儀開始測(cè)距前需要通過鍵盤輸入一些相關(guān)參數(shù),以便能按照要求計(jì)算出距離,進(jìn)而計(jì)算出油的重量、體積等數(shù)據(jù)。由于波的強(qiáng)度正比于振幅的平方,透射波的振幅已經(jīng)很小了,以后的傳播過程可以不考慮[3]。一束超聲波(視為平面波)的聲壓可表示為: (211)式中,為聲壓振幅,ρ為介質(zhì)密度,軸的正方向,ω為超聲波的圓頻率,ω=2πf,f為振動(dòng)頻率,u為介質(zhì)中聲速,φ為初相,與記時(shí)起點(diǎn)有關(guān)。從超聲波發(fā)射器發(fā)出的超聲波,經(jīng)氣體介質(zhì)的傳播到接收器的時(shí)間,就是渡越時(shí)間。動(dòng)圈式微音器的結(jié)構(gòu)為在磁場中放置帶有受音板的可動(dòng)線圈或?qū)w帶,當(dāng)它們因超聲波而運(yùn)動(dòng)時(shí),產(chǎn)生感應(yīng)電動(dòng)勢(shì),由于受音體慣性大,因而只適用于低頻。給它的兩電極加脈沖信號(hào)(觸發(fā)脈沖),當(dāng)其頻率等于晶片的固有頻率時(shí),壓電晶片就會(huì)發(fā)生共振,并帶動(dòng)共振板振動(dòng),從而產(chǎn)生超聲波。雖然一些地區(qū)使用了超聲波油量測(cè)量儀,但絕大多數(shù)是用集成電路設(shè)計(jì)成的,這種專用集成電路成本很高,沒有顯示,操作很不方便。(5)雷達(dá)液位儀連續(xù)式微波液位儀這幾年逐步推向市場。關(guān)鍵詞:超聲波 液位測(cè)量 單片機(jī) 非接觸Abstract The design for the gas station fuel tanks in the measurement problem, indepth discussion of the use of ultrasound as a signal source to carry out the feasibility of liquid level measurement and the superiority of the errors discussed a variety of reasons, the corresponding solution. AT89C52 singlechip designs to the smallest system to the core, the principle of ultrasonic distance measurement theoretical basis for the use of ultrasound on oil as a control signal for automatic detection and data processing, to reduce the measurement in the process of human intervention, provided with a display , keyboard interface of manmachine conversation and make it easier for operators of realtime monitoring of oil through the microprinter or PCmunication such as print, save the data, to better the situation on the oil storage management. Ultrasonic measurement of the fuel, low cost, simple, powerful, and traditional methods of liquid level measurement, with noncontact, high speed, high precision, automatic control, reliable and low cost advantages. Keywords: Ultrasonic liquid level measurement singlechip noncontact目錄第一章 引言 內(nèi)外液位計(jì)量儀表的現(xiàn)狀.........................................................1 1 2.............................................2.........................................................3第二章超聲波油量測(cè)量儀測(cè)量原理 4.....................................................................4 4 5 6 T/R40超聲波傳感器 7.............................................................7 7 9第三章 超聲波油量測(cè)量儀的總體設(shè)計(jì) 13....................................................................................13............................................................................................14第四章 系統(tǒng)結(jié)構(gòu)及硬件設(shè)計(jì) 15...............................................15 AT89C52單片機(jī)最小系統(tǒng)..............................................................15.......................................................................16 16 16...............................................................................17 17 18 8279接口電路與鍵盤顯示電路......................................................19 8279接口電路設(shè)計(jì) 19..................................................... 21 21 DS18B20與單片機(jī)的典型接口設(shè)計(jì) 22................................................................22第五章 軟件設(shè)計(jì) 23....................................................................................23 23 23...........................................................24 24 25............................................................................................26 26 27第六章 抗干擾處理 30................................................................................30................................................................................30結(jié) 論 32參考文獻(xiàn) 33致 謝 34第