【正文】
ircuit more simplified, fully utilize the software resources. Through the analysis of the system needs, the hardware circuit design scheme is finally determined, and the main control chip is the main chip of AT89C52. In order to achieve the high accuracy, we need to understand the cause of the low accuracy of the measurement. Firstly, the transmission speed of the acoustic wave in the air will change with the temperature. The distance and the actual distance calculated by the average velocity may have some error. The second is because the ultrasonic belongs to one kind of wave, so the diffraction characteristic of wave is of the wave. This will make the ultrasonic wave not reflected, that is not due to the wave of the object returned, but directly received the emitter due to diffraction phenomenon and changed the direction of the transmission of that part of the ultrasonic. This is the result of a blind measurement of the blind, in the measurement of the error caused by the error read while the measurement failed. Therefore, as long as adding temperature 華北科技學院畢業(yè)設計(論文) V pensation circuit, by a temperature sensor to measure temperature, the actual temperature into the calculation, can effectively avoid the error of the first kind。對定時器初始化處理后,計時便開始。 主要程序在系統(tǒng)啟動時會進行初始化,接著馬上開始測量溫度,獲取溫度值并進行查表后同時啟動發(fā)射電路且開始計時,等待回波信號,并進行處理,軟件濾波開始工作,對峰值點進行查找并計算出距離。用于超聲波信號發(fā)射的發(fā)射電路,主要由非門和超聲波探頭組成。本系統(tǒng)由 AT89C52單片機控制時間長短的計數(shù)以及控制超聲波信號的發(fā)射、接收。 其次,由于超聲波屬于波的一種,因此具有波的衍射特性。另外,該系統(tǒng)進行軟件化峰值檢測,使電路更加簡化,充分利用了軟件資源。但以我們當前的技術(shù)水平來說,對超聲波測距技術(shù)的應用是有限的,未來的發(fā)展方向應該是朝著高精度、低盲區(qū)、拓展功能更豐富以及成本價格更低的方向發(fā)展。 和普通超聲波測距系統(tǒng)不同 ,高精度超聲波測距系統(tǒng)要求的盲區(qū)更小 、精度 更高。 通過對系統(tǒng)的需求分析,硬件電路的設計方案最終得以確定,主要由 AT89C52 單片機作為主控芯片。這會使得超聲波沒有經(jīng)過反射,即不是由于碰到物體而返回的波,而是直接收到發(fā)射端由于衍射現(xiàn)象而改變了傳 播方向的那部分超聲波。整個電路采用模塊化設計思想,主要包含顯示電路、超聲波發(fā)射電路、超聲波接收電路、溫度補償電路等。還有用于超聲波接收的接收電路,對回波進行濾波放大,整形,最后送入單片機。測溫子程序主要是根據(jù)溫度與速度表進行查表的方式來獲取當前聲速,代入公式進行計算。綜上,超聲波探頭的信號經(jīng)過 AT89C52 單片機的分析和一系列處理,最后實現(xiàn)本高精度超聲波測距 系統(tǒng)的完整功能,也驗證了該系統(tǒng)的設計滿足實際需求,該課題的研究也具有一定價值。 Secondly, adding dual parator circuit, can effectively avoid the second type of error. The system is controlled by the AT89C52 microcontroller count as well as the transmitter and receiver of ultrasonic wave. The whole circuit uses the idea of modular design, including the display circuit, ultrasonic circuit, ultrasonic receiving circuit, temperature pensation circuit, etc.. The display circuit is mainly posed of LED digital tube, and the dynamic display is adopted. That is, all the digital control of the section of the line in parallel, through the control of the selected signal to control the light of the digital tube. Secondly, transmit circuit for ultrasonic signal which is transmitted by the main gate, and the ultrasonic probe. There are also used for ultrasonic receiving circuit, the echo filtering amplification, shaping, and finally into the microcontroller. Other circuit also includes a temperature measurement circuit for measuring the temperature of the environment, mainly by a chip directly read environmental temperature, into the microcontroller, then through query well in advance of the thermometer, current measurement environment in the actual sound velocity through this table can be, substituted into the formula for calculating the distance. The program design mainly includes: the main program, the temperature pensation procedure, the launch subroutine, the receiving subroutine and so on. Main program at system boot time will be initialized, then immediately began to temperature measurement, to obtain the temperature value and lookup table and start transmitting circuit and the beginning of time, waiting for the echo signal, and processing and filtering software began to work the peak search and calculate the distance. Temperature measurement child program is mainly according to the temperature and speed table lookup table to obtain the current velocity and substituted into the formula were calculated. The process of the realization includes the reset procedure, the sending matched ROM mands, the temperature conversion mand, etc. The realization of the measurement distance subroutine is the measurement of time, which is the core of the system. After the timer initialization, the time will start. In summary, ultrasonic probe signal through AT89C52 analysis and a series of processing and finally realize the full functionality of the high precision ultrasonic ranging system, also shows that the design of the system to meet the 基于單片機的高精度超聲波測距系統(tǒng)的設計 VI actual demand, this topic research has a certain value. Worthy of note is that in order to reduce the blind spot of the measurement of the system, the dual parator circuit to deal with different distance signal (remote part of 3cm50cm close part and 50cm400cm), making precision further improved. The system has higher design precision, can be used in the reverse radar of the car, and can also be used in the intelligent robot distance identification system or other distance 3cm500cm, the precision 1cm system. Keywords: single chip microputer, high accuracy, ultrasonic, rangin華北科技學院畢業(yè)設計(論文) 第 1 頁 共 48 頁 1 緒論 超聲 波測距系統(tǒng)作為一種經(jīng)典的非接觸式測量技術(shù),包含了電子,材料,物理等學科的知識理論,其應用領域也十分的廣泛。 1. 1 系統(tǒng)設計背景 在過去許多科學家的研究基礎之上,我們已經(jīng)知道用許多種不同的方法來測距,不再局限于傳統(tǒng)的簡單的接觸式測 量器具,我們今天的電子技術(shù)正以飛一般的速度向前推動著大量非接觸式測距儀的發(fā)展。紅外線測距雖然造價便宜,但其不能達到高精度,且方向性不好。隨著現(xiàn) 代電子技術(shù)的發(fā)展,超聲波測距技術(shù)在汽車制作,國防安全,工業(yè)制造及日常生活中都隨處可見。直到第一次世界大戰(zhàn)爆發(fā),期間關(guān)于超聲波的研究漸漸地被人們所看重。又過了兩年,另外一個科學家穆爾豪瑟獲取了一個德國專利,這個專利是針對超聲波檢查方法的,這讓我們又看到超聲波的研究進了一步。德國的貝格曼在他的書《超聲波》中,比較完整的介紹了大量的超聲波的資料。根據(jù)此研究基礎,衍生出大量超聲波儀器,目前,超聲波在無損檢測中發(fā)揮出無與倫比的作用。還留下諸多相關(guān)實驗的數(shù)據(jù)結(jié)論,如,超聲波的傳播速度(即聲速)的影響因素有哪些,波的特性在傳播過程中對測距系統(tǒng)的影響分析。他根據(jù)實驗,驗證了回波的包絡方程,給出了軟硬件的設計方案。 通過長時間的研究和發(fā)展,超聲波測距不僅僅是單一的技術(shù)了。 基于單片機的高精度超聲波測距系統(tǒng)的設計 第 4 頁 共 48 頁 2 超聲波測距原理和方案 2 .1 超聲波測距的基本理論 2 .1 .1 超聲波簡介 所謂超聲波,跟普通聲波的區(qū)別是頻率范圍不同。超聲波的使用范圍也是很廣的,比如:測量,測量又分為速度的測量和距離的測量;各種需要殺滅細菌的環(huán)境;超聲波的能量還可用于破碎物體,用于分割等。 聲波是一種傳遞了物體運動的能量,比如,桌子