1、 I 摘 要 本设计介绍了基于单片机控制的超声测距仪的原理:由AT89C51控制定时器产 生超声波脉冲并计时,计算超声波自发射至接收的往返时间,从而得到实测距离。并 且在数据处理中采用了温度补偿的调整,用四位LED数码管切换显示距离和温度。 整个硬件电路由超声波发射电路、超声波接收电路、电源电路、显示电路等模块 组成。各探头的信号经单片机综合分析处理,实现超声波测距仪的各种功能。在此基 础上设计了系统的总体方案,最后通过硬件和软件实现了各个功能模块。相关部分附 有硬件电路图、程序流程图,给出了系统构成、电路原理及程序设计。此系统具有易 控制、工作可靠、测距准确度高、可读性强和流程清晰等优点。实
2、现后的作品可用于 需要测量距离参数的各种应用场合。 关键词:超声波;温度补偿;测距;数码管;单片机 II ABSTRACT The design introduces the principle of the ultrasonic distance measurement instrument based on SCMC-controlled: AT89C51 controls timers to produce the ultrasonic wave pulse and time,count the time of ultrasonic wave spontaneous emission t
3、o receive round-trip,thus obtains the measured distance.And the temperature compensation adjustment is used in the data processing, with four LED nixie tubes display distance or temperature by switching. The entire hardware circuit is composed by ultrasonic transmitter circuit, ultrasonic receiver c
4、ircuit, the power circuit, display circuit, and other modules. The probe signals are integrated analysised by SCMC to achieve the various functions of ultrasonic distance measurement instrument. Based on this has designed systems overall concept, final adoption of hardware and software to achieve th
5、e various functional modules. The relevant parts have the hardware schematics and process flow chart.It has given the system constitution, the circuitry and the programming. The instrument system has features: ease of control, stability of operation, highness of precision and distinctness of program
6、me process ,etc. After the realization of the works can be used for needs of the various parameters measured distance applications. Keywords: Ultrasonic wave, Temperature compensation, Measure distance 目 录 摘 要 I ABSTRACT II 1 绪论 . 1 1.1 课题研究的背景. 1 1.2 课题研究的意义. 1 1.3 论文结构 2 2 超声波测距原理 3 2.1 超声波简介 3 2.2 超声波测距原理. 3 3 方案论证 . 5 3.1 设计思路 5 3.2 系统结构设计 6 4 主要元件介绍 7 4.1 单片机 AT89C51 . 7 4.2 超声波传感器 T40、R40 9 4.3 温度传感器 DS18B20 .10 5 硬件电路设计 . 11 5.1 超声波发射电路 11 5.2 超声波接收电路 11 5.3 显示电路 .12 5.4 电源电路 .12 5.5 复位电