投稿网址
: www.videoe.cn
2020年第44卷第6期
66
器件与应用
arts and Applications
P
文献引用格式:时杨,杨澳妮,吴若洁,等 . 超声波测距仪的设计与研究[J]. 电声技术,2020,44(6):66 - 69,73.
SHI Y,YANG A N,WU R J,et al.Design and Research of Ultrasonic Rangefinder[J].Audio Engineering,2020,44(6):
66 - 69,73.
中图分类号:TB559 文献标志码:A DOI:10. 16311
/
j. audioe. 2020. 06. 014
超声波测距仪的设计与研究
时 杨,杨澳妮,吴若洁,徐 强
(四川师范大学,四川 成都 610000)
摘要:该超声波测距仪以 STC89C52 为基本核心,通过测量超声波的信号发出和输入接收的一定时间差,结合超声波发射和接
收时传播的速度获得测量距离。由于温度条件会直接影响超声波的传播运动速度,进而直接影响超声波测量的精度,因此在
超声波测距仪中通过引入温度传感器做相应的温度测量和补偿。所提设计主要采用控制变量法,对不同条件下的超声波测
量结果和实际距离进行误差分析,以便寻找影响超声波测量结果精度的主要原因。
关键词:超声波测距仪;STC89C52;温度补偿;误差分析
Design and Research of Ultrasonic Rangefinder
SHI Yang, YANG Aoni, WU Ruojie, XU Qiang
(Sichuan Chengdu Sichuan Normal University, Chengdu 610000, China)
Abstract:
The ultrasonic range finder uses STC89C52 as the basic core. It can measure the distance by measuring the time difference
between the signal sending and receiving of the ultrasonic wave and the propagation speed when the ultrasonic wave is transmitted
and received. Since the temperature condition will directly affect the propagation speed of ultrasonic waves, and then directly affect
the accuracy of ultrasonic measurement, the temperature measurement and compensation are introduced by introducing temperature
sensors in the ultrasonic rangefinder. This design mainly uses the control variable method to analyze the error of the ultrasonic
measurement results and the actual distance under different conditions, so as to find the main reasons that affect the accuracy of the
ultrasonic measurement results.
Key words:
ultrasonic rangefinder; STC89C52; temperature compensation; error analysis
1
引言
超声波的检测通常相对快速、方便且能够很好
地实现实时控制,在实时测量的高精度方面可以很
好地满足科学和工业实用指标的要求。非接触式
超声波的测距系统可广泛应用于防洪、空间定位、
物体识别与定位、车辆安全与驾驶、辅助控制系统
甚至是地形水文地貌等领域。因此,目前研究的超
声波测距系统具有重要的经济学现实性和社会应
用意义。
2
系统的硬件设计
该系统以 STC89C52 为控制核心,硬件功能分
为温度补偿、测距以及显示 3 大部分,预留了按键
电路供以后扩展功能使用,如语音播报等。系统总
体框图如图 1 所示,硬件设计电路图如图 2 所示。
图 1 系统总体框图
2.1
单片机选择
因为系统需要具有显示控制电路、温度测量电
路以及测距电路,且需要使用更多的 I/O 接口,所
以使用的是 STC89C52 微控制器。STC89C52 是一
款低成本功耗、高性能的 CMOS8 位微控制器,片上
具 有 8 kB 的 闪 存 Flash、32 位 的 I/O 线、3 个 16