资源描述:
《基于单片机的超声波测距系统设计》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、基于单片机的超声波测距系统设计摘要超声波是一种指向性强,能量消耗缓慢,在介质中传播距离较远的声波,很适合用于距离测量。目前国内一般是用专用集成电路设计超声波测距仪,但是成本高,没有显示,操作使用不方便,拓展不灵活。而基于单片机的超声波测距克服了上述缺点,所以应用非常广泛,这种设计要求非接触式测距。本设计是以单片机技术为基础,实现对前方物体距离的测量。该系统设计主要由主控制器模块、超声波发射模块、超声波接收模块和显示模块等四个基本模块构成,用接收部分接收超声波。本设计利用两个中断,在发射信号时,打开定时器中断0和外部中断0使定时器计时,接收到发射超声波
2、信号时,外部中断0关闭中断,这时定时器中断0计录的时间就为超声波传播经过测距仪到前方物体的来回时间,经过单片机处理得到距离值S并且通过LCD1602显示出来。本设计在室温条件下的精确度能达到3mm以内,但是要求被测量物体周围比较空旷而且空气温度要求是室温精确度才会达到以上精度。关键词:单片机,超声波传感器,LCD1602ThedesignofultrasonicrangefinderbasedonsinglechipmicrocomputerABSTRACTUltrasonicisakindofstrongdirectivity,energycons
3、umptionslow,inthemediumdistancetransmissionofsoundwaves,verysuitablefordistancemeasurementAtpresentdomesticgeneralistouseultrasonicrangefinderapplication-specificintegratedcircuitdesign,butthecostishigh,nodisplay,operationisnotconvenient,notflexible.Theultrasonicrangingbasedons
4、inglechipmicrocomputertoovercometheaboveshortcomings,sotheapplicationisverybroad,thisnon-contactrangingdesignrequirements.Thisdesignisbasedonsinglechipmicrocomputertechnology,realizesthemeasurementofthefrontobjectdistance.Thesystemdesignismainlycomposedofmaincontrollermodule,ul
5、trasoniclaunchmodule,ultrasonicreceivingmoduleanddisplaymoduleandsoonfourbasicmodules,withareceivingpartreceivingultrasound.Thisdesignusestwointerrupts,whentransmitting,openthetimerinterrupt0timerandexternalinterrupt0timer,receivesthesideoflaunchultrasonicwavesignal,theexternal
6、interrupt0closedinterrupted,thenthetimerinterrupt0metertorecordthetimefortheultrasonicpropagationthroughtherangefindertotheobjectinfrontofthetimebackandforth.AndtheresultistreatedwithsinglechipmicrocomputerdistancevaluesSandthroughLCD1602display.Thisdesignatroomtemperatureunder
7、theconditionofprecisioncanreachlessthan3mm,buttherequestwasrequiredmeasurearoundanobjectisopenandtheairtemperatureisaboveroomtemperaturewillreachtheprecisionaccuracy.KEYWORDS:singlechipmicrocomputer;ultrasoundsensor;LCD1602目录1绪论11.1选题背景11.2研究意义12超声波测距系统总体设计22.1超声波测距系统设计的目的和要求22
8、.2超声波测距系统的工作原理23超声波测距系统硬件设计43.1AT89S52单片机的概述43.2LCD160