超聲波測(cè)距系統(tǒng)的設(shè)計(jì).doc
超聲波測(cè)距系統(tǒng)的設(shè)計(jì),2.89萬字 45頁(yè) 摘要:超聲波是指頻率在20khz以上的聲波,它屬于機(jī)械波的范疇。超聲波也遵循一般機(jī)械波在彈性介質(zhì)中的傳播規(guī)律,如在介質(zhì)的分界面處發(fā)生反射和折射現(xiàn)象,在進(jìn)入介質(zhì)后被介質(zhì)吸收而發(fā)生衰減等。正是因?yàn)榫哂羞@些性質(zhì),使得超聲波可以用于距離的測(cè)量中。隨著科技水平的不斷提高,超聲波測(cè)距技術(shù)被...
內(nèi)容介紹
此文檔由會(huì)員 csfujixie 發(fā)布超聲波測(cè)距系統(tǒng)的設(shè)計(jì)
2.89萬字 45頁(yè)
摘要:超聲波是指頻率在20kHz以上的聲波,它屬于機(jī)械波的范疇。超聲波也遵循一般機(jī)械波在彈性介質(zhì)中的傳播規(guī)律,如在介質(zhì)的分界面處發(fā)生反射和折射現(xiàn)象,在進(jìn)入介質(zhì)后被介質(zhì)吸收而發(fā)生衰減等。正是因?yàn)榫哂羞@些性質(zhì),使得超聲波可以用于距離的測(cè)量中。隨著科技水平的不斷提高,超聲波測(cè)距技術(shù)被廣泛應(yīng)用于人們?nèi)粘9ぷ骱蜕钪小?br />
系統(tǒng)的設(shè)計(jì)主要包括兩部分,即硬件電路和軟件程序。硬件電路主要包括單片機(jī)電路、發(fā)射電路、接收電路、顯示電路和電源電路,另外還有復(fù)位電路和LED控制電路等。我采用以AT89s52單片機(jī)為核心的低成本、高精度、微型化數(shù)字顯示超聲波測(cè)距儀的硬件電路。整個(gè)電路采用模塊化設(shè)計(jì),由信號(hào)發(fā)射和接收、供電、溫度測(cè)量、顯示等模塊組成。發(fā)射探頭的信號(hào)經(jīng)放大和檢波后發(fā)射出去,單片機(jī)的計(jì)時(shí)器開始計(jì)時(shí),超聲波被發(fā)射后按原路返回,在經(jīng)過放大帶通濾波整形等環(huán)節(jié),然后被單片機(jī)接收,計(jì)數(shù)器停止工作并得到時(shí)間。溫度測(cè)量后送到單片機(jī),通過程序?qū)λ俣冗M(jìn)行校正, 結(jié)合兩者實(shí)現(xiàn)超聲波測(cè)距的功能。軟件程序主要由主程序、預(yù)置子程序、發(fā)射子程序、接收子程序、顯示子程序等模塊組成。它控制單片機(jī)進(jìn)行數(shù)據(jù)發(fā)送與接收,在一定溫度下對(duì)超聲波速度的校正,還有實(shí)現(xiàn)數(shù)據(jù)正確顯示在LED上。另外程序控制單片機(jī)消除各探頭對(duì)發(fā)射和接收超聲波的影響。相關(guān)部分附有硬件電路圖、程序流程圖。
實(shí)際的環(huán)境對(duì)超聲波有很大的影響,如外部電磁干擾電源干擾信道干擾等等,空氣的溫度對(duì)超聲波的速度影響也很大。此外供電電源也會(huì)使測(cè)量差生很大的誤差。再設(shè)計(jì)的過程中考慮了這些因素,并給出了一些解決方案。
關(guān)鍵詞:AT89c52;超聲波;測(cè)距
Ultrasonic ranging system design
Abstract: ultrasonic frequency in the above 20kHz refers to the sound wave, it belongs to the category. Ultrasonic wave in general also follow the rules of the elastic medium, such as the boundary of the reflection and refraction phenomenon occurring in the media and after absorbing attenuation etc. Because these properties, ultrasonic can be used in measuring the distance. Along with the science and technology unceasing enhancement, ultrasonic technology has been widely applied in People's Daily life and work.
The thesis mainly includes two parts, the design that hardware circuit and software program. The hardware circuit including microcontroller circuit, launch circuit, receiving circuit, display circuit and power circuit, in addition to reset circuit and control circuit LED etc. I used to AT89s52 SCM is the core of low cost, high precision, miniaturization digital display ultrasonic rangefinder hardware circuit. The circuit USES modular design, the signal transmission and reception, power supply, temperature measurement, display module. The launch of the probe signal amplifier and detection after the launch of the timer started out, microcontroller timer, ultrasonic was launched by the way, after the return on amplified bandpass filters orthopedics etc, then received by MCU, counter to stop work and time. After temperature measurement of single-chip microcomputer, through the procedure to speed adjustment, the realization of the ultrasonic ranging function. Software program mainly by the main program, preset subroutines, launch procedure, receiving subroutines, display subroutines etc modules. It control chip, sending and receiving data in a certain temperature of ultrasonic velocity correction, and data displayed correctly in LED. Another program control chip to eliminate the emitting and receiving ultrasonic probe. With the hardware circuit and relevant parts of the program flowchart.
The actual environment has great influence on ultrasonic, such as external electromagnetic interference source channel interference etc, the temperature of the air of ultrasonic velocity are significantly affected. Besides supply power will also make great difference measurement errors. In the process of design to consider these factors, and proposes some solutions.
Keywords: AT89c52, Ultrasonic, distance
目 錄
1 概述............................................................1
2 課題研究背景及意義..............................................1
2.1 課題研究背景....................................................1
2.2 課題研究意義....................................................1
3 方案設(shè)計(jì)和選擇..................................................2
3.1 超聲波測(cè)距的原理................................................2
3.2 單片機(jī)AT89S52...................................................3
3.3 超聲波傳感器....................................................5
3.4 CAD簡(jiǎn)介.........................................................7
4 硬件電路設(shè)計(jì)....................................................7
4.1 整體電路設(shè)計(jì)....................................................7
4.2 超聲波測(cè)距系統(tǒng)設(shè)計(jì)............................................. 9
4.3 顯示電路設(shè)計(jì)....................................................16
4.4 電源電路設(shè)計(jì) ...................................................17
4.5 硬件電路設(shè)計(jì)優(yōu)化................................................19
5 軟件設(shè)計(jì)........................................................22
5.1 程序完成的功能..................................................23
5.2 程語(yǔ)言的選擇................................................... 23
5.3 主要部分程序流程圖...............................................24
5.4 實(shí)現(xiàn)重要功能的程序的分析.........................................25
6 結(jié)束語(yǔ) ..........................................................28
致 謝 ..........................................................29
參考文獻(xiàn)............................................................ 30
附錄一 pcb圖........................................................32
附錄二 程序代碼......................................................33