【正文】
p。 SCL=1。 } void start()///////啟動(dòng)信號(hào) { SDA=1。 } void display_m(uchar m)//////顯示儲(chǔ)存的序號(hào) { write(0x80+0x40+14,0)。 write(0x80+0x40,0)。 } void text_time_display(uint a) //////測(cè)試次數(shù)顯示函數(shù) 河南工程學(xué)院畢業(yè)設(shè)計(jì) 32 { write(0x80+10,0)。 } void begin2_display()////開(kāi)機(jī)顯示 Tel:13312912925 : { write(0x80,0)。 write(0x80,0)。 河南工程學(xué)院畢業(yè)設(shè)計(jì) 31 E=1。 RW=1。 delay(15)。 char s,c,i=1,m[10]。 //1602 的使能端 sbit BF=P0^7。 河南工程學(xué)院畢業(yè)設(shè)計(jì) 25 參考文獻(xiàn) [1] 吳金戌 . 沈慶陽(yáng) . 郭庭 . 《 8051 單片機(jī)實(shí)踐與應(yīng)用》 , 清華大學(xué)出版社 , 2021 年 4 月版 ; [2] 李建忠 . 《單片機(jī)原理及應(yīng)用》 , 西安電子科技大學(xué)出版社 , 2021 年版 ; [3] 張金鐸 . 《傳感器用其應(yīng)用》 , 西安電子科技大學(xué)出版社 , 2021 年版 ; [4] 求是科技 . 《單片機(jī)典型外圍器件及應(yīng)用實(shí)例》 , 人民郵電出版社 , 2021 年版 ; [6] 應(yīng)崇福 . 《超聲學(xué)》 , 北京科學(xué)出版社 1990 年版 ; [7] 甕嘉民 . 單片機(jī)應(yīng)用開(kāi)發(fā)技術(shù) — 基于 PROTEUS 仿真和 C 語(yǔ)言編程,中國(guó)電力出版社, 2021 年版 ; 河南工程學(xué)院畢業(yè)設(shè)計(jì) 26 附錄 附錄 1 系統(tǒng)原理圖 河南工程學(xué)院畢業(yè)設(shè)計(jì) 27 附錄 2 系統(tǒng) PCB 圖 河南工程學(xué)院畢業(yè)設(shè)計(jì) 28 附錄 3 系統(tǒng)程序 ///////////////////////////////////////////////////////////// ////////河南工程學(xué)院 //電氣信息工程系 //微電子技術(shù) ///////////// //////// 超聲波測(cè)距 ///張曉光 /////2021 年 5 月 ////////////////// ///////////////////////////////////////////////////////////// include define uchar unsigned char define uint unsigned int 河南工程學(xué)院畢業(yè)設(shè)計(jì) 29 sbit WP =P1^0。時(shí) ,系統(tǒng)測(cè)量到的距離是障礙物與換能器之間的距離而不是和測(cè)量參考平面之間的距離 ,這就會(huì)造成測(cè)量誤差。 respons()。 } uchar read_add(uchar address)//指定地址讀一個(gè)字節(jié)數(shù)據(jù) { uchar dd。 } void write_add(uchar address,uchar date)//指定地址寫(xiě)一個(gè)字節(jié)數(shù)據(jù) { 河南工程學(xué)院畢業(yè)設(shè)計(jì) 21 start()。 delay(5)。 WP=0。 SDA=CY。 } void writebyte(uchar date)/////寫(xiě)一個(gè)字節(jié) { uchar i,temp。 } void respons()////////回應(yīng)信號(hào) { uchar i=0。 SDA=0。 SCL=1。每個(gè)接到 I2C 總線(xiàn)上的器件都有唯一的地址。 } /////////////////////////////////////////////////////////////////////////// 四、數(shù)據(jù)存儲(chǔ)電路及程序 系統(tǒng)提供 M1M9總共 9個(gè)數(shù)據(jù)保存, key2 鍵是上翻 M1M9, key3 鍵是下翻 M1M9, key1鍵是測(cè)距鍵,每當(dāng)按下 key1 鍵,系統(tǒng)測(cè)距一次,測(cè)距后的數(shù)據(jù)保存在當(dāng)前液晶顯示的 M單元(上下鍵選擇)中,系統(tǒng)可以顯示用戶(hù)開(kāi)機(jī)后總共的測(cè)距次數(shù),本系統(tǒng)還提供了開(kāi)機(jī)或復(fù)位后,系統(tǒng)自動(dòng)的跳轉(zhuǎn)到關(guān)機(jī)前狀態(tài)。c++)write(result[c+16],1)。 write(0x30+(a%10),1)。c++)write(begin2[c],1)。c++)write(begin1[c],1)。 } void init1602() ////////1602 初始化程序 { write(0x38,0)。 E=0。并且 1602 可以顯示更多的字符,可以更加直觀的讓用戶(hù)了解系統(tǒng)的相關(guān)參數(shù),方便于用戶(hù)的操作。 Trig=0。 注意事項(xiàng):測(cè)距時(shí),被測(cè)物體的面積不少于 平方米且盡量要求平整,否則影響測(cè)量結(jié)果。測(cè)試距離 =(高電平時(shí)間 *聲速) /2 ; 實(shí)物如下圖所示 。 write(0x72,1)。 } if(key(exam)) ///測(cè)試距離 { text()。 display_s(m[i])。 for(c=0。c5。然后系統(tǒng)提供用 24c02 保存測(cè)試數(shù)據(jù),用 1602 顯示測(cè)試數(shù)據(jù)和測(cè)試次數(shù)。 超聲波測(cè)距系統(tǒng)的一般結(jié)構(gòu)如圖 31所示。本設(shè)計(jì)采用往返時(shí)間檢測(cè)法測(cè)距。電氣方式包括壓電型、磁致伸縮型和電動(dòng)型 等;機(jī)械方式有加爾統(tǒng)笛、液哨和氣流旋笛等。與傳統(tǒng)超聲技術(shù)完全不同,新的 超聲技術(shù)具有以下特點(diǎn):在不破壞媒質(zhì)特性的情況下實(shí)現(xiàn)非接觸性測(cè)量,環(huán)境適應(yīng)能力強(qiáng),可實(shí)現(xiàn)在線(xiàn)測(cè)量。超聲波與一般聲波比較,它的振動(dòng)頻率高,而且波長(zhǎng)短,因而具有束射特性,方向性強(qiáng),可以定向傳播,其能量遠(yuǎn)遠(yuǎn)大于振幅相同的一般聲波,并且具有很高的穿透能力。超聲波測(cè)距系統(tǒng),就是為機(jī)器人了解其前方、左側(cè)和右側(cè)的環(huán)境而提供一個(gè)運(yùn)動(dòng)距離信息。超聲波測(cè)距相對(duì)其他測(cè)距技術(shù)而言成本低廉 ,測(cè)量精度較高 ,不受環(huán)境的限制 ,應(yīng)用方便,將它與紅外、灰度傳感器等結(jié)合共同實(shí)現(xiàn)機(jī)器人尋線(xiàn)和繞障功能。對(duì)于測(cè)距系統(tǒng)的一些主要參數(shù)進(jìn)行了討論。 關(guān)鍵詞: 超聲波 測(cè)距 AT89S52 E2PROM 河南工程學(xué)院畢業(yè)設(shè)計(jì) 2 Abstract With the rapid development of science and technology, ultrasonic sensor will be used more and more , the present level of technology, people can use the specific sensor technology is also very limited, it is a booming and there are unlimited prospects for technical and industrial ahead, the ultrasonic sensor is very important as a new useful tool in all aspects will have a huge space for development, it will be more towards the direction of high positioning accuracy to meet the growing needs of the munity, such as the Audioaccept the basic trends are: development of a higher positioning accuracy of passive ranging sonar, underwater weapons, in order to meet the needs of all covert attacks。但就目前技術(shù)水平來(lái)說(shuō),人們可以具體利用的傳感技術(shù)還十分有限,因此,這是一個(gè)正在蓬勃發(fā)展而又有無(wú)限前景的技術(shù)及產(chǎn)業(yè)領(lǐng)域。 effort to reduce the submarine from the noise and improve the working environment of submarine is no doubt that the future automation of ultrasonic sensors and intelligent integration with other sensor integration and fusion, the formation of technological advances in sensors, sensor development from a simple function to determine a learning function and, ultimately, to be the new century, new look of the sensor will play a bigger role. Key words: Ultrasonic Wave Distance Measuring AT89S52 E2PROM 河南工程學(xué)院畢業(yè)設(shè)計(jì) 3 目 錄 前 言 ............................................................................................................................................. 1 第一章 超聲波測(cè)距概述 ...................................................................................................... 2 第二節(jié) 超聲波檢測(cè)的發(fā)展 .................................................................................................. 2 第二節(jié) 超聲波測(cè)距特性 ............................................................................................