【正文】
第 17 頁 共 27 頁 bit cl。 void k3cl()。 //定時(shí)器 1 中斷允許 TH0=0x00。 opto=0xff。 if(jpjs1) { csbcj()。 } else timeToBuffer()。 在對(duì)該電路進(jìn)行調(diào)試時(shí), VCC應(yīng)輸出 5V直流穩(wěn)定的電壓,接通電源后電源指示燈亮,正常發(fā)光。 系統(tǒng)調(diào)試完后應(yīng)對(duì)測(cè)量誤差和重復(fù)一致性進(jìn)行多次實(shí)驗(yàn)分析,不斷優(yōu)化系統(tǒng)使其達(dá)到實(shí)際使用的測(cè)量要求。 參 考 文 獻(xiàn) [1]羅忠輝 .提高超聲波測(cè)距精度的方法 [J].機(jī)械設(shè)計(jì)與制造, 2022年 1月第一期 . [2]張有志 .一種新型超聲波測(cè)距系統(tǒng) [J].山東大學(xué)學(xué)報(bào), 2022年 2月第 3卷第 1期 . [3]王霞、曹茂永。 unsigned char oldcount。 TCCR1B=0X81。i1142。=0XDF。 temp=m%10。 PORTC=~(1i)。 else if (newcount100) PORTD=0XDF。 PORTB=0XF7。 //使能 T0定時(shí)溢出 } void main(void) { unsigned char i。 TIMSK=0X21。 display8led()。s Day on February 14, characterized by bouquets of roses, chocolates and romantic candlelight dinners, than they do about their homegrown day for lovers. Even Qixi is nowadays referred to as the Chinese Valentine39。s largest virgin forest, and known for its spring and ecological environment, Arxan is marveled at by many tourists as the purest land on earth. You cannot miss out the Autumn of Arxan. It is definitely the best with brightlycolored scenery full of emotions. Autumn in the northern part of the country es earlier than the South. A September rain followed by the footprints of Autumn brings more colors to the once emerald green mountain and blooming grassland. Shutterbugs flock to see for themselves the marvel of splendid colors around the mountains and waters, many of whom have travel a long distance and even camp here only to capture a moment of the nature wonder. The silver birch turns golden, while the larch is still proudly green. You will find yourself drowned in the intoxicating red of the wild fruits as well as the glamour of flowers in full blown. And your heart will be lingering on the woods as it39。 for(i=0。 SREG|=0X80。 //T0定時(shí)器 1/8分頻 鄭州鐵路職業(yè)技術(shù)學(xué)院 2022屆自考本科生畢業(yè)論文(設(shè)計(jì)) 第 26 頁 共 27 頁 TCNT1=0X00。 PORTD=0XFF。 else if (newcount20) PORTD=0XFD。//m位 } void display3led(void) //數(shù)碼管顯示 { unsigned char i。 } void hextobcd(unsigned char m)//將 count十六進(jìn)制數(shù)據(jù)轉(zhuǎn)換為 LED七段碼 { unsigned char temp。it。it。=0X7f。//七段譯碼字型表 (lm,cm) const unsigned char tab2[]={0X08,0XCE,0X12,0X82,0XC4, 0X81,0X01,0XCA,0X00,0X80}。 斷點(diǎn)調(diào)試: 在程序中插入斷點(diǎn),即為斷點(diǎn)調(diào)試。 二. 根據(jù)測(cè)量范圍要求不同,可適當(dāng)調(diào)整與接收換能器并接的濾波電容 C7的大小,以獲得合適的接收靈敏度和抗干擾能力。 bg=1。 } else if(ssj1) { buffer[2]=0x40。 sj3=400。 csbds=0。 超聲波接收中斷程序 void main() //主函數(shù) { EA=1。 //顯示函數(shù) void timeToBuffer()。 167。然后調(diào)用超聲波發(fā)生子程序送出一個(gè)超聲波脈沖,為避免超聲波從發(fā)射器直接傳送到接收器引起的直接波觸發(fā),需延遲 (這也就是測(cè)距器會(huì)有一個(gè)最小可測(cè)距離的原因 )后,才打開外中斷 0接收返回的超聲波信號(hào)。 當(dāng)工作時(shí),每次只點(diǎn)亮一位數(shù)字進(jìn)行顯示,延遲 一小段時(shí)間后再點(diǎn)亮下一位數(shù)字進(jìn)行顯示,因?yàn)槿藗円曈X暫留的現(xiàn)象,而感覺 4位數(shù)字同時(shí)被點(diǎn)亮。 超聲波檢測(cè)接 收 電路 考慮到紅外遙控常用的載波頻率 38 kHz 與測(cè)距的超聲波頻率 40 kHz 較為接近,可以利用集成電路 CX20226A 制作超聲波檢測(cè)接收電路如圖 。 壓電超聲波轉(zhuǎn)換器的功能:利用壓電晶體諧振工作。 1234D1C122 0 uC2vi n vo u tgndL M 78 05C310 0 uC4V C C22 0 V 8V 圖 7805穩(wěn)壓 電源電路 鄭州鐵路職業(yè)技術(shù)學(xué)院 2022屆自考本科生畢業(yè)論文(設(shè)計(jì)) 第 11 頁 共 27 頁 第四章 系統(tǒng)硬件電路設(shè)計(jì) 167。 三端固定式集成穩(wěn)壓器有正穩(wěn)壓器 78XXX系列和負(fù)穩(wěn)壓器 79XXX 系列。它具有體積小、可靠性高、使用簡單安全等特點(diǎn)。 : 在圖 中,穩(wěn)壓二極管的穩(wěn)壓值為 ,即當(dāng) D1 陰極加電壓超過 時(shí),二極管陰極電壓就會(huì)保持 不變。無論是在性能、特點(diǎn)、還是電路材料上,或者是在原理圖上、設(shè)計(jì)上等都具有簡單、使用性強(qiáng)等特點(diǎn)。 167。 下面方案選擇具體介紹。 單片機(jī)通過 引腳經(jīng)反相器來控制超聲波的發(fā)送,然后單片機(jī)不停的檢測(cè)INT0引腳,當(dāng) INT0 引 腳的電平由高電平變?yōu)榈碗娖綍r(shí)就認(rèn)為超聲波已經(jīng)返回。 根據(jù)設(shè)計(jì)要求并綜合各方面因素,可以采用 AT89C52單片機(jī)作為主控制器,用動(dòng)態(tài)掃描法實(shí)現(xiàn) LED數(shù)字顯 示,超聲波驅(qū)動(dòng)信號(hào)用單片機(jī)的定時(shí)器完成 。 167。聲波發(fā)射和接收采用 Φ15 的超聲波換能器 TCT4010F1( T發(fā)射)和 TCT4010S1( R接收),中心頻率為 40kHz,安裝 時(shí)應(yīng)保持兩換能器中心軸線平行并相距 4~ 8cm 。 167。 設(shè)計(jì)思路 超聲波是指頻率高于 20KHz的機(jī)械波。 下面介紹本次設(shè)計(jì)的具體實(shí)現(xiàn)方法。 人體身高距離是在不同的場(chǎng)合和控制中需要檢測(cè)的一個(gè)參數(shù),測(cè)距成為數(shù)據(jù)采集中要解決的一個(gè)問題。使用在空氣中效率較高的中心頻率為 40KHz 的超聲波探頭來完成發(fā)射與接收功能,用四位數(shù)字顯示以達(dá)到 1cm的分辨率和 13m的測(cè)量范圍。 超聲波發(fā)射子程序和接收中斷程序設(shè)計(jì) ............................ 16 167。 采用二極管穩(wěn)壓電路設(shè)計(jì): .................................... 9 167。 硬件部分調(diào)試分析構(gòu)思 ........................................ 5 167。 設(shè)計(jì)思路 ....................................................... 4 167。 T/R4010傳感器設(shè)計(jì)電路 ............................... 8 167。 共陰極七段 LED數(shù)碼管 .......................................... 14 第五章 系統(tǒng)軟件設(shè)計(jì) ................................................. 15 167。 在此本設(shè)計(jì)中硬件設(shè)計(jì)電路主要由單片機(jī)系統(tǒng)及顯示電路、超聲波發(fā)射電路和超聲波檢測(cè)接受電路組成。 關(guān)鍵詞: AT89C52 超聲波 發(fā)射 接收 鄭州鐵路職業(yè)技術(shù)學(xué)院 2022屆自考本科生畢業(yè)論文(設(shè)計(jì)) 第 2 頁 共 27 頁 Ultrasonic height measuring instrument Abstract: Paper first introduces the basic principle of ultrasonic distance measurement, then the solution of several can be carried out of the demonstration program to determine the final design, and design a whole were described in detail. In this design, hardware design of the circuit mainly by the SCM system and the display circuit, ultrasonic transmitter and ultrasonic testing to accept circuit. Software design from the main program, subroutine ultrasound, ultrasound receiver interrupt program and display routines and other parts. The design of ultrasonic sound reflection properties, the use of echo ranging method to achieve. Higher efficiency in air using a center frequency of 40KHz ultrasound probe to plete transmit and receive functions, with four figures in order to achieve a resolution of and 13cm of the measuring range. The following formula: d = s / 2 = (c * t) / 2. d for the measured object and measuring the distance between generator, s is the sound of the roundtrip distance, c is the speed of sound, t is the sound back and forth the time spent. On this basis, the overall design of the system program, and finally achieved through various hardware and software modules. With the relevant parts of the hardware circuit, the program flow chart. Keywords: AT89C52,Ultrasonic,Launch,Receive 鄭州鐵路職業(yè)技術(shù)學(xué)院 2022屆自考本科生畢業(yè)論文(設(shè)計(jì)) 第 3 頁 共 27 頁 引 言 超聲波測(cè)身高就是利用