您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 基于51单片机超声波测距仪
洛阳理工学院毕业设计(论文)I基于51单片机的超声波测距仪设计摘要利用超声波进行测距有许多优点比如不受光强度、色彩和电磁场等外界因素的影响,而且超声波传感器的价位较低、结构也较为简单,超声波以声速传播,方便收发与计算。在汽车倒车雷达、移动机器人的避障、特别是测量距离等许多方面都已有了非常普遍的应用。本次毕业设计的超声波测距仪是在STC89C51单片机的基础上设计的,在分析和了解了超声波的一些优点和特性后,又查看了利用超声波测距的基本原理。最后决定使用51单片机系统和超声波传感器共同组成。设计的超声波测距仪的硬件部分主要包括电源及复位模块、单片机与超声波模块组成的超声波发射模块、超声波接收模块、LED数码显示模块和扩展报警模块。软件部分主要包括单片机主程序、根据超声波发射与接收计算距离程序、LED距离显示程序、按键控制程序和蜂鸣器报警程序,这样安排使得系统具有模块化的特点。系统容易进行控制,具有可靠地的性能,具有较高的测量精度,最重要的是能对距离进行实时测量。关键词:单片机,测距仪,超声波,实时测量洛阳理工学院毕业设计(论文)IIDesignofUltrasonicDistanceMeterBasedon51MCMABSTRACTUsingultrasonicranginghasmanyadvantagesforexample,fromtheeffectsoflightintensity,colorandelectromagneticfieldandotherexternalfactorsandpricelowerultrasonicsensors,thestructureissimple,ultrasonicsoundsvelocity,convenienttransceiverandcalculation.Inthecarreverseradar,mobilerobotobstacleavoidance,especiallymeasuringdistanceandmanyotheraspectshavebeenverycommonapplication.ThegraduationdesignofultrasonicrangefinderbasedonSTC89C51MCUdesign,analysisandunderstandingofthesomeadvantagesandcharacteristicsofultrasonicandlookedattheuseofthebasicprincipleofultrasonicdistancemeasurement.Finally,thecompositionofthe51single-chipmicrocomputersystemandultrasonicsensorisdecided..Thedesignofultrasonicrangefinderhardwarepartconsistsofthepowerandresetmodule,SCMandultrasonicmoduleconsistsofultrasonicemissionmodule,ultrasonicreceivingmodule,LEDdigitaldisplayexpansionmoduleandalarmmodule.SoftwarepartmainlyincludesMCUprogram,accordingtotheultrasonictransmittingandreceivingcomputingprogramdistance,thedistanceofLEDdisplayprogram,keycontrolproceduresandbuzzeralarmprocedures,thisarrangementenablesthesystemtohavethecharacteristicsofmodular.Thesystemiseasytocontrolandhasthereliableperformance,andhasthehigheraccuracy,andthemostimportantisthereal-timemeasurementofthedistance.KEYWORDS:Singlechipmicrocomputer,Rangefinder,Ultrasonic,Real-timemeasurement洛阳理工学院毕业设计(论文)III目录摘要...................................................................................................I目录................................................................................................III第1章绪论....................................................................................11.1研究背景...............................................................................11.2研究的主要意义...................................................................1第2章系统电路设计.......................................................................32.1系统结构设计.......................................................................32.2电路总体设计方案...............................................................32.2.1发射与接收电路设计方案..........................................32.2.2显示电路设计方案.....................................................52.2.3报警电路设计方案.....................................................62.2.4系统复位电路设计.....................................................6第3章系统硬件设计.......................................................................93.1单片机概述...........................................................................93.1.1STC89C51主要性能.....................................................93.1.2STC89C51外部结构及特性........................................93.1.3STC89C51内部组成.................................................113.2超声波测距模块.................................................................133.2.1超声波传感器介绍...................................................133.2.2HC-SR04超声波测距芯片的性能特点....................133.2.3超声波时序图...........................................................153.3驱动显示电路及报警电路.................................................163.3.1LED数码管显示电路...............................................163.3.2蜂鸣器报警电路.......................................................173.4HC-RS04超声波测距原理.................................................183.5按键设置电路.....................................................................19第4章系统软件设计.....................................................................214.1系统主程序.........................................................................21洛阳理工学院毕业设计(论文)IV4.2显示距离子程序.................................................................224.3报警子程序.........................................................................224.4按键子程序.........................................................................24第5章系统仿真.............................................................................255.1系统仿真环境——Proteus.................................................255.2仿真....................................................................................255.3误差及特性分析.................................................................27结论..............................................................................................28谢辞................................................................................................29参考文献..........................................................................................30洛阳理工学院毕业设计(论文)1第1章绪论1.1研究背景超声波测距法是通过超声波测量从已知位置到被测物体表面的距离的利用超声波的方法。超声波也是一种机械波,是一种频率在20kHz以上的声波。超声波测距是人们根据蝙蝠通过超声波反射进行捕食的方法发现的,也是仿生学中非常出名的例子,对生产领域产生了很大的影响。跟着电子
本文标题:基于51单片机超声波测距仪
链接地址:https://www.777doc.com/doc-5376010 .html