超声波测距系统的设计.doc
超声波测距系统的设计,2.89万字 45页 摘要:超声波是指频率在20khz以上的声波,它属于机械波的范畴。超声波也遵循一般机械波在弹性介质中的传播规律,如在介质的分界面处发生反射和折射现象,在进入介质后被介质吸收而发生衰减等。正是因为具有这些性质,使得超声波可以用于距离的测量中。随着科技水平的不断提高,超声波测距技术被...
内容介绍
此文档由会员 csfujixie 发布超声波测距系统的设计
2.89万字 45页
摘要:超声波是指频率在20kHz以上的声波,它属于机械波的范畴。超声波也遵循一般机械波在弹性介质中的传播规律,如在介质的分界面处发生反射和折射现象,在进入介质后被介质吸收而发生衰减等。正是因为具有这些性质,使得超声波可以用于距离的测量中。随着科技水平的不断提高,超声波测距技术被广泛应用于人们日常工作和生活之中。
系统的设计主要包括两部分,即硬件电路和软件程序。硬件电路主要包括单片机电路、发射电路、接收电路、显示电路和电源电路,另外还有复位电路和LED控制电路等。我采用以AT89s52单片机为核心的低成本、高精度、微型化数字显示超声波测距仪的硬件电路。整个电路采用模块化设计,由信号发射和接收、供电、温度测量、显示等模块组成。发射探头的信号经放大和检波后发射出去,单片机的计时器开始计时,超声波被发射后按原路返回,在经过放大带通滤波整形等环节,然后被单片机接收,计数器停止工作并得到时间。温度测量后送到单片机,通过程序对速度进行校正, 结合两者实现超声波测距的功能。软件程序主要由主程序、预置子程序、发射子程序、接收子程序、显示子程序等模块组成。它控制单片机进行数据发送与接收,在一定温度下对超声波速度的校正,还有实现数据正确显示在LED上。另外程序控制单片机消除各探头对发射和接收超声波的影响。相关部分附有硬件电路图、程序流程图。
实际的环境对超声波有很大的影响,如外部电磁干扰电源干扰信道干扰等等,空气的温度对超声波的速度影响也很大。此外供电电源也会使测量差生很大的误差。再设计的过程中考虑了这些因素,并给出了一些解决方案。
关键词:AT89c52;超声波;测距
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 方案设计和选择..................................................2
3.1 超声波测距的原理................................................2
3.2 单片机AT89S52...................................................3
3.3 超声波传感器....................................................5
3.4 CAD简介.........................................................7
4 硬件电路设计....................................................7
4.1 整体电路设计....................................................7
4.2 超声波测距系统设计............................................. 9
4.3 显示电路设计....................................................16
4.4 电源电路设计 ...................................................17
4.5 硬件电路设计优化................................................19
5 软件设计........................................................22
5.1 程序完成的功能..................................................23
5.2 程语言的选择................................................... 23
5.3 主要部分程序流程图...............................................24
5.4 实现重要功能的程序的分析.........................................25
6 结束语 ..........................................................28
致 谢 ..........................................................29
参考文献............................................................ 30
附录一 pcb图........................................................32
附录二 程序代码......................................................33