1、 题题 目目 基 于 单 片 机 的 超 声 波 测 距 设 计基 于 单 片 机 的 超 声 波 测 距 设 计 TITLE ultrasonic distance testing based on single-chip microcomputer 1 摘 要 超声波是指频率在 20kHz 以上的声波,它属于机械波的范畴。超声波也遵循 一般机械波在弹性介质中的传播规律, 如在介质的分界面处发生反射和折射现象, 在进入介质后被介质吸收而发生衰减等。正是因为具有这些性质,使得超声波可 以用于距离的测量中。随着科技水平的不断提高,超声波测距技术被广泛应用于 人们日常工作和生活之中。 系统的设计主
2、要包括两部分,即硬件电路和软件程序。硬件电路主要包括单 片机电路、发射电路、接收电路、显示电路和电源电路,另外还有复位电路和 LED 控制电路等。我采用以 AT89C52 单片机为核心的低成本、高精度、微型化数字显 示超声波测距仪的硬件电路。整个电路采用模块化设计,由信号发射和接收、显 示等模块组成。发射探头的信号经放大和检波后发射出去,单片机的计时器开始 计时,超声波被发射后按原路返回,在经过放大带通滤波整形等环节,然后被单片 机接收,计数器停止工作并得到时间。软件程序主要由主程序、发射、接收、显示 子程序等模块组成。 它控制单片机进行数据发送与接收, 实现数据正确显示在 LED 上。另外程
3、序控制单片机消除各探头对发射和接收超声波的影响。相关部分附有 硬件电路图、程序流程图。 关键词: 单片机,超声波,测距. 2 Abstract In more than 20 KHZ ultrasonic refers to the frequency of sound waves, it belongs to the category of mechanical wave. Ultrasonic also follows the propagation rules of general mechanical wave in elastic medium, as in the interfac
4、e of medium of reflection and refraction occur, after entering the medium to be absorbed by the medium and attenuation, etc. Because of these properties, ultrasound can be used for distance measurement. With the constant improvement of the level of science and technology, ultrasonic ranging technolo
5、gy is widely used in Peoples Daily work and life. The design of the system mainly includes two parts, namely, hardware circuit and software program. Hardware circuit mainly including microcontroller circuit, transmitting circuit, receiving circuit, display circuit and power supply circuit, and reset
6、 circuit and LED control circuit, etc. I use with AT89C52 single-chip computer as the core of low cost, high precision, miniaturization, digital display, the hardware of the ultrasonic range finder. The whole circuit USES modular design, the signal transmitting and receiving, display module, etc. Launch probe signal after amplification and detection, single chip microcomputer timer timing starts, according to the original after ultrasonic was fired back, after amplification bandpass filter