【正文】
ET0=1。 P0=table1[x1]。} } void display() { SMG_q=0。 IT0=0。 count()。 void count()。 //定義數(shù)碼管陽(yáng)級(jí)控制腳(個(gè)位)sbit p10=P1^7。25第 25 頁(yè)致謝首先感謝我的指導(dǎo)老師劉**老師。檢測(cè)到按鈕開(kāi)啟時(shí),開(kāi)始進(jìn)行距離測(cè)量。當(dāng)我們按住播放鍵時(shí)就會(huì)播放指針?biāo)甘井?dāng)前段,在語(yǔ)音播放結(jié)束時(shí)播放指針仍然會(huì)停在剛剛播放的語(yǔ)言開(kāi)始位置。51 單片機(jī)封裝如圖 51 所示:圖 51 51系列單片機(jī)封裝圖 單片機(jī)實(shí)現(xiàn)測(cè)距原理超聲波測(cè)距的根據(jù)是根據(jù)聲波的回波特性,通過(guò)單片機(jī)不斷檢測(cè)超聲波發(fā)射后反射的回波,當(dāng)檢測(cè)到回波時(shí)時(shí)鐘電路立刻停止計(jì)時(shí),開(kāi)始計(jì)算聲波接收時(shí)刻與發(fā)射時(shí)刻的時(shí)間差 t,由于聲波在空氣介質(zhì)中的速度是固定的,我們可以根據(jù)式 S=Ct/2 計(jì)算出聲波輸出路徑的一半距離,即發(fā)射端距被測(cè)物的距離。我們一般不采用這種材質(zhì)制成的收發(fā)電路,而使用由集成電路組成的超聲波收發(fā)電路,具有小而輕、低能耗、抗外界干擾能力強(qiáng)等特點(diǎn),因此,我們選用集成電路組成的超聲波收發(fā)電路。圖 34 按鍵電路3. 5 蜂鳴器電路蜂鳴器是一種被廣泛使用的元器件,它主要被人們用于提示、報(bào)警等場(chǎng)合。9第 9 頁(yè) 復(fù)位電路實(shí)現(xiàn)單片機(jī)復(fù)位的方法有多種,一般在只要 RESET 端加一個(gè)正脈沖信號(hào)就可以很簡(jiǎn)單的實(shí)現(xiàn)復(fù)位功能,單片機(jī)復(fù)位一般分為:自動(dòng)和手動(dòng)兩種,如圖 32 手動(dòng)復(fù)位電路。傳感器構(gòu)造如下圖 21,22: 圖 21 超聲波外部結(jié)構(gòu) 圖 22 元件外部結(jié)構(gòu) 超聲波測(cè)距系統(tǒng)原理在超聲檢測(cè)電路中,發(fā)射端發(fā)送一串固定間隔的方波脈沖,用以確定聲波來(lái)回傳輸?shù)臅r(shí)間間距。超聲波在介質(zhì)中傳播會(huì)引起其內(nèi)部顆粒的運(yùn)動(dòng),盡管運(yùn)動(dòng)幅度和速率很小,但由于超聲波振動(dòng)的頻率與質(zhì)點(diǎn)加速度的平方成正比關(guān)系,這導(dǎo)致很小的振動(dòng)頻率也會(huì)有很大的加速度。防撞系統(tǒng)的性能與國(guó)外還有很大差距,距離實(shí)現(xiàn)專業(yè)化和實(shí)現(xiàn)實(shí)際應(yīng)用還要一段時(shí)間發(fā)展。超聲波測(cè)距是簡(jiǎn)單快速,容易實(shí)現(xiàn)一點(diǎn)的實(shí)時(shí)控制,滿足了日益發(fā)展的工業(yè)和人類生活活動(dòng)的要求。s safety driving assist device, the system can alarm through language and more intuitive LED display to remind the driver pay attention to safety, to improve the safety of parking.Hardware part of this design is mainly posed of main control circuit and ultrasonic transmitting circuit, receiving circuit circuit position, as well as the auxiliary display circuit, voice alarm circuit and power circuit, software part by ultrasonic transceiver subprogram, timer subroutine and display subroutine and voice alarm subroutine and other parts. Due to the propagation velocity of ultrasonic wave in air is fixed, therefore this design by STC89C51 single chip microputer to calculate the roundtrip time of ultrasound from launch to be accepted, and transmission distance is calculated to achieve the purpose of realtime measuring distance. Circuit design part of the design is simple and reasonable, superior performance, stable operation range fast puting method is simple, and easy to achieve the purpose of realtime monitoring, and reached the industrial measurement error on the practical requirements.Keywords: STC89C51, ultrasonic, digital tube, voice alarmIII第 III 頁(yè)目錄第一章 緒論 ...........................................................................................................................................1 課題研究的現(xiàn)狀和發(fā)展歷史及意義 ............................................................................................1 汽車防撞系統(tǒng)的發(fā)展現(xiàn)狀 ............................................................................................................2 本課題的主要研究?jī)?nèi)容 ................................................................................................................2第二章 超聲波測(cè)距的原理 .....................................................................................................................4 超聲波的基本理論 ........................................................................................................................4 超聲波的傳播速度 ................................................................................................................4 超聲波對(duì)聲場(chǎng)產(chǎn)生的作用 ....................................................................................................4 超聲波傳感器 ................................................................................................................................5 超聲波測(cè)距系統(tǒng)原理 ....................................................................................................................5 測(cè)量與控制方法 .............................................................................................................................6 控制系統(tǒng)方框圖 ............................................................................................................................6第三章 單片機(jī)主機(jī)系統(tǒng)電路 .................................................................................................................8 單片機(jī)主電路 ................................................................................................................................8 復(fù)位電路 ........................................................................................................................................93. 3 時(shí)鐘電路 .......................................................................................................................................93. 4 按鍵電路 .....................................................................................................................................103. 5 蜂鳴器電路 ..........................................................