1、 摘要摘要 本设计采用超声波测距, 可用作汽车泊车安全辅助装置, 能以声音和更为直观的 LED 显示告知驾驶员汽车周围障碍物的情况,解除了驾驶员在泊车和起动车辆时前后左右探 视所引起的烦扰, 并帮助驾驶员扫除了视野死角和视线模糊的缺陷, 提高了泊车安全性。 本设计硬件部分主要由单片机控制电路、超声波发射电路、超声波接收电路、数码 管显示电路、电源电路和报警电路组成,软件部分主要由主程序、超声波发射接收中断 程序、距离计算子程序及显示子程序等部分组成。本设计由 STC89C52RC 单片机控制时 间计数,计算超声波自发射至接收的往返时间,利用超声波在空气中的传输速度,从而 得到实测距离。该设计的
2、电路设计合理简单、工作稳定、性能良好、检测速度快、计算 简单、易于做到实时控制,并且在测量误差方面能够达到简单工业实用的要求。 关键词关键词:单片机;超声波测距;超声波换能器;STC89C52RC。 Abstract This design adopts ultrasonic ranging,which can be used for car parking safety auxiliary devices.It coulde use sound and more intuitive LED display to inform the driver case of the car around
3、 obstacles, lifted the drivers when parking and start vehicles visiting around caused annoyance. In addition ,it coulde help pilot removed the sight vision blind angle and fuzzy, improved parking safety defects. The hardware of this design mainly composed by the MCU control circuit, ultrasonic trans
4、mitter circuit, ultrasonic receiving circuit, LED display circuit, power circuit and alarm circuit. And software is mainly composed of the main program, ultrasonic transmitting and receiving interrupt program, distance calculation and display subroutine subprogram components.This design uses STC89C52RC single-chip microcomputer control the time counts, since launch to receive calculation ultrasonic round-trip time, us