摘要:从20世纪中期开始,随着科学技术的迅速发展,超声波技术逐渐被人类实际应用在工作生活中。本文是基于单片机的超声波测距系统设计,不光涵盖了系统的硬件软件设计,还需要做出可以实际应用的实物。整个测距系统的设计由硬件设计与软件设计这两个部分组成。超声波测距仪的工作过程是:当电源供电,按下按键,单片机会给超声波传感器一个40KHz的触发脉冲,然后传感器利用逆压电原理产生产生超声波,当传感器接受到被物体反射回来的超声波信号后,接收器通过压电效应产生频率与超声波频率一样的电信号反馈给单片机,通过单片机内部的中断程序,检测出超声波在空气中传播的时间,再通过时间计算得出距离,并且将其显示在LED显示屏上。本文以上述理论为出发点,结合超声波本身的优越特性,研究并设计出一种可行的测距方案。
关键词:超声波;AT89S52单片机;测距
Abstract:From the middle of 21st century, as the development of science and technology developing so fast, ultrasonic technology has been applied in human life. This paper is the design of ultrasonic ranging system based on single chip, not only covers the hardware and software design of the system, also need to make practical use can be kind. The whole design of ranging system is composed of hardware and software this design is composed of two parts. The working process of the ultrasonic range finder is: when the power supply, press the button, the microcontroller will give a trigger pulse ultrasonic ranging module 40KHz module, and then use the inverse piezoelectric ultrasonic generating principle, when the module receives the reflected by the object The ultrasonic signal, the signal receiver frequency by piezoelectric effect and ultrasonic frequency as the feedback to the microcontroller, the microcontroller internal interrupt program, detect the ultrasonic propagation time in the air, then the distance by the time calculation, and the display on the LED. Based on the above theory as the starting point. With superior ultrasound characteristics, research and design a feasible location scheme.
Keywords: Ultrasonic; AT89S52 MCU;distance measurement
目录
第一章 绪论 1
1.1超声波发展史 1
1.3主要研究内容 2
第二章 单片机概述 4
2.1AT89S52主要性能 4
2.2AT89S52外部结构 4
2.3AT89S52特性 6
第三章 超声波测距 8
3.1超声波测距原理 8
3.2超声波传感器介绍 9
3.3超声波传感器的性能特点 10
第四章系统硬件电路设计 12
4.1主电路设计 12
4.2单片机电路 13
4.3复位电路 13
4.4晶振电路 14
4.5LED数码管显示电路 15
4.6超声波发射与接收电路 17
4.6.1HC-SR04超声波传感器 18
4.6.2超声波时序图 19
4.7按键设置电路