基于单片机的超声波测距仪的设计本科论文.doc
《基于单片机的超声波测距仪的设计本科论文.doc》由会员分享,可在线阅读,更多相关《基于单片机的超声波测距仪的设计本科论文.doc(64页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、华北科技学院毕业设计(论文) 2014 届本 科 毕 业 设 计(论 文)设计(论文)题目: 基于单片机的超声波测距仪的设计 专 题 题 目: 姓 名: XXX 学 号:XXXXXXXXXXXXX 专业班级: 电信B102班 院 部: 电子信息工程学院 指导教师: XXX 2015年 6月 3日目录设计总说明IIntroductionIII1.绪论12.超声波测距原理论述22.1超声波介绍22.2超声波测距系统概述42.2超声波测距基本原理53.STC89C52RC单片机介绍73.1 STC89C52RC单片机的主要特性73.2 STC89C52RC单片机的工作模式73.3 STC89C52R
2、C单片机的引脚功能说明83.4 STC89C52RC单片机中的特殊功能寄存器103.5定时器2的三种用途133.6看门狗的应用174.硬件电路的设计与制作204.1超声波测距仪整体方案设计204.2超声波电路设计20 4.2.1超声波发射电路设计20 4.2.2超声波接收电路设计214.3下载模块电路设计 234.4单片机模块电路的设计24 4.4.1单片机的时钟电路24 4.4.1单片机的复位电路254.5显示电路的设计 27 4.5.1数码管的选择27 4.5.2驱动电路284.6报警电路294.7按键输入模块295.软件设计305.1程序主要框图及介绍305.2算法设计336.整机调试3
3、46.1软件介绍34 6.1.1 Altiun Designer软件介绍34 6.1.2单片机开发环境介绍356.2原理图设计356.3实物的焊接及调试36 6.3.1实物的焊接36 6.3.2超声波的调试377.总结与展望38参考文献39附录A 源程序代码40附录B 原理图及实物图51附录C 元器件清单53致谢54基于单片机的超声波测距仪的设计设计总说明声音是与人类生活紧密相联的一种自然现象,人们对声音早有认识,在人们的日常生活中存在着各式各样的声音。在科学史上,声学是发展最早的学科之一。然而,由于超声是人耳听不到的信号,直到18世纪,人们才开始研究海豚、蝙蝠等动物时,才推测自然界存在超声。
4、声波是一种能在气体、液体和固体中传播的机械波。根据声波振动频率的范围,可以分为次声波、声波、超声波和特超声波。当声的频率高到超过人耳的频率极限时,人们就觉察不出声的存在,我们称这种高频率的声为超声。频率高于人类听觉上限频率(约20000Hz)的声波,称为超声波,或称超声。距离是在不同的场合和控制中需要检测的一个参数,测距成为数据采集中要解决的一个问题。而由于超声波的速度相对光速小的多,其传播时间比较容易检测,并且易于定向发射,方向性好,强度好控制,因而人类采用仿真技能利用超声波测距。超声波测距是一种利用超声波特性、电子技术、光电开关相结合来实现非接触式距离测量的方法。 随着机器人技术在其诞生后
5、短短几十年中的迅猛发展,它的应用范围也逐步由工业生产走向人们的生活。如此广泛的应用使得提高人们对机器人的了解尤为重要。机器人通过其感知系统察觉前方障碍物距离和周围环境来实现环绕、自动寻线、测距等功能。超声波测距相对其他测距技术而言成本低廉,测量精度较高,不受环境限制,应用个方便,将它与红外、灰度传感器等结合共同实现机器人寻线和饶障功能。超声波由于指向性强、能量消耗缓慢且在介质中传播的距离较远,因而经常用于距离的测量。它主要用于倒车雷达、测距仪、物位测量仪、移动机器人的研制、建筑施工工地以及一些工业现场,例如:距离、液位、井深、管道长度、流速等场合。利用超声波检测往往比较迅速、方便,且计算简单、
6、易于做到实时控制,在测量精度方面也能达到工业使用的要求,因此得到了广泛的应用。 随着计算机技术、自动化技术和工业机器人的不断发展和广泛应用,测距问题显得越来越重要。目前常用的测距方式主要有雷达测距、红外测距、激光测距和超声波测距四种。与其他测距方法相比较,超生测距具有以下优点:1、超声波对色彩和光照度不敏感,可用于识别透明及漫反射性差的物体(如:玻璃、抛光体)。 2、超声波对外界光线和电磁场不敏感,可用于黑暗、有灰尘或烟雾、电磁干扰强、有毒等恶劣环境中。 3、超声波传感器结构简单、体积小、费用低、技术难度小、信息处理简单可靠、易于小型化和集成化。 近些年来,随着超声技术的不断深入,再加上其具有
7、高精度、无损、非接触等优点,和激光、涡流和无线电测距方法相比,具有一定的优异特性,在比较恶劣的环境中也具有一定的适应能力,所以超声的应用变得越来越普及。 因此,超声波作为一种测距识别手段已越来越引起人们的重视。 本论文设计基于单片机的超声波测距仪,主要做了以下研究工作: 1、分析超声波测距的原理,进行超声波测距系统的整体研究与设计; 2、对超声波发生电路进行论证和设计,用于产生测量的超声波; 3、对超声波接收电路进行论证和设计,用于接收反射回来的超声波; 4、对单片机系统及显示电路的设计; 5、对软件的设计; 6、对整机电路的安装与调试; 硬件电路部分,我采用STC公司生产的STC89C52芯
8、片作为主控芯片,内部集成8KROM,512ByteRAM,2个定时器,2个外部中断源,1个串行口,这些资源完全足够满足该超声波测距仪系统的要求。设计中通过其片上定时器、中断源对超声波发射到接收到超声波进行时间上的计算来达到测量距离的目的。 软件调试部分,先写些简单的小程序测试电路板上每个元器件的工作状态,以确保都能正常工作。接着对各个模块的测试,包括超声波模块的测试、MAX232模块的测试、数码管的初始化等。通过定时器计算的时间乘以超声波传播的速度从而达到测距的目的,将得到的数值通过数码管显示。关键词:超声波测距;STC89C52;数码管The design of the ultrasonic
9、 range finder based on singlechipIntroduction Sound is connected with the human life is a natural phenomenon, people have long known to sounds, in Peoples Daily life there are all kinds of sound. In the history of science, acoustics is one of the earliest disciplines development. However, due to the
10、 ultrasonic signal is to the human ear cant hear, until the 18th century, people started to research the animals such as dolphins and bats, speculated that nature exists ultrasound. Sound is a kind of can be spread in gas, liquid and solid mechanical wave. According to the acoustic frequency range,
11、can be divided into sound, sound waves, ultrasound and ultrasound. As the frequency of the sound high to exceeds the frequency limit of the human ear, people will detect the presence of dont make any noise, we call this kind of high frequency sound ultrasonic. Frequency is higher than the upper limi
12、t of human hearing frequency (20000 hz) of sound waves, called ultrasound, or ultrasound. That is commonly used in ultrasonic testing work frequency in the range of 0.25 to 20 MHZ. Distance is in different occasions and control need to detect a parameter, ranging in the data collection to solve a pr
13、oblem. Due to the speed of ultrasonic wave much smaller relative to the speed of light, its propagation time is easy to detect, and easy to directional transmission, good directivity, intensity control, thus human skills using ultrasonic ranging using simulation. Ultrasonic distance measurement is a
14、 kind of using ultrasonic characteristics, electronic technology, photoelectric switch to achieve the combination of non-contact distance measurement method. As robots technology in just a few years after the birth of its rapid development, its application range is gradually from industrial producti
15、on to peoples life. Such a broad range of applications make improve peoples understanding of the robot is particularly important. Robot through its perception system to detect obstacles ahead circle and the surrounding environment to implement, automatic line, range, etc. Ultrasonic ranging technolo
16、gy compared to low cost, high measurement precision, is not restricted by environment, convenient application, combine it with infrared, gray level sensor and other common robot line and rao barrier function. Ultrasonic due to strong directivity, energy consumption slow, in the medium transmission d
17、istance is farther, so often used for distance measurement. It is mainly used for reversing radar, range finder, level meter, the development of the mobile robot, the construction site, and some industrial field, such as: distance, liquid level, well depth, pipe length, velocity, etc. Using the ultr
18、asonic detection tend to be more rapid, convenient, and the calculation is simple and easy to do real-time control, the measurement precision can meet the requirements of industrial use, therefore has been widely used. Along with the computer technology, automation technology and the continuous deve
19、lopment of industrial robots and is widely used, distance measurement problem is more and more important. At present commonly used way of ranging radar ranging, infrared distance, laser ranging, and four kinds of ultrasonic ranging. Compared with other methods of distance measurement, super living r
20、ange has the following advantages: 1.the ultrasonic is not sensitive to light and colour, can be used to identify poor transparency and diffuse object(such as: glass, polishing). 2.the ultrasound on the outside light and is not sensitive to electromagnetic fields can be used to the darkness, dust or
21、 smoke, electromagnetic Interference is strong, toxic and other harsh environments. 3.he ultrasonic sensor of simple structure, small size, low cost, small technical difficulty, the information processing simple Reliable, easy miniaturization and integration. In recent years, with the deepening of t
22、he ultrasonic technology, plus it has the advantages of high resolution, nondestructive, non-contact, and laser compared, eddy current, and radio ranging method, has some excellent characteristics, in a relatively harsh environment also has a certain ability to adapt, so the application of ultrasoni
23、c is becoming more and more popular. Therefore, ultrasound, as a kind of distance recognition method has caused more and more peoples attention. This paper designs ultrasonic range finder based on singlechip, mainly done the following research work: 1.analyze the principle of ultrasonic ranging, ult
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 单片机 超声波 测距仪 设计 本科 论文
限制150内