1、 第 1 页 共 45 页 摘摘 要要 单片微型计算机具有结构简单、控制功能强、重量轻等优点,在机械电子、航空 航天、冶金采矿以及家用电器等许多领域都得到了广泛的应用,发挥了巨大的作用。 超声波指向性强,能量耗损缓慢,在介质中传播的距离较远,因而超声波经常用于距 离的测量。利用超声波测距迅速、方便、计算简单、易于做到实时控制,并且在测量 精度方面能达到工业实用的要求,因此得到广泛应用。 超声技术是一门各行各业都要使用的通用技术,它是通过超声波产生、传播及 接收的物理过程完成的。目前,超声波技术广泛应用于各个工业部门的超声探测、超 声焊接、超声检测和超声医疗方面。基于单片机的超声波测距系统易实现
2、,成本低, 精确度高,并且容易做到实时控制,具备较强的实用性,可实现 0.310 米的测量。 关键词: 超声波传感器;单片机;测距 第 2 页 共 45 页 AbstractAbstract Compared with other kinds of product, Single-Chip Microcomputer is simple, small, light and easily controlled. It is used extensively in mechanical electron, aerospace, metallurgical mining technology, el
3、ectric home appliances and such a lot of fields, so Single-Chip Microcomputer has played huge role. Orientation of ultrasonic is very good. When ultrasonic travels through air, it can go farther and energy consume slowly. For those many advantages, ultrasonic is used in distance measurement. This di
4、stance measurement is quick, nice and advanced. Ultrasonic technology is a general technology that is used in commercial and professional fields. It is through ultrasonic production, propagate and reception. Ultrasonic technology has been extensive application in the ultrasound of every industrial d
5、epartment survey, welding, detection and ultrasonic medical system. It easily realized. Based on the ultrasonic system of range finding of single-chip microcomputer is low price, accuracy and easily controlled. In this measurement, ultrasonic wave can be reached 0.3-10m. Keywords: Single chip microc
6、omputer; Ultrasonic sensor ; Distance measurement 第 3 页 共 45 页 目录目录 目录 . 3 第一章 绪 论 5 1.1 超声波 . 5 1.1.1 超声波特点 . 5 1.1.2 超声波检测简介 . 5 1.2 单片机 . 6 1.2.1 单片机的基本结构 . 6 1.2.2 单片机的特点和指标 . 8 1.3 单片机的发展史 . 9 1.4 单片机的应用 10 1.4.1 智能化产品 10 1.4.2 智能化仪表 10 1.4.3 智能化测控系统 10 1.4.4 智能化接口 10 第二章 超声波测距系统的原理及 AT89C51 单片机 12 2.1 超声波发生器及测距原理 12 2.1.1 超声波发生器 12 2.1.2 压电式超声波发生器原理 12 2.1.3 超声波测距原理 12 2.2 方案的设计 13 2.3 AT89C51 单片机基础知识 . 14 2.4 单片机 AT89C51 的引脚特性 15 2.5 单片机内部的定时/计数器简介 . 17 2.5.1 加 1 计数器 17 2.5.2 定时/