【正文】
s nature, size and distance from the sensor. Further, the time interval from the echo39。s two plus pulse signal, the frequency equal to the intrinsic piezoelectric oscillation frequency chip, the chip will happen piezoelectric resonance, and promote the development of plate vibration resonance, ultrasound is generated. Conversely, if the two are not interelectrode voltage, when the board received ultrasonic resonance, it will be for vibration suppression of piezoelectric chip, the mechanical energy is converted to electrical signals, then it bees the ultrasonic receiver. The traditional way to determine the moment of the echo39。s standard of living, speeding up the development and construction of the city. urban drainage system have greatly developed their situation is constantly improving. However, due to historical reasons many unpredictable factors in the synthesis of her time, the city drainage system. In particular drainage system often lags behind urban construction. Therefore, there are often good building excavation has been building facilities to upgrade the drainage system phenomenon. It brought to the city sewage, and it is clear to the city sewage and drainage culvert in the sewage treatment system. fort is very important to people39。思考:至于為什么接收不用晶體管做放大電路呢,因?yàn)榉糯蟊稊?shù)搞不好,集成放大電路,還帶自動(dòng)電平增益控制,放大倍數(shù)為76dB,中心頻率是38k到40k,剛好是超聲波傳感器的諧振頻率 ??梢娀趩纹瑱C(jī)設(shè)計(jì)的超聲波測距系統(tǒng)具有硬件結(jié)構(gòu)簡單、工作可靠、測量誤差小等特點(diǎn)。定時(shí)中斷服務(wù)子程序完成三方向超聲波的輪流發(fā)射,外部中斷服務(wù)子程序主要完成時(shí)間值的讀取、距離計(jì)算、結(jié)果的輸出等工作。超聲波測距系統(tǒng)的軟件設(shè)計(jì)軟件分為兩部分,主程序和中斷服務(wù)程序。如果逆向發(fā)生在回波中,決定要不通過在低氣壓插入振幅。第五步:發(fā)射兩串脈沖產(chǎn)生干擾波。通過脈沖的周期設(shè)置下一個(gè)脈沖。第三步:檢測兩種回波的振幅與過零時(shí)間。第一步:脈沖的傳送產(chǎn)生一種簡單的超聲波。當(dāng)收到超聲波反射波時(shí),接收電路 輸出端產(chǎn)生一個(gè)負(fù)跳變,在INT0或INT1端產(chǎn)生一個(gè)中斷請(qǐng)求信號(hào),單片機(jī)響應(yīng)外部中斷請(qǐng)求,執(zhí)行外部中斷服務(wù)子程序,讀取時(shí)間差,計(jì)算距離。調(diào)節(jié)R8在發(fā)射的載頻上,則LM567 輸入信號(hào)大于25mV,輸出端8腳由高電平躍變?yōu)榈碗娖?,作為中斷?qǐng)求信號(hào),送至單片機(jī)處理.前方測距電路的輸出端接單片機(jī)INT0端口,中斷優(yōu)先級(jí)最高,左、右測距電路的輸出通過與門IC3A的輸出接單片機(jī)INT1端口,中斷源的識(shí)別由程序查詢來處理,中斷優(yōu)先級(jí)為先右后左。接收頭采用與發(fā)射頭配對(duì)的UCM40R,將超聲波調(diào)制脈沖變?yōu)榻蛔冸妷盒盘?hào),經(jīng)運(yùn)算放大器IC1A和IC1B兩極放大后加至IC2。puzel: mov 14h, 12h;超聲波發(fā)射持續(xù)200mshere: cpl ; 輸出40kHz方波 nop ; nop ; nop ; djnz 14h,here; ret,單片機(jī)執(zhí)行上面的程序后, 端口輸出一個(gè)40kHz的脈沖信號(hào),經(jīng)過三極管T放大,驅(qū)動(dòng)超聲波發(fā)射頭UCM40T,發(fā)出40kHz的脈沖超聲波,且持續(xù)發(fā)射200ms。電路原理圖如圖1所示。超聲波發(fā)射器向某一方向發(fā)射超聲波,在發(fā)射時(shí)刻的同時(shí)開始計(jì)時(shí),超聲波在空氣中傳播,途中碰到障礙物就立即返回來,超聲波接收器收到反射波就立即停止計(jì)時(shí)。結(jié)果,一種錯(cuò)誤便出現(xiàn)了——兩個(gè)擁有不同強(qiáng)度的脈沖在不同時(shí)間超過界限卻在同一時(shí)間到達(dá)。一個(gè)物體的脈沖強(qiáng)度很大程度上取決于這個(gè)物體的自然屬性尺寸還有它與傳感器的距離。測量脈沖到達(dá)時(shí)間的傳統(tǒng)方法是以擁有固定參數(shù)的接收信號(hào)開端為基礎(chǔ)的。當(dāng)它的兩極外加脈沖信號(hào),其頻率等于壓電晶片的固有振蕩頻率時(shí),壓電晶片將會(huì)發(fā)生共振,并帶動(dòng)共振板振動(dòng),便產(chǎn)生超聲波。超聲波測距原理 壓電式超聲波發(fā)生器實(shí)際上是利用壓電晶體的諧振來工作的??刂葡到y(tǒng)核心部分就是超聲波測距儀的研制。城市污水給人們帶來了困擾,因此箱涵的排污疏通對(duì)大城市給排水系統(tǒng)污水處理,人們生活舒適顯得非常重要。但是,由于歷史原因合成時(shí)間住的許多不可預(yù)見因素,城市給排水系統(tǒng),特別是排水系統(tǒng)往往落后于城市建設(shè)。為了進(jìn)一步提高測距的精確度,滿足工程人員對(duì)測量精度、測距量程和測距儀使用的要求,本文研制了一套基于單片機(jī)的便攜式超聲測距系統(tǒng)。 }}元件清單CommentDesignatorLibRefQuantity10K 電阻R14RES2110uF 電容C1Cap Pol1112M 晶振Y116M1D 指示燈D1D1DS04 數(shù)碼管DS1DS041Header 2 電源接口P2Header 21sw灰色 電源開關(guān)SW1sw灰色1U1 單片機(jī)U1U11蜂鳴器B1BELL18550 三極管Q52N3906120 電容C2, C3CAP2Header 4 超聲波接口J1, P1Header 42SWPB 獨(dú)立按鍵S1, S2, S3, S4SWPB48550 三極管Q1, Q2, Q3, Q42N390642K 電阻R4, R5, R6, R7, R13, R15RES26200 電阻R1, R2, R3, R8, R9, R10, R11, R12RES28焊接實(shí)物圖附件2 中英文翻譯中文翻譯超聲測距系統(tǒng)設(shè)計(jì)原文出處:傳感器文摘 布拉福德:1993年 第13頁摘 要:超聲測距技術(shù)在工業(yè)現(xiàn)場、車輛導(dǎo)航、水聲工程等領(lǐng)域都具有廣泛的應(yīng)用價(jià)值,目前已應(yīng)用于物位測量、機(jī)器人自動(dòng)導(dǎo)航以及空氣中與水下的目標(biāo)探測、識(shí)別、定位等場合。 if(value = 150) { value = 0。 //2ms display()。 //定時(shí)2ms中斷一次 TH1 = 0xf8。 //按鍵函數(shù) if(key_can 10) { key_with()。 //測距離函數(shù) if(menu_1 == 0) smg_display()。 clock_h_l()。 //測距離函數(shù) send_wave()。 //定時(shí)器初始化程序 init_eeprom()。 //測距離函數(shù) smg_display()。 P0 = P1 = P2 = P3 = 0xff。 //允許定時(shí)器1定時(shí) }/***************主函數(shù)*****************/void main(){ beep = 0。 //允許定時(shí)器0定時(shí) ET1 = 1。 //定時(shí)器0、定時(shí)器1工作方式1 ET0 = 0。 // } } }/*********************定時(shí)器0、定時(shí)器1初始化******************/void time_init() { EA = 1。 //讀出定時(shí)器0的時(shí)間 distance *= 。 } } if(flag_csb_juli == 1) { TR0=0。 break 。 flag_csb_juli = 2。 while(c_recive) //當(dāng)c_recive為1計(jì)數(shù)并等待 { flag_time0 = TH0 * 256 + TL0。 //關(guān)定時(shí)器0定時(shí) while(!c_recive)。 //給定時(shí)器0清零 TL0 = 0。 c_send = 0。 }/*********************超聲波測距程序*****************************/void send_wave(){ c_send = 1。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 //段選 }/******************小延時(shí)函數(shù)*****************/void delay(){ _nop_()。 smg_we_switch(i)。 i++。 break。 smg_we3 = 1。 case 3: smg_we1 = 1。 smg_we4 = 1。 smg_we2 = 1。 break。 smg_we3 = 1。 case 1: smg_we1 = 1。 smg_we4 = 1。 smg_we2 = 1。 beep = 1。 //消除實(shí)際距離在設(shè)定距離左右變化時(shí)的干擾 if(value = 2) { beep = ~beep。 //保存數(shù)據(jù) } } /****************報(bào)警函數(shù)***************/void clock_h_l(){ static uchar value。 //取十位顯示 dis_smg[3] = 0x60。 //取個(gè)位顯示 dis_smg[2] = smg_du[set_d / 100 % 10] amp。 } dis_smg[0] = smg_du[set_d % 10]。 } if(key_can == 3) { set_d 。 }/****************按鍵處理顯示函數(shù)***************/void key_with(){ if(menu_1 == 1) //設(shè)置報(bào)警 { if(key_can == 2) { set_d ++ 。 break。 break。 break。 switch(P2 amp。amp。 //按鍵消抖動(dòng) if(((P2 amp。 if((P2 amp。 key_can = 20。 //保存數(shù)據(jù) } }/********************獨(dú)立按鍵程序*****************/uchar key_can。 a_a = 1。}/**************開機(jī)自檢eeprom初始化*****************/void init_eeprom(){ read_eeprom()。 set_d |= byte_read(0x2000)。 }/******************把數(shù)據(jù)從單片機(jī)內(nèi)部eeprom中讀出來*****************/void read_eeprom(){ set_d = byte_read(0x2001)。 byte_write(0x2001, set_d / 256)。 }/******************把數(shù)據(jù)保存到單片機(jī)內(nèi)部eeprom中******************/void write_eeprom(){ SectorErase(0x2000)。 0xdf。 dis_smg[1] = smg_du[distance / 10 % 10]。j++)。i++) for(j=0。 for(i=0。 //用來保存定時(shí)器0的時(shí)候的uchar menu_1。 //距離uchar flag_csb_juli。long distance。 //蜂鳴器IO口定義uchar smg_i = 3。 //超聲波發(fā)射sbit c_recive = P3^3。sbit smg_we4 = P3^7。 //數(shù)碼管位選定義