1、超声波测距器的设计与实现 I 超声波测距器的设计与实现 摘 要 超声波作为一种传输信息的媒体,由于其本身的直射性和反射性,以及不易受 光照、电磁波等外界因素影响的特性,在探伤、测距、测速等多种领域越来越受到 重视。 本设计采用 AT89C52 单片机为核心并通过 LCD1602 显示测量结果。超声波传 感器采用集成式超声波测距模块和分立式超声波传感器,测量时通过使用 DS18B20 测得温度来实现温度补偿并提高精度值,经实验证明,这套系统软硬件设计合理、 抗干扰能力强、实时性良好,可以有效地解决汽车倒车、建筑施工工地以及一些工 业现场的位置监控。 关键词: 超声波 测距 温度补偿 超声波测距器
2、的设计与实现 II ULTRASONIC RANGE FINDER DESIGN AND IMPLEMENTATION ABSTRACTABSTRACT Ultrasonic is a kind of media that transmits information, It has many speciality,for ex ample pounded and reflection, and not easy to be disturbed by the factors such as light, He rtzian waves. because of these unique advan
3、tages, ultrasonic get more and more attention of people on many areas,such as crack detection, range finding and speed trial. This design uses AT89C52 microcontroller as the core and through LCD1602 .when measuring the temperature measured by DS18B20 to achieve temperature compensation and to improv
4、e the precision value , an integrated ultrasonic sensor ultrasonic ranging module and discrete ultrasonic sensors , the experiment proved that the system software and hardware designed, anti-jamming capability, Good real-time, can effectively solve the car parking, construction sites and the locatio
5、n of some industrial site monitoring KEY WORDS Silent Wave Measure Distance Temperature Compensation 超声波测距器的设计与实现 目 录 中文摘要 .I 英文摘要 . II 1 概述 1 1.1 距离测量的方法介绍 1 1.2 超声波测距应用现状 2 1.3 本设计所做工作 2 2 系统硬件设计 . 3 2.1 MCU 选型 3 2.1.1 51 系列 MCU . 3 2.1.2 MCU 的接口设计 4 2.2 超声波传感器选型 4 2.2.1 超声波传感器工作原理 4 2.2.2 超声波传感器工
6、作特性 6 2.2.3 集成式测距模块介绍 7 2.3 显示模块设计 8 2.4 超声波发射接收电路10 2.4.1 超声波发射电路设计10 2.4.2 超声波检测接收电路设计 .11 2.5 超声波测距系统硬件电路设计 .12 2.5.1 分立式超声波测距电路设计12 2.5.2 集成式超声波测距电路设计14 3 系统软件设计 .15 3.1 超声波测距仪的程序设计 .15 超声波测距器的设计与实现 3.1.1 超声波主程设计 15 3.1.2 发射超声波程序设计16 3.1.3 接收超声波程序设计17 3.1.4 数据处理程序设计 .17 3.2 主程序流程图 18 4 系统调试 20 4.1 PCB 制板和硬件安装 .20 4.2 软件调试 .20 4.3 分立式实验板调试 21 4.4 集成式实验板调试 22 4.5 超声波测距误差分析及补偿 .23 5 结束语 25 致 谢 26 参考文献 27 附 录 .28 超声波测距器的设计与实现 1 1 概述 1.1 距离测量的方法介绍 目前常用的测距方法有激光测距,红外测距,雷达测距,超声波测距,光学测 距以及传统的物理测量