【正文】
思考:至于為什么接收不用晶體管做放大電路呢,因為放大倍數(shù)搞不好,CX20106集成放大電路,還帶自動電平增益控制,放大倍數(shù)為76dB,中心頻率是38k到40k。可見基于單片機設(shè)計的超聲波測距系統(tǒng)具有硬件結(jié)構(gòu)簡單、工作可靠、測量誤差小等特點。如果由于障礙物過遠,超出量程,以致在T0溢出時尚未接收到回波,則顯示“ERROR”重新回到主流程進入新一輪測試。定時中斷服務(wù)子程序完成三方向超聲波的輪流發(fā)射,外部中斷服務(wù)子程序主要完成時間值的讀取、距離計算、結(jié)果的輸出等工作。四、超聲波測距系統(tǒng)的軟件設(shè)計軟件分為兩部分,主程序和中斷服務(wù)程序,如圖3(a)(b)(c) 所示。如果逆向發(fā)生在回波中,決定要不通過在低氣壓插入振幅。第五步:發(fā)射兩串脈沖產(chǎn)生干擾波。通過脈沖的周期設(shè)置下一個脈沖。第三步:檢測兩種回波的振幅與過零時間。第一步:脈沖的傳送產(chǎn)生一種簡單的超聲波。當(dāng)收到超聲波反射波時,接收電路 輸出端產(chǎn)生一個負(fù)跳變,在INT0或INT1端產(chǎn)生一個中斷請求信號,單片機響應(yīng)外部中斷請求,執(zhí)行外部中斷服務(wù)子程序,讀取時間差,計算距離。前方測距電路的輸出端接單片機INT0端口,中斷優(yōu)先級最高,左、右測距電路的輸出通過與門IC3A的輸出接單片機INT1端口,中斷源的識別由程序查詢來處理,中斷優(yōu)先級為先右后左。IC2是帶有鎖 定環(huán)的音頻譯碼集成塊LM567,內(nèi)部的壓控振蕩器的中心頻率f0=1/,電容C4決定其鎖定帶寬。右側(cè)和左側(cè)測 ,工作原理與前方測距電路相同。40kHz脈沖的產(chǎn)生與超聲波發(fā)射測距系統(tǒng)中的超聲波傳感器采用UCM40的壓電陶瓷傳感器,它的工作電壓是40kHz的脈沖信號,這由單片機執(zhí)行下面程序來產(chǎn)生。電路原理圖如圖所示。超聲波測距原理超聲波發(fā)射器向某一方向發(fā)射超聲波,在發(fā)射時刻的同時開始計時,超聲波在空氣中傳播,途中碰到障礙物就立即返回來,超聲波接收器收到反射波就立即停止計時。結(jié)果,一種錯誤便出現(xiàn)了——兩個擁有不同強度的脈沖在不同時間超過界限卻在同一時間到達。一個物體的脈沖強度很大程度上取決于這個物體的自然屬性尺寸還有它與傳感器的距離。測量脈沖到達時間的傳統(tǒng)方法是以擁有固定參數(shù)的接收信號開端為基礎(chǔ)的。當(dāng)它的兩極外加脈沖信號,其頻率等于壓電晶片的固有振蕩頻率時,壓電晶片將會發(fā)生共振,并帶動共振板振動,便產(chǎn)生超聲波。 三、詳細說明(一)超聲波測距原理 壓電式超聲波發(fā)生器原理壓電式超聲波發(fā)生器實際上是利用壓電晶體的諧振來工作的。由于參考的距離是眾所周知的聲速,比例反產(chǎn)出是利用數(shù)學(xué)以確定所期望的距離來衡量。重復(fù)率脈沖是成反比關(guān)系之間的距離發(fā)射器和接收器。間隔發(fā)射器和接收器的參考值是一個固定的參考距離,而間距之間的發(fā)射機和接收機的測量單位是有最小距離來衡量的。 綜述發(fā)明這項距離測量儀器發(fā)明是根據(jù)上述的一些條件和額外的一些基礎(chǔ)原則完成的,其中包括一個參考單位和測量單位。當(dāng)任意兩點之間的介質(zhì)是空氣時,聲音的速度取決于溫度和空氣的相對濕度。當(dāng)超聲波在兩點之間通過時,兩點之間的距離可以由波的速度乘以測量得到的在分離的兩點中波中轉(zhuǎn)的時間。據(jù)了解,兩點之間的距離可以通過測量兩點之間的行波傳播時間的決定。在過去,這已經(jīng)利用機械設(shè)備來完成,如卡鉗,微米尺等。 出版日期:1995年8月15日主審查員:. 一、背景發(fā)明本發(fā)明涉及到儀器的測量距離,最主要的是,這種儀器,其中兩點之間傳輸超聲波。在每一個單位,重復(fù)的一系列脈沖的產(chǎn)生,每有一個重復(fù)率,直接關(guān)系到各自之間的距離,發(fā)射機和接收機。 since the main program calls the display subroutine to display。 main program detects reception hallmarks of success, the temperature subroutine is called, collecting the ambient temperature when the ultrasonic ranging, and converted the accurate speed of sound stored in RAM storage unit。 T1 interrupt service routine will start a new ultrasonic transmitting, the square wave will be generated in the pin at the same time open the timer T0 timing, in order to avoid the diffraction of the direct wave, the delay 1ms and then, after the INT0 interrupt Enable。 storage results MOV A, R7 SUBB A, 3CH MOV 30H, A SETB EX0。 read the time value MOV R6, TL0 CLR C MOV A, R6 SUBB A, 0BBH。 left Ranging entrance circuit interrupt service routine Ajmp Return 3, the calculation of ultrasonic propagation time When you start firing at the same time start the singlechip circuitry within the timer T0, the use of timer counting function records the time and the launch of ultrasonic reflected wave received time. When you receive the ultrasonic reflected wave, the receiver circuit outputs a negative jump in the end of INT0 or INT1 interrupt request generates a signal, singlechip microputer in response to external interrupt request, the implementation of the external interrupt service subroutine, read the time difference, calculating the distance . Some of its source code is as follows: RECEIVE0: PUSH PSW PUSH ACC CLR EX0。 open external interrupt 1 pop acc pop psw reti right: ...。 pin to 0, ranging from right to interrupt service routine circuit jnb , left。 ret Ranging in front of singlechip termination circuit input port, single chip implementation of the above procedure, the port in a 40kHz pulse output signal, after amplification transistor T, the drive