超声波测距系统设计毕业论文

 2021-04-07 11:04

摘 要

本课题详细介绍了超声波传感器的原理特性和STC89C52的单片机的性能和特点。在分析了超声波测距的原理的基础上,指出了设计测距系统的不足并加以改进,将温度引起的误差考虑在内并且加以修正。最终给出了以STC89C52单片机为核心的液晶显示超声波测距系统的硬件电路和软件设计方法。

硬件电路部分和软件电路部分均采用模块化的方法来设计。硬件电路主要由超声波发射电路、超声波接收电路、电源电路、显示电路等模块组成。发射模块的功能则是发射超声波,接收模块负责接收超声波回波。再利用单片机内部的程序来计算距离,并显示测量结果。另一方面,本课题软件设计部分主要由主程序、超声波报警子程序、超声波按键子程序及显示子程序组成。该系统电路设计合理、工作稳定、性能良好、检测速度快、计算简单,并且做到了可设计报警范围的功能,在测量精度方面能达到工业使用的要求。

关键词:STC8952,超声波,测距,电路

Ultrasonic Ranging System Designed

ABSTRACT

This topic in detail introduces the principle and characteristics of ultrasonic sensors and STC89C52 MCU performance and characteristics. On the basis of analyzing the principle of ultrasonic ranging,it points out that the deficiency of the ranging system is designed and improved. I take the error into account which is due to temperature, and i modified the system. Finally the topic gives the STC89C52 single-chip microcomputer as the core of liquid crystal display of ultrasonic ranging system hardware circuit and software design method.

I design the part of hardware circuit and software circuit adopted modular method . Hardware circuit is mainly composed of ultrasonic transmitting circuit, ultrasonic receiving circuit, power circuit, and display circuit modules. Launching the function of the module is the side of launch ultrasonic wave.Receiving module is responsible for receiving the ultrasonic echo, reuse single-chip computer to calculate distance, and display the measurement results. This topic, on the other hand, the software design part is mainly composed of main program subroutine, ultrasonic launch, ultrasonic receiving interrupt program and display subroutine. The circuit design of system is rational,which can work stably, perform well and detect fast.The calculation is simple and can design the scope of the alarm function.But in terms of measurement accuracy ,it can meet the requirements of industrial use.

Keywords:STC8952; Ultrasonic wave; Measure distance; circuit

目 录

摘 要 I

Abstract II

1 绪论 1

1.1 课题设计背景和意义 1

1.2 超声波测距研究动态和应用 2

1.2.1本课题国内外研究动态 2

1.2.2超声波的应用 2

1.3课题设计任务及要求 3

1.3.1 课程设计的任务 3

1.3.2 课题设计的要求 4

1.4 课题设计的主要内容 4

2 系统总体方案设计 6

2.1 测距原理 6

2.2 超声波测距方法的选择 6

2.3 设计思路及原理框图 6

2.4超声波测距模块的选择 7

2.5蜂鸣器的选择 7

2.6温度传感器的选择 7

2.7设计方案 7

3 技术概述 9

3.1 超声波的介绍 9

3.1.1什么是超声波 9

3.1.2超声波的波形 9

3.1.3超声波的特性及特点 10

3.2超声波传感器的介绍 10

3.3 HC-SR04超声波测距模块 12

3.3.1 HC-SR04超声波模块的性能特点 12

3.3.2 HC-SR04的管教脚排列和电气参数 12

3.3.2.1 管教简介 12

3.3.2.2 HC-SR04的电气参数 13

3.4温度传感器 14

4 系统的硬件结构设计 16

4.1 STC89C52单片机的主要性能及特点 16

4.1.1 STC89C52主要性能 16

4.1.2 STC89C52外部结构及特性 16

4.1.3 STC89C52的内部组成 18

4.2 单片机最小系统 19

4.2.1 STC89C52单片机 19

4.2.2 复位电路 20

4.2.3 晶振电路 21

4.3 HC-RS04超声波测距模块 21

4.4 显示模块 22

4.5 报警模块 24

4.6 温度检测电路 25

4.6.1 温度检测方案的分析 25

4.6.2数字温度传感器DS18B20简介 25

4.6.3 DS18B20的结构及电路 25

5 系统软件设计 27

5.1 超声波测距仪的算法设计 27

5.2 主程序设计流程图 27

5.3 显示数据子程序 28

5.4 报警子程序 29

5.5按键子程序 29

6 调试及性能分析 31

6.1 调试 31

6.2 性能分析 31

7 总结 34

致 谢 35

参考文献 36

附录A超声波测距电路原理图 38

附录B程序清单 39

附录C元件清单 57

1 绪论

1.1 课题设计背景和意义

超声波优点很多,例如能量消耗缓慢,在介质中传播的距离较远,因而经常被用于距离的测量【1】

超声波测距方法跟其他方法比起来,有很多优点。例如,当光线的强度发生变化,被测物体的颜色发生改变,或者被测物所处的环境很恶劣,有很多干扰,超声波在一定程度上都能适应这些改变,对测量结果并不会有太大的影响。正是因为这些优点,所以超声波在导航,识别物体,测距这些方面应用很广。与其他方法相比起来,它不受光线、被测对象颜色等影响。当被测物处于黑暗、有灰尘、烟雾、电磁干扰、有毒等恶劣的环境下的话,超声波有一定的适应力。超声波的应用在空气测距这一块优势特别明显。因为在空气中,超声波的波速小,它的回波信号所包含的信息很容易检测,很容易分辨,此外,它的测量精度高,已经能达到工业实用的要求,结果更准确。而且超声波传感器简单方便,容易携带,对信息处理准确,检测所耗时间少,计算也容易,实时控制能力好。

您需要先支付 80元 才能查看全部内容!立即支付

课题毕业论文、开题报告、任务书、外文翻译、程序设计、图纸设计等资料可联系客服协助查找,优先添加企业微信。