基于单片机的超声波测距系统设计 1.docx

上传人:b****6 文档编号:16683804 上传时间:2023-07-16 格式:DOCX 页数:10 大小:21.47KB
下载 相关 举报
基于单片机的超声波测距系统设计 1.docx_第1页
第1页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第2页
第2页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第3页
第3页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第4页
第4页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第5页
第5页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第6页
第6页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第7页
第7页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第8页
第8页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第9页
第9页 / 共10页
基于单片机的超声波测距系统设计 1.docx_第10页
第10页 / 共10页
亲,该文档总共10页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

基于单片机的超声波测距系统设计 1.docx

《基于单片机的超声波测距系统设计 1.docx》由会员分享,可在线阅读,更多相关《基于单片机的超声波测距系统设计 1.docx(10页珍藏版)》请在冰点文库上搜索。

基于单片机的超声波测距系统设计 1.docx

基于单片机的超声波测距系统设计1

Ultrasonicdistancemeter

DocumentTypeandNumber:

UnitedStatesPatent5442592

Abstract:

Anultrasonicdistancemetercancelsouttheeffectsoftemperatureandhumidityvariationsbyincludingameasuringunitandareferenceunit.Ineachoftheunits,arepetitiveseriesofpulsesisgenerated,eachhavingarepetitionratedirectlyrelatedtotherespectivedistancebetweenanelectroacoustictransmitterandanelectroacousticreceiver.Thepulsetrainsareprovidedtorespectivecounters,andtheratioofthecounteroutputsisutilizedtodeterminethedistancebeingmeasured.

A.BACKGROUNDOFTHEINVENTION

Thisinventionrelatestoapparatusforthemeasurementofdistanceand,moreparticularly,tosuchapparatuswhichtransmitsultrasonicwavesbetweentwopoints.

Precisionmachinetoolsmustbecalibrated.Inthepast,thishasbeenaccomplishedutilizingmechanicaldevicessuchascalipers,micrometers,andthelike.However,theuseofsuchdevicesdoesnotreadilylenditselftoautomationtechniques.Itisknownthatthedistancebetweentwopointscanbedeterminedbymeasuringthepropagationtimeofawavetravellingbetweenthosetwopoints.Onesuchtypeofwaveisanultrasonic,oracoustic,wave.Whenanultrasonicwavetravelsbetweentwopoints,thedistancebetweenthetwopointscanbemeasuredbymultiplyingthetransittimeofthewavebythewavevelocityinthemediumseparatingthetwopoints.Itisthereforeanobjectofthepresentinventiontoprovideapparatusutilizingultrasonicwavestoaccuratelymeasurethedistancebetweentwopoints.

Whenthemediumbetweenthetwopointswhosespacingisbeingmeasuredisair,thesoundvelocityisdependentuponthetemperatureandhumidityoftheair.Itisthereforeafurtherobjectofthe,presentinventiontoprovideapparatusofthetypedescribedwhichisindependentoftemperatureandhumidityvariations.

B.SUMMARYOFTHEINVENTION

Theforegoingandadditionalobjectsareattainedinaccordancewiththeprinciplesofthisinventionbyprovidingdistancemeasuringapparatuswhichincludesareferenceunitandameasuringunit.Thereferenceandmeasuringunitsarethesameandeachincludesanelectroacoustictransmitterandanelectroacousticreceiver.Thespacingbetweenthetransmitterandthereceiverofthereferenceunitisafixedreferencedistance,whereasthespacingbetweenthetransmitterandreceiverofthemeasuringunitisthedistancetobemeasured.Ineachoftheunits,thetransmitterandreceiverarecoupledbyafeedbackloopwhichcausesthetransmittertogenerateanacousticpulsewhichisreceivedbythereceiverandconvertedintoanelectricalpulsewhichisthenfedbacktothetransmitter,sothatarepetitiveseriesofpulsesresults.Therepetitionrateofthepulsesisinverselyrelatedtothedistancebetweenthetransmitterandthereceiver.Ineachoftheunits,thepulsesareprovidedtoacounter.Sincethereferencedistanceisknown,theratioofthecounteroutputsisutilizedtodeterminethedesireddistancetobemeasured.Sincebothcountsareidenticallyinfluencedbytemperatureandhumidityvariations,bytakingtheratioofthecounts,theresultantmeasurementbecomesinsensitivetosuchvariations.C.DETAILEDDESCRIPTION

A.principleofultrasonicdistancemeasurement

1,theprincipleofpiezoelectricultrasonicgenerator

Piezoelectricultrasonicgeneratoristheuseofpiezoelectriccrystalresonatorstowork.Ultrasonicgenerator,theinternalstructureasshowninFigure1,ithastwopiezoelectricchipandaresonanceplate.Whenit'stwopluspulsesignal,thefrequencyequaltotheintrinsicpiezoelectricoscillationfrequencychip,thechipwillhappenpiezoelectricresonance,andpromotethedevelopmentofplatevibrationresonance,ultrasoundisgenerated.Conversely,ifthetwoarenotinter-electrodevoltage,whentheboardreceivedultrasonicresonance,itwillbeforvibrationsuppressionofpiezoelectricchip,themechanicalenergyisconvertedtoelectricalsignals,thenitbecomestheultrasonicreceiver.

2,theprincipleofultrasonicdistancemeasurement

Ultrasonictransmitterinadirectiontolaunchultrasound,inthemomenttolaunchthebeginningoftimeatthesametime,thespreadofultrasoundintheair,obstaclesonhiswaytoreturnimmediately,theultrasonicreflectedwavereceivedbythereceiverimmediatelystoptheclock.Ultrasoundintheairasthepropagationvelocityof340m/s,accordingtothetimerrecordsthetimet,wecancalculatethedistancebetweenthelaunchdistancebarrier(s),thatis:

s=340t/2

B.UltrasonicRangingSystemfortheSecondCircuitDesign

Systemischaracterizedbysingle-chipmicrocomputertocontroltheuseofultrasonictransmitterandultrasonicreceiversincethelaunchfromtimetotime,single-chipselectionof8751,economic-to-use,andthechiphas4KofROM,tofacilitateprogramming.CircuitschematicdiagramshowninFigure2.Drawonlythefrontrangeofthecircuitwiringdiagram,leftandrightinfrontofRangingRangingcircuitsandthesamecircuit,itisomitted.1,40kHzultrasonicpulsegeneratedwiththelaunch.

RangingsystemusingtheultrasonicsensorofpiezoelectricceramicsensorsUCM40,itsoperatingvoltageofthepulsesignalis40kHz,whichbythesingle-chipimplementationofthefollowingprocedurestogenerate.

puzel:

mov14h,#12h;ultrasonicfiringcontinued200ms

here:

cplp1.0;output40kHzsquarewave

nop;

nop;

nop;

djnz14h,here;

ret

Ranginginfrontofsingle-chipterminationcircuitP1.0inputport,singlechipimplementationoftheaboveprocedure,theP1.0portina40kHzpulseoutputsignal,afteramplificationtransistorT,thedrivetolaunchthefirstultrasonicUCM40T,issued40kHzultrasonicpulse,andthecontinuedlaunchof200ms.Rangingtherightandtheleftsideofthecircuit,respectively,theninputportP1.1andP1.2,theworkingprincipleandcircuitinfrontofthesamelocation.

2,receptionandprocessingofultrasonic

UsedtoreceivethefirstlaunchofthefirstpairUCM40R,theultrasonicpulsemodulationsignalintoanalternatingvoltage,theop-ampamplificationIC1AandafterpolarizationIC1BtoIC2.IC2islockedloopwithaudiodecoderchipLM567,internalvoltage-controlledoscillatorcenterfrequencyoff0=1/1.1R8C3,capacitorC4determinetheirtargetbandwidth.R8-conditioninginthelaunchofthecarrierfrequencyontheLM567inputsignalisgreaterthan25mV,theoutputfromthehighjump8feetintoalow-level,asinterruptrequestsignalstothesingle-chipprocessing.

Ranginginfrontofsingle-chipterminationcircuitoutputportINT0interruptthehighestpriority,rightorleftlocationoftheoutputcircuitwithoutputgateIC3AaccessINT1portsingle-chip,whilesingle-chipP1.3andP1.4receivedinputIC3A,interruptedbytheprocesstoidentifythesourceofinquirytodealwith,interruptprioritylevelforthefirstleftrightafter.Partofthesourcecodeisasfollows:

receive1:

pushpsw

pushacc

clrex1;relatedexternalinterrupt1

jnbp1.1,right;P1.1pinto0,rangingfromrightto

interruptserviceroutinecircuit

jnbp1.2,left;P1.2pinto0,totheleftrangingcircuit

interruptserviceroutine

return:

SETBEX1;openexternalinterrupt1

pop?

acc

pop?

psw

reti

right:

...?

;rightlocationentrancecircuitinterruptserviceroutine

?

Ajmp?

Return

left:

...;leftRangingentrancecircuitinterruptserviceroutine

?

Ajmp?

Return

3,thecalculationofultrasonicpropagationtime

Whenyoustartfiringatthesametimestartthesingle-chipcircuitrywithinthetimerT0,theuseoftimercountingfunctionrecordsthetimeandthelaunchofultrasonicreflectedwavereceivedtime.Whenyoureceivetheultrasonicreflectedwave,thereceivercircuitoutputsanegativejumpintheendofINT0orINT1interruptrequestgeneratesasignal,single-chipmicrocomputerinresponsetoexternalinterruptrequest,theimplementationoftheexternalinterruptservicesubroutine,readthetimedifference,calculatingthedistance.Someofitssourcecodeisasfollows:

RECEIVE0:

PUSHPSW

PUSHACC

CLREX0;relatedexternalinterrupt0

?

MOVR7,TH0;readthetimevalue

MOVR6,TL0?

CLRC

MOVA,R6

SUBBA,#0BBH;calculatethetimedifference

MOV31H,A;storageresults

MOVA,R7

SUBBA,#3CH

MOV30H,A?

SETBEX0;openexternalinterrupt0

POPACC?

POPPSW

RETI

D.Fourth,theultrasonicrangingsystemsoftwaredesign

Softwareisdividedintotwoparts,themainprogramandinterruptserviceroutine,showninFigure3(a)(b)(c)below.Completionoftheworkofthemainprogramisinitialized,eachsequenceofultrasonictransmittingandreceivingcontrol.

Interruptserviceroutinesfromtimetotimetocompletethreeoftherotationdirectionofultrasoniclaunch,themainexternalinterruptservicesubroutinetoreadthevalueofcompletiontime,distancecalculation,theresultsoftheoutputandsoon.

E.CONCLUSIONS

Requiredmeasuringrangeof30cm~200cmobjectsinsidetheplanetodoanumberofmeasurementsfoundthatthemaximumerroris0.5cm,andgoodreproducibility.Single-chipdesigncanbeseenontheultrasonicrangingsystemhasahardwarestructureissimple,reliable,smallfeaturessuchasmeasurementerror.Therefore,itcanbeusednotonlyformobilerobotcanbeusedinotherdetectionsystems.

Thoughts:

Asforwhythereceiverdonothavethetransistoramplifiercircuit,becausethemagnificationwell,CX20106integratedamplifier,butalsowithautomaticgaincontrollevel,magnificationto76dB,thecenterfrequencyis38kto40k,isexactlyresonantultrasonicsenso

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 初中教育 > 科学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2