【正文】
距離的變化而變化。由于采用的是12MHZ的晶振,計(jì)數(shù)器每記一個(gè)數(shù)就是1μs,當(dāng)主程序檢測(cè)到接受成功的標(biāo)志位后,將計(jì)數(shù)器T0中的數(shù)(即超聲波往返所用的時(shí)間)按式()計(jì)算,即可得被測(cè)物體與測(cè)距離之間的距離,設(shè)計(jì)時(shí)取20℃時(shí)的聲速344m/s,則有 D=(vt)/2=172T0/10000cm ()其中:T0為計(jì)數(shù)器T0的計(jì)數(shù)值。通常的PCB板,包括頂層、底層和中間層,層與層之間是絕緣層,用于隔離布線層。在電路設(shè)計(jì)的整個(gè)過程中,圖紙的大小都可以不斷的調(diào)整,設(shè)置合適的圖紙大小是完成原理圖設(shè)計(jì)的第一步。而在共陰極接法中,剛好與共陽極接法相反。當(dāng) CX20106A 接收到40KHz的信號(hào)時(shí),會(huì)在第7腳產(chǎn)生一個(gè)低電平下降脈沖,這個(gè)信號(hào)可以接到單片機(jī)的外部中斷引腳作為中斷信號(hào)輸入。1腳:超聲信號(hào)輸入端,該腳的輸入阻抗約為40KΩ。也有一些遙控系統(tǒng)采用36KHz、40KHz、56KHz等,一般由發(fā)射端晶振的振蕩頻率來決定。穩(wěn)壓電路的作用是采取措施使輸出的直流電壓在電網(wǎng)電壓或負(fù)載電流發(fā)生變化時(shí)保持穩(wěn)定。這時(shí)要求對(duì)環(huán)境噪聲進(jìn)行頻譜分析,盡量避免與噪聲頻率重疊。而使用雙探頭方式,不僅可以增加探測(cè)距離,還可以減小盲區(qū)。本文主要用的是脈沖檢測(cè)法它是一種對(duì)有回波信號(hào)經(jīng)檢測(cè)電路產(chǎn)生的脈沖進(jìn)行檢測(cè)的方法。因此,超聲波接收器應(yīng)于輸入阻抗高的前置放大器配合使用,才能有較高的接收靈敏度。如電場(chǎng)反向,則形變亦相反。在聲速已知的介質(zhì)中,可以利用身波傳播距離L和傳播時(shí)間t的關(guān)系L=vt,進(jìn)行超聲測(cè)距,超聲液位計(jì)和超聲測(cè)厚計(jì)就是這方面的典型應(yīng)用。在科學(xué)史上,聲學(xué)是發(fā)展最早的學(xué)科之一。我國(guó)在該領(lǐng)域的發(fā)展相對(duì)國(guó)外還有很大差距,普遍存在產(chǎn)品性能指標(biāo)低、儀表可靠性差、企業(yè)技術(shù)力量及裝備差等問題。該系統(tǒng)可實(shí)現(xiàn)4米內(nèi)測(cè)距,盲區(qū)20厘米。和其他方法相比,如激光測(cè)距、微波測(cè)距等,由于聲波在空氣中傳播速度遠(yuǎn)遠(yuǎn)小于光線和無線電波的傳播速度,對(duì)于時(shí)間測(cè)量精度的要求遠(yuǎn)小于激光測(cè)距、微波測(cè)距等系統(tǒng),因而超聲波測(cè)距系統(tǒng)電路易實(shí)現(xiàn)、結(jié)構(gòu)簡(jiǎn)單和造價(jià)低,且超聲波在傳播過程中不受煙霧、空氣能見度等因素的影響,在各種場(chǎng)合均得到廣泛應(yīng)用??蓛?chǔ)存2個(gè)測(cè)量數(shù)據(jù)或計(jì)算結(jié)果,可計(jì)算面積和體積。根據(jù)聲波振動(dòng)頻率的范圍,可以分為次聲波、聲波、超聲波和特超聲波。由物理學(xué)可知,當(dāng)波在界面上產(chǎn)生反射時(shí),入射角的正弦之比等于波速之比,當(dāng)入射波和反射波的波型相同時(shí),波速相同,入射角度等于反射角。將適當(dāng)?shù)慕蛔冸娦盘?hào)施加到晶體上,品體將發(fā)生交替的壓縮和拉伸,因而產(chǎn)生振動(dòng),振動(dòng)頻率與交變電壓的頻率相同,若把晶體藕合到彈性介質(zhì)中,晶體將充當(dāng)一個(gè)超聲源的作用,超聲波將被輻射到那種介質(zhì)中。指向特性用指向圖表示。利用查詢或者中斷的方法便可以檢測(cè)出這些脈沖,便于測(cè)量出發(fā)射到接收到脈沖的時(shí)間。所以,在本實(shí)驗(yàn)中,我們選取了雙探頭的工作方式,減小盲區(qū),同時(shí)提高檢測(cè)的距離精度。單片機(jī)通過INT0引腳來控制超聲波的發(fā)送,然后單片機(jī)不停的檢測(cè)INT1引腳,當(dāng)INT0引腳的電平由高電平變?yōu)榈碗娖綍r(shí)就認(rèn)為超聲波已經(jīng)返回。 微處理器電路原理圖 微處理器的時(shí)鐘可以由兩種方式產(chǎn)生,一種是內(nèi)部方式,利用芯片內(nèi)部的振蕩電路;另一種方式為外部方式。主電源引腳(2根)VCC(Pin20):電源輸入,接+5V電源GND(Pin10):接地線外接晶振引腳(2根)XTAL1(Pin5):片內(nèi)振蕩電路的輸入端XTAL2(Pin4):片內(nèi)振蕩電路的輸出端控制引腳(1根)RST:復(fù)位引腳 可編程輸入/輸出引腳(15根)P1口: 8位準(zhǔn)雙向I/O口線,~,共8根 P3口: 8位準(zhǔn)雙向I/O口線,~、共7根芯片特點(diǎn):增強(qiáng)型1T流水線/精簡(jiǎn)指令集結(jié)構(gòu)8051 CPU;工作電壓:~~;工作頻率范圍:035 MHz,相當(dāng)于普通8051的0~420MHz;用戶應(yīng)用程序空間512/1K/2K/3K/4K/5K字節(jié);片上集成256字節(jié)RAM;15個(gè)通用I/O口,復(fù)位后為:準(zhǔn)雙向口/弱上拉可設(shè)置成四種模式:準(zhǔn)雙向口/弱上拉,推挽/強(qiáng)上拉,僅為輸入/高阻,開漏;EEPROM功能;共2個(gè)16位定時(shí)器/計(jì)數(shù)器;PWM(2路)/PCA(可編程計(jì)數(shù)器陣列);ADC,8路8位精度;.通用異步串行口(UART);SPI同步通信口,主模式/從模式;看門狗;內(nèi)部集成R/C振蕩器,精度要求不高時(shí)可省外部晶體;.ISP/IAP;工作溫度范圍:0~75℃/40~85℃;.封裝:PDIP20,SOP20(寬體),TSSOP20(超小封狀)。典型應(yīng)用電路如圖所示,其主要功能是從40kHz紅外載波信號(hào)中,將編碼信號(hào)解調(diào)出來,并加以放大和整形,然后再送到微處理器(CPU)進(jìn)行處理,以實(shí)現(xiàn)遙控操作功能。但C1的改變會(huì)影響到頻率特性,一般在實(shí)際使用中不必改動(dòng),推薦選用參數(shù)為R1=,C1=1μF。大家知道,電感對(duì)高頻信號(hào)的阻抗是很大的,所以,大電容的高頻性能不好。靜態(tài)驅(qū)動(dòng)是指每個(gè)數(shù)碼管的每一個(gè)段碼都由一個(gè)單片機(jī)的I/O端口進(jìn)行驅(qū)動(dòng),或者使用如BCD碼二十進(jìn)制譯碼器譯碼進(jìn)行驅(qū)動(dòng)。4)原理圖的布線。對(duì)于雙面板或者多面板,防焊層分為頂面防焊層和底面防焊層兩種。 系統(tǒng)初始化發(fā)射脈沖延時(shí)250μs,保證一個(gè)40KHZ的脈沖計(jì)時(shí)器開始計(jì)時(shí),開中斷等待INT1中斷,即收反射回波信號(hào)讀計(jì)數(shù)器計(jì)時(shí)值,讀取串口速度值計(jì)算距離顯示測(cè)量結(jié)果開始大于設(shè)定值?顯示 是否 主程序流程圖 子程序流程圖 。 誤差分析聲波傳輸速度與媒介的彈性模量和密度相關(guān),因此,利用聲速測(cè)量距就要考慮這些因素對(duì)聲速影響。,如溫度變化不大,則可認(rèn)為聲速是基本不變的。(3)在系統(tǒng)硬件設(shè)計(jì)的基礎(chǔ)上,對(duì)系統(tǒng)的軟件需要實(shí)現(xiàn)的功能進(jìn)行了分析,設(shè)計(jì)了系統(tǒng)的主程序流程,分析各個(gè)中斷程序和主程序之間的關(guān)系,用匯編語言和C語言逐個(gè)實(shí)現(xiàn)了各自的功能模塊。s characteristic. Practically all acoustic arrangements presently known for checking distances use a method of measuring the propagation time for certain information samples from the radiator to the reflecting member and back.The unmodulated acoustic(ultrasonic)vibrations radiated by a transducer are not in themselves a source of order to transmit some informational munication that can then be selected at the receiving end after reflection from the test member,the radiated vibrations must be this case the ultrasonic vibrations are the carrier of the information which lies in the modulation signal,.,they are the means for establishing the spatial contact between the measuring instrument and the object being measured.This conclusion,however,does not mean that the analysis and selection of parameters for the carrier vibrations is of minor the contrary,the frequency of the carrier vibrations is linked in a very close manner with the coding method for the informational munication,with the passband of the receiving and radiating elements in the apparatus,with the spatial characteristics of the ultrasonic munication channel,and with the measuring accuracy.Let us dwell on the questions of general importance for ultrasonic ranging in air,namely:on the choice of a carrier frequency and the amount of acoustic power received.An analysis shows that with conical directivity diagrams for the radiator and receiver,and assuming that the distance between radiator and receiver is substantially smaller than the distance to the obstacle,the amount of acoustic power arriving at the receiving area Pr for the case of reflection from an ideal plane surface located at right angles to the acoustic axis of the transducer es to (1)where Prad is the amount of acoustic power radiated,B is the absorption coefficient for a plane wave in the medium,L is the distance between the electroacoustic transducer and the test me mber,d is the diameter of the radiator(receiver),assuming they are equal,and c~is the angle of the directivity diagram for the electroacoustic transducer in the radiator. Both in Eq.(1)and below,the absorption coefficient is dependent on the amplitude and not on the intensity as in some works[1],and therefore we think it necessary to stress this difference.In the various problems of sound ranging on the test members of machines and structures,the relationship between the signal attenuations due to the absorption of a planewave and due to the geometrical properties of the sound beam are,as a rule,quite must be pointed out that the choice of the geometrical parameters for the beam in specific practical cases is dictated by the shape of the reflecting surface and its spatial distortion relative to some average position.Let us consider in more detail the relationship betweenthe geometric and the power parameters of acoustic beams for the most mon cases of ranging on plane and cylindrical structural members.It is well known that the directional characteristic W of a circular piston vibrating in an infinite baffle is a function of the ratio