基于单片机的超声波测距系统的设计与实现

  • 格式:doc
  • 大小:5.22 MB
  • 文档页数:40

毕业设计(论文)

题 目 基于单片机的超声波测距系统

的设计与实现

系 (院)

专 业

班 级

学生姓名

学 号

指导教师

职 称

二〇一五年六月 日

独 创 声 明

本人郑重声明:所呈交的毕业设计(论文),是本人在指导老师的指导下,独立进行研究工作所取得的成果,成果不存在知识产权争议。尽我所知,除文中已经注明引用的内容外,本设计(论文)不含任何其他个人或集体已经发表或撰写过的作品成果。对本文的研究做出重要贡献的个人和集体均已在文中以明确方式标明。

本声明的法律后果由本人承担。

作者签名:

二〇 年 月 日

毕业设计(论文)使用授权声明

本人完全了解滨州学院关于收集、保存、使用毕业设计(论文)的规定。

本人愿意按照学校要求提交学位论文的印刷本和电子版,同意学校保存学位论文的印刷本和电子版,或采用影印、数字化或其它复制手段保存设计(论文);同意学校在不以营利为目的的前提下,建立目录检索与阅览服务系统,公布设计(论文)的部分或全部内容,允许他人依法合理使用。

(保密论文在解密后遵守此规定)

作者签名:

二〇 年 月 日

I 基于单片机的超声波测距系统的设计与实现

摘 要

超声波是一种机械波,其振动频率超过20KHz。人耳无法捕捉到它,超出了人的听力极限。具有聚束、定向及反射、透射等机械特性。这些机械特性正是超声波被利用作为测量距离的重要方法的原因之一。而超声波具有简单快捷,精确度高和耐用都特点是另一大原因。

本次设计对单片机、超声波和超声波测距原理进行了详细介绍。更是用STC89C51单片机、HC-SR04超声波模块、DS18B20温度传感器和LCD液晶显示屏通过软件编程的方式设计出了一个简单易操作、经济实用和精度高简易超声波测距仪。通过误差分析进行了温度补偿,并且做到了可调节测量量程,实现报警等功能。

关键词:单片机;液晶显示;报警;测距

滨州学院本科毕业设计(论文)

II Design and implementation of ultrasonic distance

measurement system based on MCU

Abstract

Ultrasonic refers to the vibration frequency is greater than 20kHz is equal

to the sum of the acoustic wave, the vibration frequency is beyond the range

of the human ear hearing, so known as ultrasound. Ultrasonic is mechanical

wave. Have the mechanical properties of the polymer, such as the spotlight,

orientation, reflection and transmission. These mechanical properties is one

of the reasons to be used as an important method of ultrasonic distance

measurement. Ultrasound is simple and efficient, high precision and durable

character is ticsis nother big reason.

This design gives a detailed introduction to the microcontroller,ultrasonic

and ultrasonic ranging principle. It is with MCU STC89C51, hc-sr04

ultrasonic module, DS18B20 temperature sensor and LCD display through

software programming to design out a simple and easy operation, economy

and practicality and accuracy high simple ultrasonic range finder. Through

the error analysis of temperature compensation, and to achieve the adjustable

measurement range, realize the alarm function.

Key words: SCM; LCD; alarm; ranging

滨州学院本科毕业设计(论文)

i 目 录

第一章 绪论 ....................................................................................................................... 1

1.1 研究的背景和意义 .................................................................................................. 1

1.2 国内外研究现状 ...................................................................................................... 1

1.3 课题研究内容和意义 .............................................................................................. 2

第二章 超声波测距的原理 ............................................................................................... 5

2.1 超声波介绍 .............................................................................................................. 5

2.2 超声波传感器的介绍 ........................................................................................... 5

2.2.1 传感器的选择 ................................................................................................... 6

2.2.2 超声波测距的原理 ........................................................................................... 7

2.2.3 温度补偿 ........................................................................................................... 8

2.2.4 测量盲区 ........................................................................................................... 9

2.3 本章小结 .................................................................................................................. 9

第三章 系统硬件设计 ..................................................................................................... 10

3.1 系统硬件设计 ........................................................................................................ 10

3.2 单片机概述 .............................................................................................................11

3.2.1 STC89C51主要性能特点 .............................................................................11

3.2.2 STC89C51结构组成 .................................................................................... 12

3.2.3 STC89C51内部组成 .................................................................................... 14

3.3 超声波发射电路设计 ............................................................................................ 15

3.3.1 发射电路设计方案 ......................................................................................... 15

3.3.2 超声波发射器的注意事项 ............................................................................. 16