Tkool Electronics

IIntroductionWhentestingenvironmentalprotection,safety,andeconomicindicatorssuchasnoise,accelerationperformance,maximumspeed,andfuelconsumptionofmotorvehicles,itisnecessarytomeasureandcontrolthevehiclespeed.Mostexistingvehiclespeedmeasurementmethodsuseelectronictimingdevicesorstopwatchestomeasurevehicles.Thetimeittakestotravelafixeddistanceandthenfindtheaveragespeed.Generally,theprocessorandthedisplaypartoftheelectronictimingdevicearebasicallythesame,butthespeedsensorpartisdifferent,andthecharacteristicsofthesensordirectlyaffecttheaccuracyofthemeasurementresult.Atpresent,thecommonlyusedspeedsensorsincludepressuresensitivesensors,COMScamerasandparallellightsources.Theformerhasasimplestructure,butitiscumbersometolay,thesensoriseasilydamaged,andthesensitivityisreducedafterlong-termuse,whichaffectsthemeasurementresults.Thelatterhashighsensitivityandaccuratemeasurement.However,thecostistoohigh,involvesmoreequipment,andhashigherrequirementsfortheplacementofthelightsource.Consideringtheaboveproblems,itisafeasiblemethodtodesignanewinfraredspeedsensorusingLM567.Thesensorissmallinsize,lowincost,simpleinoperation,easytouse,hashighsensitivity,accuracy,stabilityandanti-interferenceability,andissuitableformeasuringtheaveragespeedofavehiclewithinafixeddrivingdistance.Figure1.LM567CatalogIIntroductionIIWorkingPrincipleofTraditionalSpeedMeasuringDevice2.1UsingPressureBeltRoadTester2.2UsingLaserRoadTesterIIIWorkingPrincipleofInfraredSpeedSensorBasedonLM5673.1InternalStructureandFunctionofLM5673.2PrincipleofInfraredSpeedMeasurementBasedonLM567IVConclusionOrdering&QuantityIIWorkingPrincipleofTraditionalSpeedMeasuringDeviceThefollowingusesthemeasurementofmotorcycleaccelerationnoiseasanexample,tointroducetheprinciplesandadvantagesdisadvantagesoftheconventionalspeedmeasuringdevicescurrentlycommonlyused.Figure1isasimplifiedlayoutofmotorcycleaccelerationnoisetest.2.1UsingPressureBeltRoadTesterForthespeedmeasurementmethodusingthepressurebeltroadtester,placethepressurebeltatAA,BB,CC,DDrespectivelyandstickthepressurebelttotheroadsurfacewell.ThedistancebetweenAAandBB,CCandDD(thatis,thespeedmeasurementzone)is1meter,andthepressurebeltandtheroadtesterareconnectedinsequencewithacable.WhenthevehiclepassesthepressurebeltatAA,thepressure-sensitivesensorinthepressurebeltistriggered,andthetriggersignalissenttotheroadtestertostartthetimingofitsinternaltimingdevice;WhenthevehiclepassesBB,atriggersignalisgeneratedagaintostopthetimingdevice.Usingtheinternalprocessoroftheroadtester,thetimetakentopassthedistancebetweenAAandBBisconvertedintovehiclespeedanddisplayedontheLCDscreen.Figure2.LayoutDiagramUsingPressureBeltRoadTesterSimilarly,avehiclespeedvaluecanbemeasuredbetweenCCandDDtomeettherequirementsofnoisemeasurement.Theworkingprincipleofthisspeedmeasurementmethodissimple,buttheequipmentismoretroublesometolay,andthesensoriseasilydamaged.Afterlong-termuse,thesensitivitywillbereduced,whichwillaffectthemeasurementresult.2.2UsingLaserRoadTesterForthespeedmeasurementmethodusingthelaserroadtester,fourparallellaserlightsourcesareplacedatfourpositionsofA,B,C,andD,andfourareplacedatfourpositionsofABCD.CMOScameraforreceivinglasersignals.Thelightsourcecanbeadjustedsothatthelaserlightemittedisalignedwiththecenterofthecamera,andthecameraisconnectedtotheroadtesterinsequence.WhenthevehiclepassesAA,thelightisblocked,andthecamerageneratesatriggersignaltomaketheinternaltimingdeviceoftheroadtesterwork;WhenthevehiclepassesBB,atriggersignalisgeneratedagaintostopthetimingdevice,andtheinternalprocessoroftheroadtesterisusedtoconvertthetimespentthroughthedistancebetweenAAandBBtothevehiclespeedanddisplayitontheLCDscreen.on.Figure3.LayoutDiagramUsingLaserRoadTesterSimilarly,aspeedvaluecanbemeasuredbetweenCCandDD.Thesensitivityandmeasurementaccuracyofthisspeedmeasurementmethodareveryhigh,buttheoperationisextremelyinconvenient.Notonlydoeseachlaserlightsourcerequireanindependentpowersupply,butalsothelasersignalmustbedirectedtothecenterreceivingpointofthecamera,whichplaceshighrequirementsontheplacementofthelightsource,otherwisethesensorwillbedifficulttoworkproperly.IIIWorkingPrincipleofInfraredSpeedSensorBasedonLM567Thisblogusesaphase-lockedloopaudiodecodingchipLM567todesignanewinfraredspeedsensor.Itscircuitdiagramandworkingprincipleareasfollows.3.1InternalStructureandFunctionofLM567LM567isspeciallyusedtodemodulateasingletonefrequencymodulationsignal,anditsoperatingfrequencycanbeashighas500kHz.Itiswidelyusedinindustrialautomaticcontrol,remotecontroltelemetry,securityalarmandotherfields.LM567ismainlycomposedofquadraturephasedetector,phase-lockedloopandamplifier.ItsinternalstructureisshowninFigure2.Pins5and6ofLM567areexternallyconnectedwithtimingresistorsandcapacitorsR,C.RandCdeterminethecenterfrequencyf0ofthephase-lockedloopinternalvoltagecontrolledoscillator,thatis,f0.ResistorRisconnectedbetweenpins5and6,ofwhichpin6isgroundedthroughcapacitorC(Uss).IfRis2~20k,theLM567canextractthetonesignalintherangeof0.01~500kHz.Pins1and2ofLM567arerespectivelyconnectedtothegroundwithacapacitortoformanoutputfilternetworkandaphase-lockedlooplow-passfilternetwork.ThecapacityoftheexternalcapacitorC2onpin2determinesthecapturebandwidthofthephase-lockedloop,anditssizeisBw1070.Uinistheeffectivevalueofthesinewavesignalvoltageinputfrompin3,andrequiresUin25mV,generallybetween100~200mV.TheexternalcapacitorC1ofpin1istheoutputfiltercapacitorofthequadraturephasedetector,anditscapacityismorethantwicethecapacityofthecapacitorC2connectedtopin2,whichshouldsatisfyC12C2.Figure4.TopViewofLM567(1)UsingLM567asFrequencyModulatorPin2isconnectedtotheinputofthelow-passfilterofthephase-lockedloop.Themodulatedsignaladdedfrompin2isfilteredbyalow-passfiltertoremoveout-of-bandnoiseandnoise,andthenaddedtothecenterfrequencyf0ofthevoltage-controlledoscillatorforfrequencymodulation,andthenthepin5outputstheFMsignal.Thecenterfrequencyf0oftheFMsignalisdeterminedbytheparametersoftheRCresistor-capacitornetworkconnectedtopins5and6.WhenLM567isusedasthefrequencymodulationcircuit,onlyitsinternalphase-lockedlooplow-passfilterandvoltage-controlledoscillatorareused.ChangingtheparametervalueoftheRCnetworkcanrealizemodulationtodifferentfrequencies.(2)UsingLM567asFrequencyDemodulatorThemodulatedsignalisinputfrompin3.Whenthecenterfrequencyoftheinputsignalisequaltothecenterfrequencyf0ofthevoltage-controlledoscillatorintheLM567,thelow-passfilter(pin2)oftheloopoutputsthedemodulatedsignal.3.2PrincipleofInfraredSpeedMeasurementBasedonLM567ThecircuitdiagramoftheinfraredspeedsensorbasedonLM567isshowninFigure3.TheinternaloscillatoroftheLM567providesasquarewavesignaltodrivefourLEDstoemitinfraredlight,anditsfrequencyisdeterminedbyR2andC4.Figure5.CircuitDiagramofInfraredSpeedSensorPlacethefoursensorsinthefourpositionsA,B,C,andDinFigure1.Whenthevehiclepassesthesensor,theinfraredraysemittedbytheLEDarereflectedbythevehiclebody.ThephotosensitivetubeQ1receivesthereflectedlight,isamplifiedbythetransistorandconvertedintoavoltagesignal,andissenttotheinternalphasedetectoroftheLM567forsynchronousdemodulation,andthenconvertedintoadigitalsignalbythecomparatorinsidetheLM567andoutputfrompin8.Theoutputsignalistransmittedtotheroadtester,whichtriggersthetimingdeviceintheroadtestertostarttiming.Similarly,whenthevehiclepassesthesensoratpointB,atriggersignalisgeneratedtostopthetimingdeviceandpasstheroadtester.TheinternalprocessoroperatestoobtainthespeedofthevehicleasitpassesAAandBB.LM567isaphase-lockedloopaudiodecodingcircuit.Inthecircuit,itisusedforfrequencyselection,thatis,thecircuitoutputslowlevelonlywhenthefrequencyofthe3-pininputsignalisconsistentwiththefrequencyoftheLM567internaloscillator,otherwisetheoutputishigh.Level.Inotherwords,onlywhenthereflectedinfraredlightreceivedbyQ1comesfromtheLEDinitsowncircuit,theLM567willoutputatriggersignalfromhightolowtotheroadtester.Thebiggestfeatureofthiscircuitistorealizetheautomaticsynchronizationoftheinfraredemissionfrequencyandtheworkingfrequencyofthereceivingcircuit;Thatis,thereisnospecialpulsegeneratingcircuitintheinfraredtransmittingpart,andthepulseisdirectlyintroducedfromthedetectioncircuitofthereceivingpart(LM567phase-lockedcenterfrequencysignal).Inthisway,thewiringanddebuggingworkissimplified,avoidinginconsistenttransmissionandreceptionfrequenciescausedbychangesinthesurroundingenvironmentandcomponentparameters,eliminatingmutualinterferencebetweenadjacentsensors,andgreatlyenhancingcircuitstabilityandanti-interferencecapabilities.IVConclusionTheinfraredspeedsensordesignedbasedontheLM567modulationanddemodulationfunctionrealizestheautomaticsynchronizationoftheinfraredtransmissionfrequencyandtheworkingfrequencyofthereceivingcircuit.Inaddition,ithasthecharacteristicsofstronganti-interferenceabilityandstability,lowcostandsimplestructure.Therefore,itcanbewidelyusedtomeasuretheaveragespeedofvehiclessuchasautomobilesandmotorcycles.Figure6.LM567Afterreadingtheblog,haveyoubetterunderstandLM567?Finally,ifyouhaveanyquestionsaboutLM567,pleasedonothesitatetoleaveamessageinthecommentsectionbelow!

405NM

IIntroductionWhentestingenvironmentalprotection,safety,andeconomicindicatorssuchasnoise,accelerationperformance,maximumspeed,andfuelconsumptionofmotorvehicles,itisnecessarytomeasureandcontrolthevehiclespeed.Mostexistingvehiclespeedmeasurementmethodsuseelectronictimingdevicesorstopwatchestomeasurevehicles.Thetimeittakestotravelafixeddistanceandthenfindtheaveragespeed.Generally,theprocessorandthedisplaypartoftheelectronictimingdevicearebasicallythesame,butthespeedsensorpartisdifferent,andthecharacteristicsofthesensordirectlyaffecttheaccuracyofthemeasurementresult.Atpresent,thecommonlyusedspeedsensorsincludepressuresensitivesensors,COMScamerasandparallellightsources.Theformerhasasimplestructure,butitiscumbersometolay,thesensoriseasilydamaged,andthesensitivityisreducedafterlong-termuse,whichaffectsthemeasurementresults.Thelatterhashighsensitivityandaccuratemeasurement.However,thecostistoohigh,involvesmoreequipment,andhashigherrequirementsfortheplacementofthelightsource.Consideringtheaboveproblems,itisafeasiblemethodtodesignanewinfraredspeedsensorusingLM567.Thesensorissmallinsize,lowincost,simpleinoperation,easytouse,hashighsensitivity,accuracy,stabilityandanti-interferenceability,andissuitableformeasuringtheaveragespeedofavehiclewithinafixeddrivingdistance.Figure1.LM567CatalogIIntroductionIIWorkingPrincipleofTraditionalSpeedMeasuringDevice2.1UsingPressureBeltRoadTester2.2UsingLaserRoadTesterIIIWorkingPrincipleofInfraredSpeedSensorBasedonLM5673.1InternalStructureandFunctionofLM5673.2PrincipleofInfraredSpeedMeasurementBasedonLM567IVConclusionOrdering&QuantityIIWorkingPrincipleofTraditionalSpeedMeasuringDeviceThefollowingusesthemeasurementofmotorcycleaccelerationnoiseasanexample,tointroducetheprinciplesandadvantagesdisadvantagesoftheconventionalspeedmeasuringdevicescurrentlycommonlyused.Figure1isasimplifiedlayoutofmotorcycleaccelerationnoisetest.2.1UsingPressureBeltRoadTesterForthespeedmeasurementmethodusingthepressurebeltroadtester,placethepressurebeltatAA,BB,CC,DDrespectivelyandstickthepressurebelttotheroadsurfacewell.ThedistancebetweenAAandBB,CCandDD(thatis,thespeedmeasurementzone)is1meter,andthepressurebeltandtheroadtesterareconnectedinsequencewithacable.WhenthevehiclepassesthepressurebeltatAA,thepressure-sensitivesensorinthepressurebeltistriggered,andthetriggersignalissenttotheroadtestertostartthetimingofitsinternaltimingdevice;WhenthevehiclepassesBB,atriggersignalisgeneratedagaintostopthetimingdevice.Usingtheinternalprocessoroftheroadtester,thetimetakentopassthedistancebetweenAAandBBisconvertedintovehiclespeedanddisplayedontheLCDscreen.Figure2.LayoutDiagramUsingPressureBeltRoadTesterSimilarly,avehiclespeedvaluecanbemeasuredbetweenCCandDDtomeettherequirementsofnoisemeasurement.Theworkingprincipleofthisspeedmeasurementmethodissimple,buttheequipmentismoretroublesometolay,andthesensoriseasilydamaged.Afterlong-termuse,thesensitivitywillbereduced,whichwillaffectthemeasurementresult.2.2UsingLaserRoadTesterForthespeedmeasurementmethodusingthelaserroadtester,fourparallellaserlightsourcesareplacedatfourpositionsofA,B,C,andD,andfourareplacedatfourpositionsofABCD.CMOScameraforreceivinglasersignals.Thelightsourcecanbeadjustedsothatthelaserlightemittedisalignedwiththecenterofthecamera,andthecameraisconnectedtotheroadtesterinsequence.WhenthevehiclepassesAA,thelightisblocked,andthecamerageneratesatriggersignaltomaketheinternaltimingdeviceoftheroadtesterwork;WhenthevehiclepassesBB,atriggersignalisgeneratedagaintostopthetimingdevice,andtheinternalprocessoroftheroadtesterisusedtoconvertthetimespentthroughthedistancebetweenAAandBBtothevehiclespeedanddisplayitontheLCDscreen.on.Figure3.LayoutDiagramUsingLaserRoadTesterSimilarly,aspeedvaluecanbemeasuredbetweenCCandDD.Thesensitivityandmeasurementaccuracyofthisspeedmeasurementmethodareveryhigh,buttheoperationisextremelyinconvenient.Notonlydoeseachlaserlightsourcerequireanindependentpowersupply,butalsothelasersignalmustbedirectedtothecenterreceivingpointofthecamera,whichplaceshighrequirementsontheplacementofthelightsource,otherwisethesensorwillbedifficulttoworkproperly.IIIWorkingPrincipleofInfraredSpeedSensorBasedonLM567Thisblogusesaphase-lockedloopaudiodecodingchipLM567todesignanewinfraredspeedsensor.Itscircuitdiagramandworkingprincipleareasfollows.3.1InternalStructureandFunctionofLM567LM567isspeciallyusedtodemodulateasingletonefrequencymodulationsignal,anditsoperatingfrequencycanbeashighas500kHz.Itiswidelyusedinindustrialautomaticcontrol,remotecontroltelemetry,securityalarmandotherfields.LM567ismainlycomposedofquadraturephasedetector,phase-lockedloopandamplifier.ItsinternalstructureisshowninFigure2.Pins5and6ofLM567areexternallyconnectedwithtimingresistorsandcapacitorsR,C.RandCdeterminethecenterfrequencyf0ofthephase-lockedloopinternalvoltagecontrolledoscillator,thatis,f0.ResistorRisconnectedbetweenpins5and6,ofwhichpin6isgroundedthroughcapacitorC(Uss).IfRis2~20k,theLM567canextractthetonesignalintherangeof0.01~500kHz.Pins1and2ofLM567arerespectivelyconnectedtothegroundwithacapacitortoformanoutputfilternetworkandaphase-lockedlooplow-passfilternetwork.ThecapacityoftheexternalcapacitorC2onpin2determinesthecapturebandwidthofthephase-lockedloop,anditssizeisBw1070.Uinistheeffectivevalueofthesinewavesignalvoltageinputfrompin3,andrequiresUin25mV,generallybetween100~200mV.TheexternalcapacitorC1ofpin1istheoutputfiltercapacitorofthequadraturephasedetector,anditscapacityismorethantwicethecapacityofthecapacitorC2connectedtopin2,whichshouldsatisfyC12C2.Figure4.TopViewofLM567(1)UsingLM567asFrequencyModulatorPin2isconnectedtotheinputofthelow-passfilterofthephase-lockedloop.Themodulatedsignaladdedfrompin2isfilteredbyalow-passfiltertoremoveout-of-bandnoiseandnoise,andthenaddedtothecenterfrequencyf0ofthevoltage-controlledoscillatorforfrequencymodulation,andthenthepin5outputstheFMsignal.Thecenterfrequencyf0oftheFMsignalisdeterminedbytheparametersoftheRCresistor-capacitornetworkconnectedtopins5and6.WhenLM567isusedasthefrequencymodulationcircuit,onlyitsinternalphase-lockedlooplow-passfilterandvoltage-controlledoscillatorareused.ChangingtheparametervalueoftheRCnetworkcanrealizemodulationtodifferentfrequencies.(2)UsingLM567asFrequencyDemodulatorThemodulatedsignalisinputfrompin3.Whenthecenterfrequencyoftheinputsignalisequaltothecenterfrequencyf0ofthevoltage-controlledoscillatorintheLM567,thelow-passfilter(pin2)oftheloopoutputsthedemodulatedsignal.3.2PrincipleofInfraredSpeedMeasurementBasedonLM567ThecircuitdiagramoftheinfraredspeedsensorbasedonLM567isshowninFigure3.TheinternaloscillatoroftheLM567providesasquarewavesignaltodrivefourLEDstoemitinfraredlight,anditsfrequencyisdeterminedbyR2andC4.Figure5.CircuitDiagramofInfraredSpeedSensorPlacethefoursensorsinthefourpositionsA,B,C,andDinFigure1.Whenthevehiclepassesthesensor,theinfraredraysemittedbytheLEDarereflectedbythevehiclebody.ThephotosensitivetubeQ1receivesthereflectedlight,isamplifiedbythetransistorandconvertedintoavoltagesignal,andissenttotheinternalphasedetectoroftheLM567forsynchronousdemodulation,andthenconvertedintoadigitalsignalbythecomparatorinsidetheLM567andoutputfrompin8.Theoutputsignalistransmittedtotheroadtester,whichtriggersthetimingdeviceintheroadtestertostarttiming.Similarly,whenthevehiclepassesthesensoratpointB,atriggersignalisgeneratedtostopthetimingdeviceandpasstheroadtester.TheinternalprocessoroperatestoobtainthespeedofthevehicleasitpassesAAandBB.LM567isaphase-lockedloopaudiodecodingcircuit.Inthecircuit,itisusedforfrequencyselection,thatis,thecircuitoutputslowlevelonlywhenthefrequencyofthe3-pininputsignalisconsistentwiththefrequencyoftheLM567internaloscillator,otherwisetheoutputishigh.Level.Inotherwords,onlywhenthereflectedinfraredlightreceivedbyQ1comesfromtheLEDinitsowncircuit,theLM567willoutputatriggersignalfromhightolowtotheroadtester.Thebiggestfeatureofthiscircuitistorealizetheautomaticsynchronizationoftheinfraredemissionfrequencyandtheworkingfrequencyofthereceivingcircuit;Thatis,thereisnospecialpulsegeneratingcircuitintheinfraredtransmittingpart,andthepulseisdirectlyintroducedfromthedetectioncircuitofthereceivingpart(LM567phase-lockedcenterfrequencysignal).Inthisway,thewiringanddebuggingworkissimplified,avoidinginconsistenttransmissionandreceptionfrequenciescausedbychangesinthesurroundingenvironmentandcomponentparameters,eliminatingmutualinterferencebetweenadjacentsensors,andgreatlyenhancingcircuitstabilityandanti-interferencecapabilities.IVConclusionTheinfraredspeedsensordesignedbasedontheLM567modulationanddemodulationfunctionrealizestheautomaticsynchronizationoftheinfraredtransmissionfrequencyandtheworkingfrequencyofthereceivingcircuit.Inaddition,ithasthecharacteristicsofstronganti-interferenceabilityandstability,lowcostandsimplestructure.Therefore,itcanbewidelyusedtomeasuretheaveragespeedofvehiclessuchasautomobilesandmotorcycles.Figure6.LM567Afterreadingtheblog,haveyoubetterunderstandLM567?Finally,ifyouhaveanyquestionsaboutLM567,pleasedonothesitatetoleaveamessageinthecommentsectionbelow!

IDescriptionThisblogmainlydiscussesandsolvesthefollowingproblem:HowtouseLM339voltagecomparatortomakeareservoirwaterlevelgauge?Accordingtowaterlevel,thisdesignperformssignalprocessingandcontrolsthepotentialofmultiplevoltagecomparators,sotheoutputwillchangeaccordingly.Therefore,underitsdrive,LEDcannotonlyemitlight,butalsoachievetheeffectofindicatingthewaterlevel.Figure1.LM339CatalogIDescriptionIIIntroductionIIIWokingPrincipleIVDeviceselectionandComponentProduction4.1deviceselection4.2PartProductionVInstallationandDebugging5.1DetectionPart5.2DisplayPartVIConclusionFAQOrdering&QuantityIIIntroductionDuetoinsufficientwatersupplyinsomeresidentialareas,pumpworkersmustfirststorewaterinthereservoirandthensupplywaterinaregularmanner.Inthisway,thepumpworkermustknowthewaterlevelofthereservoiratanytimeinthepumproom.Inthepast,electrodessuchascopperrodsorstainlesssteelwereusedtodetectthewaterlevelofthepool.However,duetoelectriccorrosion,thefunctionoftheelectrodeislostsoonafteruse.Forthisreason,thisblogusesLM339voltagecomparatortomakewaterlevelgauge.Thisnotonlyeliminatesthepainofoftenchangingelectrodes,butalsosimpleandeasy.Howsimpleisit?Onlytwowiresneedtobeconnectedfromthereservoirtothepumproom.Aftermorethantwoyearsofoperation,itsperformancehasbeenstableandreliable,achievingtheexpectedresults.IIIWokingPrincipleThemaincircuitofthewaterlevelgaugeiscomposedof4LM339voltagecomparators.Thiskindofintegratedcircuithasthecharacteristicsofeasypurchase,lowprice,singlepowersupplyoperationandwidedifferentialrange.EachLM339has4independentvoltagecomparators(15inthisdesign).Aslongasthepotentialdifferencebetweenthepositiveandnegativeinputterminalsis10mV,theoutputterminalcanbereliablyswitchedfromonestatetoanother.Whenthepositiveinputterminalis10mVhigherthanthenegativeinputterminal,itsoutputterminalishigh;Whenthenegativeinputis10mVhigherthanthepositiveinput,itsoutputislow.Inaddition,LEDscanbedrivendirectly.ThenhowtomaketheoutputendofLM339havehighandlowlevelchanges?Inspecificuse,anappropriateresistanceisgenerallyaddedbetweentheoutputterminalandthepositivepowersupply.Thisresistoriscalledapull-upresistor.Thatis,whentheoutputterminalofLM339isinahighimpedancestate,thepotentialoftheoutputterminalispulledupbytheresistor.Figure2.BlockDiagramofWaterLevelGaugeTheprincipleblockdiagramofthedeviceisshowninFigure2.Thevoltagesignalmeasurementconsistsofareedswitchandavoltagedividerresistor.Theringmagnetssuspendedinthewaterareindifferentpositions.Duetotheprincipleofelectromagneticinduction,notonlythecorrespondingdryreedswitchnormallyopencontactsareclosed,butalsothecorrespondingvoltagedividerresistorisconnected.Therefore,thecircuitwillpickupdifferentvoltagesignals.Thepotentialofthenegativeinputterminalofthecomparatorisformedbyafixedvoltagedividerresistor.Themeasuredvoltagesignaliscomparedwiththesetpotential.TheresultofthisisthattheLEDdisplaysthewaterlevelwhendriven.Inaddition,analarmisissuedwhenthehighestwaterlevelisreachedtoremindthepumpertostopwaterinjectiontopreventwateroverflow.TheconcretecircuitisshownasinFig.3.Figure3.WaterLevelGaugeCircuitDiagramInFigure3,thepowersupplyis+12V,andthedepthofthepoolisdividedinto15segmentsfordisplay.Inthispicture:A1~A15arevoltagecomparatorscomposedofLM339;GK1~GK15aredryreedswitches,thenormallyopencontactisclosedwhentheringmagnetisclosetoacertaindryreedswitch;ThevoltagedividercircuitcomposedofresistorsR1toR15determinesthepotentialofthepositiveinputterminalofeachcomparator.ThevoltageofthepositiveinputterminalofLM339changesduetothedifferentpositionsofthemagneticsteel.ThevoltagedividercircuitcomposedofresistorsR01~R030determinesthepotentialofthenegativeinputterminalofeachcomparator.Thepotentialofeachnegativeinputterminalisfixedafterdetermination.Whenthemagneticsteelfloatingonthewatersurfaceisclosetoacertaindryreedswitch,duetothepartialpressureofR1,R2,,R15,thepositiveinputterminalsofthecomparatorsA1,A2,,A15havedifferentinputs.Afterthissignaliscomparedwiththepotentialsetatthenegativeinputofthecomparator,therewillbeacorrespondingoutput.FromFigure3,whenGK1pullsin,itisequivalenttoholdingthemagneticsteelfloatattheupperlimitwaterlevel.Thepositiveinputofeachcomparatorisequaltothegroundpotential,whichislowerthantheirnegativeinput.Therefore,theoutputterminalsarealllowlevel,sothatallLEDsarelit.Atthistime,theoutputofA1dropsfromhighleveltolowlevel,andNE555istriggeredthroughcapacitorC.NE555isconnectedasamonostablecircuit.Oncetriggered,its3pinwilloutputahighlevel,whichwilldrivethebuzzertoalarm.ItsdurationisdeterminedbytheRCcomponentsconnectedtothe6and7pins.WhenGK2isclosed,LED2~LED15shouldbeonandLED1shouldbeoff.Atthistime,thepotentialofthepositiveinputterminalofeachcomparatorishigherthanthepotentialofthenegativeinputterminalofA1andlowerthanthepotentialofthenegativeinputterminalofA2~A15,andsoon.IVDeviceselectionandComponentProduction4.1deviceselectiona.SetthenegativeinputpotentialofeachcomparatortoVsh.Thenegativeinputpotentialofeachcomparatorissetartificiallyaccordingtothenumberofsegmentsdividedintopowersupplyandwaterdepth.Becausethepooldepthhasbeendividedinto15segmentsfordisplay,startingfrom2.0V,thedifferencebetweeneachadjacentnegativeinputterminalis0.4V.AsshowninthefirstrowinTable1.b.Selecttheresistancebetweenthenegativeinputterminalofeachcomparatorandthepowersupply,thatis,thevoltagedividerresistanceR01=R03==R029=20k,settoR.c.CalculatethegroundresistanceR02,R04,...,R030,whichisRr.SupposetheresistanceofthenegativeinputterminaltogroundisRr,andthepotentialofeachnegativeinputterminalisVsh,accordingtocircuitdiagram3:(1)Fromthisformula:(2)Forexample,tomakethepotentialofthenegativeinputterminalofthevoltagecomparatorA1Vsh=2V,accordingtoequation(2),wecangetAsshowninthesecondrowandthefirstcolumninTable1.TheselectionoftheotherresistorsR04,R06,,R030canbecalculatedaccordingtotheaboveformula(theresultisatheoreticalvalue,seethedatashowninthesecondrowinTable1fordetails).d.DeterminethenominalresistanceRbfromRr.Infact,thenominalvalueofcommerciallyavailableresistorsisdifferentfromthiscalculatedvalue.Inspecificapplications,anominalresistanceRbwithasimilarresistancevaluecanbeselected.ThespecificvalueisshowninthethirdrowofTable1.e.DeterminethepotentialVofthenegativeinputterminalofeachcomparatorAbyRb.WhenthenominalvalueofresistanceRbisselected,usethefollowingformulatocheckthepotentialVgeneratedbythisresistance.(3)Thespecificpotentialvalueisshowninthe4throwofTable1,comparedwiththesetvalueinthe1strow,aslongasitdoesnotexceed0.1V.f.DeterminetheresistancesR1,R2,,R15ofthepositiveinputterminalsofeachcomparatorandsetthemasRzh.FirstfindR1,setthepositiveinputpotentialofeachcomparatorasVzh,whenGK1pullsin,itcanbeseenfromTable1that2VVzh2.4V,setVzh=2.2V,R=20k,accordingtoformula(3),itcanbelistedThesolutionisthatRzh=R14.5k.Thisresistanceisnotthenominalvalue.Chooseasimilarnominalvalueof4.8k.ThenfindtheotherresistancesR2,R3,,R15,whichcanallbecalculatedbythismethod.Theresultisthetheoreticalvalue,whichhasaslightdeviationinpractice.Aftercorrection,thevalueisshowninthefifthrowofTable1.Aftertheaboveparametersareselectedinthisway,itcanbeensuredthatwhenthewaterlevelinthepoolreachesthelowestlimitandthefloatholdingthemagneticsteelsinkstothelowestposition,themagneticsteelseparatesfromallthereedswitchesandtheLEDsareallextinguished;AndwhenthefirstreedswitchGK1isclosed(equivalenttothewaterlevelinthepoolreachesthehighestlimit,thefloatholdingthemagneticsteelrisestothehighestposition)LEDsareallon.Whenthefloatisatacertainpositioninthemiddle,thecorrespondingLEDandtheLEDsbelowareallon,andtheLEDaboveitisoff,toshowthewaterlevel.Aftertheabovecalculation,thespecificdatashowninTable1isobtained.4.2PartProductionItisnecessarytomeasuretheheightfromthelowestwaterlevelofthereservoirtothelimitwaterlevel,anddividethisheightinto15segments.Thedistanceofeachsegmentislessthan200mm,thisdistancecanensurethatthemagneticsteelcanalwaysattractanadjacentdryreedswitch,soastoavoiddisplaybreakpoints.Thatistopreventthemagneticsteelfromnotattractingtheupperdryreedpipeorthelowerdryreedpipeduringoperation,sothattheLEDdisplayisallextinguished,causingtheillusionofwaterlessness.FortheconnectionsofGK1,R1~GK15,R15,firstsolderthemtoasmallprintedcircuitboardwithawidthlessthanorequalto20mm,andthenusewirestoconnectthematadistanceoflessthanorequalto200mm,andencapsulatethemina25mmhardplastictube..Theupperandlowermouthsofthepipeshouldbetightlysealedtopreventwaterleakage.Thetubeiscoveredwitharing-shapedmagnet.Afterdroppinganon-ferromagneticheavyobjectonthelowerendofthehardplasticpipe,theplasticpipeisverticallysunkintothebottomofthereservoir.Aringfloatisplacedunderthemagneticsteelandissleevedonthetube,andtheupperendofthetubeisfixedontheobservationportabovethereservoir.Duetothefunctionofthefloat,themagneticsteelisalwayssuspendedonthewatersurface,risingandfallingwiththewatersurface.Notethattheplaneofthemagneticsteelshouldalwaysbeparalleltothewatersurface,andtheplasticpipeshouldbeverticaltothewatersurfacetopreventthemagneticsteelfrombeingstuckbyfrictionwiththepipewallwhenthewaterlevelrisesandfalls.VInstallationandDebuggingThewholedeviceconsistsoftwoparts:Itisadetectionpartcomposedofareedswitchandvariousvoltagedividers;ItisthesignalprocessingdisplaypartcomposedofLM339.5.1DetectionPartBeforeencapsulatingtheplastictube,putsomesilicagelinthetubetoabsorbthemoistureinthetubeandpreventthelineinthetubefromgettingdamp.Ifring-shapedmagneticsteelisusedasthedetectionelement,thereedpipeconnectedinseriesintheplastictubeshouldberealizedbytwostaggeredreedpipes.Accordingtotheelectromagneticinductiontheory,theanalysisofthemagneticfieldlinesofthemagneticsteelshowsthatthereareasmallsectionofmagneticfieldlinesparalleltotheplaneofthemagneticsteelattheupperandloweropeningsofthemagneticsteel.Whenthissectionisclosetothereedswitch,thedirectionofitsmagneticfieldlineisperpendiculartothedirectionofthereedofthereedswitch.Atthistime,althoughthereedswitchisveryclosetothemagneticsteel,thecontactisstillreleasedanddisconnected,whichwillmakealltheLEDsgoout.Iftwostaggeredreedpipesareusedinstead,theproblemcanbesolved,andthestaggereddistancecanbedeterminedinexperiments.5.2DisplayPartThewaterlevelofeachsegmentisdisplayedbygreen10LED,andthelimitwaterlevelisdisplayedbyeye-catchingredLED.IftheLEDsarearrangedneatlytogether,thewaterlevelinthepoolcanbeclearlyseenaccordingtotheonoroffoftheLEDs.Equippedwithabuzzer,itwillgivethepumpworkeraclearerreminder.Note:Fromthedetectorinthepooltothecircuitboardofthepumproom,itisbesttouseshieldedwiretopreventinterferencesignalsfromentering.Weshouldalsonotethatthepowersupplymustberegulated.Fugure4.lm339VIConclusionThenegativeinputpotentialofthevoltagecomparatorA1~A15composedofLM339shouldbesetaccordingtoacertainrule,andthepotentialintervalbetweeneachotherdependsonthedepthofthecell.Ifthewaterlevelisdeeper,theintervalcanbesmaller,andthenumberofsectionscanbeselectedmore.Thepotentialdifferencebetweenadjacentcomparatorsisgenerally0.4V.Ifthepotentialdifferenceislarge,theselectionoftheresistanceiseasy;ifthepotentialdifferenceissmall,becausethenominalvalueintervalofthegeneralresistanceislarge,itisnecessarytouseanadjustableresistortoadjustthepotential.Ofcourse,inthecaseofsmallintervals,thesmallestpotentialdifferencebetweeneachothershouldbegreaterthan10mV,otherwisetheinputcharacteristicsofLM339willnotbeabletodistinguishthepotentialbetweeneachother.Inaddition,thevoltageofthepowersupplyandthenominalvalueofeachresistancemustbeconsidered.Thismethodcanalsobeappliedtootherfields.Suchasmonitoringthewaterdepthofrivers,rivers,lakes,andbays,theoillevelofgasstations,andthedepthofwatertanksinwaterplants.FAQWhatisLM339?LM339isavoltagecomparatorICfromLMx39xseriesandismanufacturedbymanyindustries.Thedevicesconsistoffourindependentvoltagecomparatorsthataredesignedtooperatefromasinglepowersupply.WhatisthedifferencebetweenLM324andLM339?TheLM324hasacomplementaryoutputwhiletheLM339isopencollector.Inthecomplementaryoutput,currentcanflowineitherdirectionasrequired(eithersourceorsink)whiletheopencollectoroutputcanonlysinkcurrent.HowdoesLM339comparatorwork?TheLM339isaquadopampcomparator.Acomparatorworksbyasimpleconcept.Eachopampofacomparatorhas2inputs,ainvertinginputandanoninvertinginput.Iftheinvertinginputvoltageisgreaterthanthenoninvertinginput,thentheoutputisdrawntoground.Whatiscomparatoric?Acomparatorisanelectroniccircuit,whichcomparesthetwoinputsthatareappliedtoitandproducesanoutput.Theoutputvalueofthecomparatorindicateswhichoftheinputsisgreaterorlesser.Pleasenotethatcomparatorfallsundernon-linearapplicationsofICs.WhatisthereplacementforLM339?LM311,LM324,LM397,LM139,LM239,LM2901Whatisacomparatorcircuit?Acomparatorcircuitcomparestwovoltagesandoutputseithera1(thevoltageattheplusside;VDDintheillustration)ora0(thevoltageatthenegativeside)toindicatewhichislarger.Comparatorsareoftenused,forexample,tocheckwhetheraninputhasreachedsomepredeterminedvalue.WhatistheuseofLM339?LM339isusedinapplicationswhereacomparisonbetweentwovoltagesignalsisrequired.Inadditionwithfourofthosecomparatorsonboardthedevicecancomparefourpairsofvoltagesignalsatatimewhichcomesinhandyinsomeapplications.I.IntroductionThe74HC595isan8-bitserial-inorparallel-outshiftregisterwithastorageregisterand3-stateoutputs.74HC595withthecharacteristicsofhighspeed,lowpowerconsumptionandsimpleoperation,canbeeasilyusedinMCUinterfacetodriveLEDoperation.ThisarticleintroducesthecircuitdesignofLEDdisplaydrivedby74HC595.CatalogI.IntroductionII.BasicDescription2.1LEDDisplay2.274HC595III.CircuitDesign3.1HardwareCircuit3.2DisplayDriverIV.ConclusionFAQOrdering&QuantityII.BasicDescription2.1LEDDisplayA7SegmentLEDDisplay,alsoknownasLEDdisplay,hasbeenwidelyusedinvariousinstrumentsbecauseofitslowprice,lowpowerconsumptionandreliableperformance.TherearemanytypesofLEDdriversonthemarket,andmostofthemhavemultiplefunctions,butthepriceiscorrespondinglyhigher.Ifusedinasimplesystemwithlowcost,itisnotonlyawasteofresources,butalsoincreasesthecostofproducts.Using74HC595chiptodriveLEDhasvariousdisadvantages.Highspeed,lowpowerconsumption,unlimitednumberofLEDs.ItcancontrolboththecommoncathodeLEDdisplayandthecommonanodeLEDdisplay.Thecircuitdesignedwith74HC595isnotonlysimple,butalsolowinpowerconsumptionandstrongindrivingability.Itisalowcostandflexibledesignscheme.2.274HC595The74HC595isan8-bitserial-in/serialorparallel-outshiftregisterwithastorageregisterand3-stateoutputs.Boththeshiftandstorageregisterhaveseparateclocks.Thedevicefeaturesaserialinput(DS)andaserialoutput(Q7S)toenablecascadingandanasynchronousresetMRinput.ALOWonMRwillresettheshiftregister.DataisshiftedontheLOW-to-HIGHtransitionsoftheSHCPinput.ThedataintheshiftregisteristransferredtothestorageregisteronaLOW-to-HIGHtransitionoftheSTCPinput.Ifbothclocksareconnectedtogether,theshiftregisterwillalwaysbeoneclockpulseaheadofthestorageregister.Datainthestorageregisterappearsattheoutputwhenevertheoutputenableinput(OE)isLOW.AHIGHonOEcausestheoutputstoassumeahigh-impedanceOFF-state.OperationoftheOEinputdoesnotaffectthestateoftheregisters.Inputsincludeclampdiodes.ThisenablestheuseofcurrentlimitingresistorstointerfaceinputstovoltagesinexcessofVCC.Figure1.74HC595FunctionalDiagramFigure2.74HC595LogicSymbolIII.CircuitDesign3.1HardwareCircuitFigure3isadisplaypanelcircuitdesignedwithAT89C2051and74HC595interface.Figure3.CircuitofDisplayPanelTheP115,P116,andP117oftheP1portareusedtocontrolthedisplayoftheLED,andtheyareconnectedtotheSLCK,SCLKandSDApinsrespectively.Threedigitaltubesareusedtodisplaythevoltagevalue.Onthecircuitboard,LED3isonthefarleftandLED1isonthefarright.Whensendingdata,firstsendthedisplaycodeofLED3,andfinallysendthedisplaycodeofLED1.ThebrightnessoftheLEDiscontrolledbytheresistanceofPR1toPR3.2.2DisplayDriverUseDISP1,DISP2,andDISP3tostoredisplaydata.AftertheCPUinitializationiscomplete,calltheLRDISPsubroutinetocleartheregisterof74HC595.ThereisnoneedtocalltheclearsubroutinebeforecallingthedisplaysubroutineDISPLAY.Nowwritethetwosubroutinesasfollows.①CLRDISP:MOVR2,#24CLRBIT:CLRSCLKCLRCMOVSDA ,why is a resistor often included in a parallel circuit?CSETBSCLKDJNZR2,variable resistor symbolCLRBITRET②Display:CLRSLCKMOVR3,how to read a resister#3MOVR0,surface mount resistor sizes#DISP3DISP1:MOVA,different types of capacitors@R0MOVR2,smd resitor#8DISP2:CLRSCLKRLCAMOVSDA,CSETBSCLKDJNZR2,DISP2DECR0DJNZR3,DISP1SETBSLCKRETIV.ConclusionItcanbeseenfromtheaboveexamplesthattherearenocomplicatedtechnicalproblemsinthedesignofhardwareandsoftwarewhen74HC595isusedtodesignLEDdrivercircuit.Inaddition,74HC595canbeusednotonlytodriveLEDdisplays,butalsotodrivelight-emittingdiodes.Each74HC595candrive8LEDssimultaneously.Thissolutionisidealwhenthevolumerequirementsoftheproductarenothighandwanttoreducethecost.FAQWhatis74HC595?74HC595isashiftregisterwhichworksonSerialINParallelOUTprotocol.Itreceivesdataseriallyfromthemicrocontrollerandthensendsoutthisdatathroughparallelpins.Wecanincreaseouroutputpinsby8usingthesinglechip.Whatisa74hc595n?8-bitShiftRegister74HC595NAshiftregisterisachipyoucanusetocontrolmanyoutputs(8here)atthesametimewhileonlyusingafewpins(3here)ofyourArduino.Howdoesashiftregisterwork?Shiftregistersholdthedataintheirmemorywhichismovedorshiftedtotheirrequiredpositionsoneachclockpulse.Eachclockpulseshiftsthecontentsoftheregisteronebitpositiontoeithertheleftortheright.How74HC595ShiftRegiesterworks?The595hastworegisters(whichcanbethoughtofasmemorycontainers),eachwithjust8bitsofdata.ThefirstoneiscalledtheShiftRegister.TheShiftRegisterliesdeepwithintheICcircuits,quietlyacceptinginput.Howdoesan8bitshiftregisterwork?TheSN74HC595Nisasimple8-bitshiftregisterIC.Simplyput,thisshiftregisterisadevicethatallowsadditionalinputsoroutputstobeaddedtoamicrocontrollerbyconvertingdatabetweenparallelandserialformats.YourchosenmicroprocessorisabletocommunicatewiththeTheSN74HC595Nusingserialinformationthengathersoroutputsinformationinaparallel(multi-pin)format.Essentiallyittakes8bitsfromtheserialinputandthenoutputsthemto8pins.

405NM

DescriptionLED,asthefirstbasicfunctiontobecompletedinMCUlearning,playsaveryimportantroleinMCUlearners,whichalsocalledmagiclampbyMCUlearners.IbelievethateveryoneseesmostandthesimplestLEDcircuitisthefigureshownbelow.Asshowninthefigure,notonlythecircuitissimple,butalsoitsoperationisverysimple.GiveselectricalleveltoI/OcorrespondingtoeightLEDs,andthecorrespondingLEDcanbeonoroff.Figure1.simpleLEDcircuitCatalogDescription74HC595Drives8BitsLEDSFAQOrdering&Quantity74HC595Drives8BitsLEDSButnotallLEDcircuitsaresosimple.Somecircuitswilluse74HC595chiptodrive8LEDsordrivethe8-bitdigitaltubesegmentcode,asshowninthefigurebelow.Figure2.74HC595drives8LEDsWhyisasimplecircuitsocomplicated?Thereasonisobvious.BeforetheeightLEDneedeightI/O,nowonlythreeI/OcandriveeightLED.Letsbrieflyintroduce74CH595anduseitsuccessfullytodriveeightLEDlights.The74HC595isan8-bitserial-inorparallel-outshiftregisterwithastorageregisterand3-stateoutputs.Boththeshiftandstorageregisterhaveseparateclocks.Thedevicefeaturesaserialinput(DS)andaserialoutput(Q7S)toenablecascadingandanasynchronousresetMRinput.SIisitsserialdatainput.Q0toQ7aredataoutput.SCK,istheclockfortheshiftregister.The595isclock-drivenontherisingedge.Thismeansthatinordertoshiftbitsintotheshiftregister,theclockmustbeHIGH.Andbitsaretransferredinontherisingedgeoftheclock.RCK,isaveryimportantpin.WhendrivenHIGH,thecontentsofShiftRegisterarecopiedintotheStorage/LatchRegister;whichultimatelyshowsupattheoutput.Sothelatchpincanbeseenaslikethefinalstepintheprocesstoseeingourresultsattheoutput.SQHisserialdataoutput.Whatwewanttoachievenowistomovethe8-bitsdataofSIinto74HC595onebyoneundertheactionofSCKandRCKandpresenttheminparallelonQ0-Q7.Figure3.How74HC595ShiftRegisterworksWheneverweapplyaclockpulsetoa595,thebitsintheShiftRegistermoveonesteptotheleft.Belowisitscode.FAQWhatis74HC595?74HC595isashiftregisterwhichworksonSerialINParallelOUTprotocol.Itreceivesdataseriallyfromthemicrocontrollerandthensendsoutthisdatathroughparallelpins.Wecanincreaseouroutputpinsby8usingthesinglechip.Whatisa74hc595n?8-bitShiftRegister74HC595NAshiftregisterisachipyoucanusetocontrolmanyoutputs(8here)atthesametimewhileonlyusingafewpins(3here)ofyourArduino.Howdoesashiftregisterwork?Shiftregistersholdthedataintheirmemorywhichismovedorshiftedtotheirrequiredpositionsoneachclockpulse.Eachclockpulseshiftsthecontentsoftheregisteronebitpositiontoeithertheleftortheright.How74HC595ShiftRegiesterworks?The595hastworegisters(whichcanbethoughtofasmemorycontainers),eachwithjust8bitsofdata.ThefirstoneiscalledtheShiftRegister.TheShiftRegisterliesdeepwithintheICcircuits,quietlyacceptinginput.Howdoesan8bitshiftregisterwork?TheSN74HC595Nisasimple8-bitshiftregisterIC.Simplyput,thisshiftregisterisadevicethatallowsadditionalinputsoroutputstobeaddedtoamicrocontrollerbyconvertingdatabetweenparallelandserialformats.YourchosenmicroprocessorisabletocommunicatewiththeTheSN74HC595Nusingserialinformationthengathersoroutputsinformationinaparallel(multi-pin)format.Essentiallyittakes8bitsfromtheserialinputandthenoutputsthemto8pins.Whatisadigitaltube?Lightemittingdiodeconnectstheanodetogetherandthenconnectedtothepowerofpositiveiscalledcommonanodedigitaltube,lightemittingdiodeconnectedtothecathodeandthenconnectedtothepowerofthecathodeiscalledcommoncathodedigitaltube.Whatisthedifferencebetweenshiftregisterandcounter?Inashiftregister,theinputofelementNistheoutputofelementN-1,andallelementsusethesameclock.Inacounter,theinputofelementNistheinverseofitsoutput,andtheclockofelementN+1istheoutputofelementN.IDescriptionDoyouknowwhattheDigitalTubeDisplayneeds?Thedisplayofthedigitaltuberequiresadigitaltubeandacontrolcircuitofmultipledigitaltubes.Takethesingle-chipmicrocomputercontrolcircuitofan8-bitdigitaltubeasanexample.Thesingle-chipmicrocomputerneedstoprovidean8-bitsegmentcodeandan8-bitcode.Thus,weusuallychoosetwoofthefourparallelI/Oportsinthe51single-chipmicrocomputertoprovidesegmentcodesandbitcodesrespectively.Althoughthiscircuithardwareconnectionandsoftwareprogrammingarerelativelysimple,therearealsoproblems.Thatis:ToomanyI/Oportsareoccupied,whichaffectstheoveralluseofthemicrocontroller,andisnotconducivetotheaccessofotherdevices.Howtosolvethisproblem?Wecanuseatypeofshiftregisterforauxiliarycontrol.Here,thisblogusesthe74HC595chip.Figure1.74HC595CatalogIDescriptionIIIntroductionto74HC595III74HC595DisplayControlofMulti-digitDigitalTube3.1HardwareConnection3.2SoftwareProgramming3.3SimulationDebuggingIVConclusionFAQOrdering&QuantityIIIntroductionto74HC59574HC595isaCMOSshiftregisterwithopen-drainoutput.Theoutputportisacontrollablethree-stateoutput.Itcanalsocontrolthenext-levelcascadedchipserially.Itsstructureisusuallya16-pinDIPpackageorSOpackage.The74HC595pinoutisshowninFigure2,andthecorrespondingpinfunctionsareshowninTable1.Figure2.74HC595PinoutThemainfeaturesof74HC595are:8-bitserialinput/8-bitparallelorserialoutput;Three-stateoutputregister(three-stateoutput:agatecircuitwiththreeoutputstatesofhighlevel,lowlevelandhighimpedance);High-speedlow-powerconsumption,high-speedshiftclockfrequencyFmax25MHz.Table1.74HC595PinFunctionPinNumberPinNamePinFunction15,1~7Q0~Q7Paralleltri-stateoutputpin8GNDPowerground9Q7Serialdataoutputpin10/MRClearendofshiftregister(activelow)11SH_CPSerialdatainputclockline12ST_CPOutputmemorylatchclockline13/OEOutputenable(activelow)14DSSerialdatainputline16VCCPowerendIII74HC595DisplayControlofMulti-digitDigitalTubeHere,thisblogtakesthesingle-chipmicrocomputercontrolmulti-digitdigitaltubeasanexample.Tousethechipcorrectly,youmustfirstcorrectlyunderstandthetimingdiagramortruthtableofthechip.Thetruthtableof74HC595isshowninTable2.InputPinOutputPinDSSHCP/MRSTCP/OEHQ0~Q7outputhighimpedanceLQ0~Q7outputeffectivevalueLClearshiftregisterLRisingEdgeHShiftregisterstorelowlevelHRisingEdgeHShiftregisterstorehighlevelFallingEdgeHShiftregisterstateretentionRisingEdgeStatevalueinoutputshiftregisterFallingEdgeOutputmemorystateretentionItcanbefoundthattheserialdataisconnectedtotheDSpin,butitisonlyinputtotheshiftregisterwhenSH_CPisarisingedge,andentersthestorageregisterwhenST_CPisarisingedge.Ifthetwoclocksareconnectedtogether,theshiftregisterisalwaysonepulseearlierthanthestorageregister.Theshiftregisterhasaserialshiftinput(Ds),aserialoutput(Q7),andanasynchronouslow-levelreset.Thestorageregisterhasaparallel8-bit,three-statebusoutput.WhenOEisenabled(lowlevel),thedataofthestorageregisterisoutputtothebus.3.1HardwareConnectionSincethe8-bitdigitaltubeneedstoprovideatotalof16bitsofsegmentcodeandbitcodeatthesametime,itcannotberealizedbyusingone74HC595.Tosolvethisproblem,weusetwo595chipstocascadeseriallytoprovidean8-bitsegmentcode(providedbyU2)andan8-bitcode(providedbyU3).ThesimulationhardwarecircuitisshowninFigure3.Theinputsignalof595isconnectedtothethreeI/OportsofP2.0~P2.2respectively.Amongthem,P2.0providesserialinputsignals,P2.1andP2.2provideoutputandinputclocksignalsrespectively.Figure3.SimulationHardwareCircuitDiagram3.2SoftwareProgrammingHere,weuse2piecesof74HC595chipsforserialcascading.Therefore,youmustpayattentiontothesequenceofserialdataoutputwhenprogramming.Theusualpracticeisasfollows:First,writethedata(iebitcode)ofthe74HC595chipatthenextlevel;Then,writethedata(iesegmentcode)ofthefirst-level74HC595chip;Finally,releasetheparalleloutputpinstogetheratonce.Thesampleprogramisasfollows(partial):voidOneLed_Out(uchari,ucharLocation){ucharj;OutByte=Location;for(j=1;j=8;j++){DS=Bit_Out;SH_CP=0;SH_CP=1;SH_CP=0;OutByte=OutByte1;}OutByte=~Segment[i];for(j=1;j=8;j++){DS=Bit_Out;SH_CP=0;SH_CP=1;SH_CP=0;OutByte=OutByte1;}ST_CP=0;ST_CP=1;ST_CP=0;}3.3SimulationDebuggingWecandrawthehardwarecircuitdiagramontheProteus7platform,andthenwritethesoftwareprogramontheKeil4.0platformandcompileanddebugit.Then,loadthegeneratedHEXfileintothesimulationchipandrunthesimulation.Ifallgoeswell,theresultswillbedisplayedcorrectly.Accordingtothedisplayrequirements,itcanrealize8-bitdigitaltubeshiftdisplayor8-bitdigitaltubesimultaneousdisplay.ThesimulationresultsareshowninFigures4and5.Figure4.ShiftDisplayof8-bitDigitalTubeFigure5.SimultaneousDisplayof8-bitDigitalTubesIVConclusionThetestresultsofthisblogshowthattherearemanyadvantagestothedisplaycontrolofmulti-digitdigitaltubesthroughthecascadeof74HC595chips.Thesebenefitsaremainlyreflectedinthefollowingaspects:Itcangreatlyreducethedisplaycontrolofthesingle-chipdigitaltube;ItcangreatlyreducetheoccupancyoftheMCUI/Oportline;Thecircuitissimpleandeasytoprogram.Themethodintroducedinthisblog,whetheritistoconductsimulationteachingonacomputer,ortobuildactualhardwarecircuits.Ingeneral,Thecurrent74HC595chipiscost-effective,andthecostofbuildingacircuitislow,makingitverysuitableforgeneraluse.FAQWhatis74HC595?74HC595isashiftregisterwhichworksonSerialINParallelOUTprotocol.Itreceivesdataseriallyfromthemicrocontrollerandthensendsoutthisdatathroughparallelpins.Wecanincreaseouroutputpinsby8usingthesinglechip.Whatisa74hc595n?8-bitShiftRegister74HC595NAshiftregisterisachipyoucanusetocontrolmanyoutputs(8here)atthesametimewhileonlyusingafewpins(3here)ofyourArduino.Howdoesashiftregisterwork?Shiftregistersholdthedataintheirmemorywhichismovedorshiftedtotheirrequiredpositionsoneachclockpulse.Eachclockpulseshiftsthecontentsoftheregisteronebitpositiontoeithertheleftortheright.How74HC595ShiftRegiesterworks?The595hastworegisters(whichcanbethoughtofasmemorycontainers),eachwithjust8bitsofdata.ThefirstoneiscalledtheShiftRegister.TheShiftRegisterliesdeepwithintheICcircuits,quietlyacceptinginput.Howdoesan8bitshiftregisterwork?TheSN74HC595Nisasimple8-bitshiftregisterIC.Simplyput,thisshiftregisterisadevicethatallowsadditionalinputsoroutputstobeaddedtoamicrocontrollerbyconvertingdatabetweenparallelandserialformats.YourchosenmicroprocessorisabletocommunicatewiththeTheSN74HC595Nusingserialinformationthengathersoroutputsinformationinaparallel(multi-pin)format.Essentiallyittakes8bitsfromtheserialinputandthenoutputsthemto8pins.Whatisadigitaltube?Lightemittingdiodeconnectstheanodetogetherandthenconnectedtothepowerofpositiveiscalledcommonanodedigitaltube,lightemittingdiodeconnectedtothecathodeandthenconnectedtothepowerofthecathodeiscalledcommoncathodedigitaltube.Whatisthedifferencebetweenshiftregisterandcounter?Inashiftregister,theinputofelementNistheoutputofelementN-1,andallelementsusethesameclock.Inacounter,theinputofelementNistheinverseofitsoutput,andtheclockofelementN+1istheoutputofelementN.IDescriptionTheinstrumentationamplifiercircuithasthefollowingfeatures:HighInputImpedance;HighCommon-modeRejectionRatio;LowDrift;...Theabovefeaturesmakeitwidelyusedinfieldsofsmallsignalamplificationofsensoroutput.Thisblogwillintroduce4implementationoptionsofinstrumentationamplifiercircuits.These4optionsaredesignedbasedondifferentelectroniccomponents.Andtheyarealsoonthebasisofexplainingthecircuitstructureandprincipleoftheinstrumentamplifier.Theelectroniccomponentsdiscussedinthisbloginclude:LM741,OP07,LM324,AD620.Wewillsummarizefeaturesofthe4circuitthroughtesting,analysisandcomparison.Ibelievethisblogcanprovideacertainreferenceforcircuitdesignbeginners.WhatAreInstrumentationAmpilfiers?CatalogIDescriptionIIIntroduction2.1InstrumentationAmplifierOverview2.2InstrumentationAmplifierStuctureandPrincipleIIIInstrumentationAmplifierCircuitDesign3.1LM741CircuitOption3.2OP07CircuitOption3.3LM324CircuitOption3.4AD620CircuitOptionIVPerformanceTestandAnalysisFAQOrdering&QuantityIIIntroduction2.1InstrumentationAmplifierOverviewThesignalsinputbysmartmetersthroughsensorsgenerallyhavethecharacteristicsofsmallsignals:Thesignalamplitudeisverysmall(millivoltorevenmicrovoltmagnitude);Oftenaccompaniedbyloudnoise.Forsuchsignals,thefirststepofcircuitprocessingisusuallytoamplifysmallsignalswithaninstrumentationamplifier.Themainpurposeofamplificationisnottogain,buttoimprovethesignal-to-noiseratioofthecircuit.Atthesametime,fortheinstrumentationamplifiercircuit,thesmallertheinputsignalthatcanberesolved,thebetter;thewiderthedynamicrange,thebetter.Therefore,theperformanceoftheinstrumentationamplifiercircuitdirectlyaffectstherangeoftheinputsignalthatthesmartinstrumentcandetect.2.2InstrumentationAmplifierStuctureandPrincipleThetypicalstructureoftheinstrumentamplifiercircuitisshownasinFig.1.Itismainlycomposedoftwo-stagedifferentialamplifiercircuit.Figure1.StructureofInstrumentationAmplifierAmongthem,theoperationalamplifierA1,A2arein-phasedifferentialinputmodes.Non-invertinginputcangreatlyincreasetheinputimpedanceofthecircuit.Atthesametime,itcanalsoreducetheattenuationofweakinputsignalsbythecircuit;Differentialinputcanmakethecircuitonlyamplifythedifferentialmodesignal,andonlyfollowthecommonmodeinputsignal.Inthisway,theratiooftheamplitudeofthedifferentialmodesignaltothecommonmodesignal(ie,thecommonmoderejectionratioCMRR)senttothesubsequentstageisimproved.Inthisway,inthedifferentialamplifiercircuitcomposedofoperationalamplifierA3asthecorecomponent,undertheconditionthattheCMRRrequirementsremainunchanged,theaccuracymatchingrequirementsforresistorsR3andR4,RfandR5canbesignificantlyreduced.Asaresult,theinstrumentationamplifiercircuithasbettercommonmoderejectioncapabilitythanasimpledifferentialamplifiercircuit.UndertheconditionsofR1=R2,R3=R4,Rf=R5,thegainofthecircuitinFigure1is:G=(1+2R1/Rg)(Rf/R3)ItcanbeseenfromtheformulathattheadjustmentofthecircuitgaincanbeachievedbychangingtheRgresistance.IIIInstrumentationAmplifierCircuitDesignAtpresent,theimplementationmethodsofinstrumentationamplifiercircuitsaremainlydividedintotwocategories:Thefirstcategoryiscomposedofdiscretecomponents;Thesecondcategoryisdirectlyimplementedbyasingleintegratedchip.Intheblog,withsingleopampLM741andOP07,integratedfouropampLM324andmonolithicintegratedchipAD620asthemainelectroniccomponents,4kindsofinstrumentationamplifiercircuitoptionsaredesigned.3.1LM741CircuitOptionConsistsofthreegeneral-purposeoperationalamplifiersLM741toformathreeoperationalamplifierinstrumentamplifiercircuitform.Andsupplementedbyrelatedresistorperipheralcircuits.Atthesametime,addthebridgesignalinputcircuitofthenon-invertinginputterminalsofA1andA2,asshowninFigure2.Figure2.SingleOpAmpInstrumentationAmplifierA1~A3inFigure2canbereplacedwithLM741respectively.Theworkingprincipleofthecircuitisexactlythesameasthatofatypicalinstrumentationamplifiercircuit.3.2OP07CircuitOptionComposedof3precisionoperationalamplifiersOP07,thecircuitstructureandprinciplearethesameasinFig.2(3OP07sareusedtoreplaceA1~A3inFig.2respectively).3.3LM324CircuitOptionTakeafouroperationalamplifierintegratedcircuitLM324asthemaincomponent,asshowninFigure3.Itscharacteristicistointegrate4functionallyindependentoperationalamplifiersintothesameintegratedchip.WhataretheadvantagesofusingLM324?Thatis,itispossibletogreatlyreducethedifferenceindeviceperformanceofeachopampduetodifferentmanufacturingprocesses.Inaddition,theuseofaunifiedpowersupplyisconducivetothereductionofpowersupplynoiseandtheimprovementofcircuitperformanceindicators.Andthebasicworkingprincipleofthecircuitremainsunchanged.Figure3.LM324InstrumentationAmplifier3.4AD620CircuitOptionThecircuitconsistsofamonolithicintegratedchipAD620asthemainelectroniccomponents,asshowninFigure4.Itischaracterizedbyasimplecircuitstructure:anAD620,againsettingresistorRg,andaworkingpowersupply.Therefore,thedesignefficiencyisveryhigh.ThecircuitgaincalculationformulainFig.4is:G=49.4K/Rg+1.Figure4.AD620InstrumentationAmplifierIVPerformanceTestandAnalysisThefouroptionsoftheinstrumentationamplifiercircuitalladopttheformofabridgecircuitcomposedof4resistors,whichchangesthedouble-endeddifferentialinputintoasingle-endedsignalsourceinput.Theperformancetestismainlytocarryoutsimulationandactualcircuitperformancetestfromthefollowingaspects:1.ThemaximuminputofthesignalsourceVs;2.VsminimuminputofsignalsourceVs;3.Themaximumgainofthecircuit;4.Commonmoderejectionratio.ThetestdataareshowninTable1andTable2.Amongthem,themaximum(small)inputofVsreferstothemaximum(small)inputofthesignalsourcewhenthecircuitoutputisnotdistortedundergiventestconditions.Themaximumgainreferstothemaximumgainvalueofthecircuitthatcanbeachievedwhentheoutputisnotdistortedunderthegiventestconditions.ThecommonmoderejectionratioiscalculatedbytheformulaKCMRR=20|g|AVd/AVC|(dB).Note:fisthefrequencyofVsinputsignal;Thevoltagemeasurementdatainthetableareallexpressedbypeak-to-peakvalue;Duetothesimulationdevice,thesimulationofoption3withMultisimfailedintheexperiment,and-inTable1indicatesthefailuredata;Options1to4inthetablerespectivelyrepresenttheinstrumentationamplifiercircuitcomposedofLM741,OP07,LM324andAD620respectively.FromthemeasureddatainTable2,wecanseefromit:Foroption2,ithasthebestperformanceintermsofsignalinputrange(thatis,themaximumandminimuminputofVs),circuitgain,andcommon-moderejectionratio.Intermsofcomponentprice,itisalittlehigherthanthecostoftheLM741option1andtheLM324option3,butitismuchcheaperthantheAD620option4.Therefore,amongthefouroptions,option2ofOP07hasthehighestcostperformance.Foroption4,inadditiontoitsrelativelysmallmaximumgain,itsotherperformanceissecondonlytooption2.option4hastheadvantagesofsimplecircuit,superiorperformance,andsavingdesignspace.However,thehighcostisitsbiggestdisadvantage.Foroption1andoption3,thereislittledifferenceintheirperformance.option3isslightlybetterthanoption1,andtheyalsohaveabsolutepriceadvantages,buttheirperformanceisnotasgoodasoption2andoption4.Basedontheaboveanalysis,option2andoption4aresuitableforoccasionswithhigherperformancerequirementsforinstrumentamplifiercircuits.Amongthem:Option2ofOP07isthemostcost-effectiveOption4ofAD620issimpleandefficient,butthecostishigh.Option1ofLM741andOption3ofLM324aresuitableforoccasionswhereperformancerequirementsarenothighandcostsavingsareneeded.Accordingtospecificcircuitdesignrequirements,differentoptionsareselectedtoachieveoptimalresourceutilization.Figure5.InstrumentationAmplifierICInaddition,afterthecircuitdesignplanisdetermined,thefollowingaspectsshouldbepaidattentiontointhespecificcircuitdesignprocess:1.Payattentiontotheselectionofkeycomponents.Forexample,forthecircuitshowninFigure2,thereareafewthingstopayattentionto:MakethecharacteristicsofopampA1andA2asconsistentaspossible;Whenselectingresistors,resistorswithalowtemperaturecoefficientshouldbeusedtoobtainthelowestpossibledrift;TheselectionofR3,R4,R5andR6shouldmatchasmuchaspossible.2.Payattentiontoaddingvariousanti-interferencemeasuresinthecircuit.suchas:Thepowersupplydecouplingcapacitorshouldbeaddedatthelead-inendofthepowersupply;RClow-passfilteringshouldbeaddedtothesignalinputterminalorhigh-frequencynoisecancelingcapacitorsshouldbeaddedtothefeedbackloopoftheoperationalamplifierA1andA2;ThePCBdesignshouldbecarefullylaidoutandroutedreasonably,andgroundwiresshouldbehandledcorrectly.FAQWhatislm324?LM324isaQuadop-ampICintegratedwithfourop-ampspoweredbyacommonpowersupply.Thedifferentialinputvoltagerangecanbeequaltothatofpowersupplyvoltage....Generally,op-ampscanperformmathematicaloperations.Whichisthedifferencebetweenlm324andlm339?TheLM324hasacomplementaryoutputwhiletheLM339isopencollector.Inthecomplementaryoutput,currentcanflowineitherdirectionasrequired(eithersourceorsink)whiletheopencollectoroutputcanonlysinkcurrent.Whatisopampusefor?OperationalamplifiersarelineardevicesthathaveallthepropertiesrequiredfornearlyidealDCamplificationandarethereforeusedextensivelyinsignalconditioning,filteringortoperformmathematicaloperationssuchasadd,subtract,integrationanddifferentiation.Howdoesanopampwork?Whatislm324usedfor?LM324ICApplicationsTheapplicationsofICLM324includethefollowing.ByusingthisIC,theconventionalop-ampapplicationscanbeimplementedverysimply.ThisICcanbeusedasoscillators,rectifiers,amplifiers,comparatorsetc.

405NM

I.IntroductionAsweallknow,theionnitridingprocessrequiresrelativelyhighcontrolofthepressureinsidethefurnace,sothispaperdesignsagasflowcontrollerbasedontheL298NchipdrivenDCmotorcontrol,whichcanbeusedtocontrolthegasflowofthereactor.Soletsfirstunderstandtheionnitridingtheory.CatalogI.IntroductionII.IonNitridingTheoryIII.SystemFlowandPressureMeasurementandControlBlockDiagramIV.L298NChipIntroductionV.ControllerPrincipleVI.ConclusionFAQOrdering&QuantityII.IonNitridingTheoryNitridingisachemicalheattreatmentmethodtostrengthenthemetalsurface.Itistoplacemetalpartsinanactivenitrogenmedium,andatacertaintemperatureandholdingtime,thenitrogenelementcanpenetrateintothemetalsurface,therebychangingthechemicalcompositionofthemetallayertomakeithavehighwearresistance,fatiguestrength,corrosionresistanceandburnresistance,etc.,soitiswidelyusedinindustry.Ionnitridingiscarriedoutinalow-temperatureplasma.Thelow-pressuregasisionizedundertheactionofanelectricfieldtoproducehigh-energyionsandhigh-energyneutralatoms.Thesehigh-energyparticlescanimprovethestructureoftheinfiltrationlayer,promotethechemicalreactionprocess,andacceleratethenitridinglayerformation.Ionnitridingiscarriedoutinglowdischarge.Intheprocessofionnitriding,thepressurecontrolaccuracyofthefurnaceisrelativelyhigh,andthecontroldeviationreachesseveraltensofPa.AccordingtoPaschensLaw:Amongthem:Pisthegaspressure;Disthedistancebetweenparallelplateelectrodes;Visthecathodesecondaryelectronemissioncoefficient;BisStolevsconstant;Aisaconstant.Takingthederivativeofformula(1),thebreakdownvoltageexpression(2)canbeobtained:Itcanbeseenfromformula(2)thatthebreakdownvoltageVisrelatedtothegaspressureandd,andingeneralexperiments,disfixed,soionnitridingisextremelyimportantforpressurecontrol.III.SystemFlowandPressureMeasurementandControlBlockDiagramTheflowmetercontrolsthegasflowattheinlet.Whentheinletandexhaustflowsarebalanced,thefurnacepressureremainsstable.Duetotheinternalinfluenceoffurnacegasleakageandotherinterferencefactors,theinternalpressureofthefurnacefluctuatesupanddown,andthesystemdeviatesfromtheequilibriumstate,whichaffectstheplasmaprocessinseverecases.WeuseanordinaryDCmotortodrivetheDCmotorthroughtheL298N,andthemotordrivestheconetorotatethroughthereductionlever.Whentheconeisscrewedin,thegaspumpedoutperunittimeisreduced;whenitisscrewedout,thegaspumpedoutincreases,sothatthepressureinsidethefurnaceisstabilizedattherequiredvalue.Thechangeoffurnacepressureismeasuredbythepressuresensorandpassedthroughthetransmitter,whichsendsthegasflowcontrollertothefeedbackvoltage.Theelectricvacuumbutterflyvalveusedforthesuctionportisexpensive,asshowninFigure1.Figure1BlockdiagramofsystemflowandpressuremeasurementandcontrolIV.L298NChipIntroductionL298NcanacceptstandardTTLlogiclevelsignalVSS,andVSScanbeconnectedto4.5~7Vvoltage.4pinVSisconnectedtothepowersupplyvoltage,andtheVSvoltagerangeVIHis+2.5~46V.Theoutputcurrentcanreach2.5A,whichcandriveinductiveloads.Theemittersofpin1andpin15areseparatelyledouttoconnectthecurrentsamplingresistortoformacurrentsensingsignal.L298candrivetwomotors,OUT1,OUT2andOUT3,OUT4canbeconnectedtoeachmotor,thisexperimentaldevicewechoosetodriveonemotor.Pins5,7,10and12areconnectedtotheinputcontrolleveltocontroltheforwardandreverserotationofthemotor.EnAandEnBareconnectedtothecontrolpotentialenergyendtocontrolthestallingofthemotor.Figure2istheL298Nfunctionallogicdiagram,Table1istheL298Ninternalfuntionalmodule.Figure2L298NfunctionallogicdiagramEnAIn1In2OperativeCondition0Stop110Rotatingforward101Inversion111Brake100StopTable1L298NinternalfunctionalmoduleThefunctionalmoduleofIn3andIn4isthesameasTable1.ItcanbeseenfromTable1thatwhenEnAislowlevel,theinputlevelhasaneffectonmotorcontrol.WhenEnAishighlevel,whenEnAishigh,theinputlevelisonehighandonelow,andthemotorrotatesforwardorreverse.Iftheyarebothlowlevel,themotorwillstop,andiftheyarebothhighlevel,themotorwillbrake.V.ControllerPrincipleFigure3istheschematicdiagramofthecontroller,composedof3dashedblockdiagrams:Figure3TheschematicdiagramofthecontrollerThefollowingarethefunctionsofthe3dashedblockdiagrams:(1)Thedashedblockdiagram1controlstheforwardandreverserotationofthemotor,U1AandU2Aarecomparators,andVIcomesfromthevoltageofthefurnacepressuresensor.WhenVIVRBF1,U1Aoutputshighlevel,U2Aoutputhighlevelturnsintolowlevelthroughinverter,andthemotorrotatesforward.Similarly,whenVIVRBF1,themotorreverses.Theforwardandreverserotationofthemotorcancontroltheflowofgasextractedbytheairextractor,therebychangingthepressureinsidethefurnace.(2)Inthedashedblockdiagram2,twocomparatorsU3AandU4Aformadual-limitcomparator.WhenVBVIVA,itoutputslowlevel,andwhenVIVA,VIVB,itoutputshighlevel.VA,VBaretheupperandlowerlimitsofthevoltageconvertedbythefurnacepressuretransducer,thatis,thecontrolrangeofthereactionfurnacepressure.Accordingtoprocessrequirements,wecanspecifythevaluesofVAandVBbyourselves,aslongasthefurnacepressureiswithintherangedeterminedbyVAandVB,themotorstops(notethatVB<VRBF1<VA,ifitisnotinthisrange,thesystemisunstable).(3)Thedashedblockdiagram3isalongdelaycircuit.U5Aisacomparator,Rs1isthesamplingresistor,VRBF2isthemotorovercurrentvoltage.ThevoltageonRs1isgreaterthanVREF2,themotorisovercurrent,andU5Aoutputslowlevel.Itcanbeseenfromtheabovethatblock1controlstheforwardandreverserotationofthemotor,andblock2controlsthesizeoftherippleofthefurnacepressure.Whenthefurnacepressureistoosmallortoolarge,themotorturnstoafixedpositionatbothendstostop,accordingtothesteady-stateoperatingequationoftheDCmotor:Amongthem:Фisthemagneticfluxofeachpoleofthemotor;Ceistheelectromotiveforceconstant;Nisthenumberofmotorrevolutions;Iaisthearmaturecurrent;Raisthearmatureloopresistance.WhenthenumberofrevolutionsofthemotorNis0,thecurrentofthemotorincreasessharply,andthemotorwillburnoutifthetimeistoolong.Butwhenthemotorstarts,thecurrentinthecoilinthemotoralsoincreasessharply,sowemustseparatethesetwostates.Thelongdelaycircuitcandistinguishthesetwostates.Theworkingprincipleofthelong-delaycircuit:WhentheRs1overcurrentU5Ageneratesanegativepulseandisdifferentiated,thepulsetriggerspin2of555,thecircuitisset,andpin3outputshighlevel.Becausethedischargeterminal7pinisopen,C1,R5andU6Aformedasanintegration,thenstartworking,thechargingvoltageonthecapacitorC1riseslinearly,andtheintegrationconstantofthedelayoperationalamplifieris100R5C1.WhenthechargingvoltageonC1,thatis,thevoltageonpin6exceeds2/3VCC,the555circuitresetsandoutputsalowlevel.Themotorgenerallystart-upinlessthan0.8s,andtheC1chargingtimeisgenerally0.8~1s.TheoutputlevelofU5AisORedwiththeoutputlevelofpin3of555viaU7.IftheoutputlowlevelofU5AislongerthanthechargingtimeofC1,U7outputslowlevelafterC1ischarged.TheANDgateU8inputstothe6pinENAterminalofL298N.Themotorstops.IftheoutputlevelofU5AislessthanthechargingtimeofC1,pin6willnotactandthemotorwillstartnormally.Thelongdelaycircuitabsorbsthemotorstart-upovercurrentvoltagewaveform,sothatthemotorstartsnormally.VI.ConclusionThisarticlesummarizesthedesignschemeforthepressurecontrolofionnitridingbasedontheL298Nchip.Ithasbeenprovedthattheuseofthiscontrollertocontrolthegasflowcanreduceproductioncosts,increasethesystemcostperformance,andimprovethecontroldynamicperformanceandstabilityoftheentiresystemcontrol.FAQWhatisl298n?ThisL298NMotorDriverModuleisahighpowermotordrivermodulefordrivingDCandStepperMotors.ThismoduleconsistsofanL298motordriverICanda78M055Vregulator.L298NModulecancontrolupto4DCmotors,or2DCmotorswithdirectionalandspeedcontrol.Whatistheuseofl298n?TheL298NisadualH-BridgemotordriverwhichallowsspeedanddirectioncontroloftwoDCmotorsatthesametime.ThemodulecandriveDCmotorsthathavevoltagesbetween5and35V,withapeakcurrentupto2A.Howdoesl298ncontrolDCmotorspeed?1.IfyousendaHIGHsignaltotheenable1pin,motorAisreadytobecontrolledandatthemaximumspeed;2.IfyousendaLOWsignaltotheenable1pin,motorAturnsoff;3.IfyousendaPWMsignal,youcancontrolthespeedofthemotor.Themotorspeedisproportionaltothedutycycle.Whatisl298nmotordrivermodule?ThisL298NMotorDriverModuleisahighpowermotordrivermodulefordrivingDCandStepperMotors.ThismoduleconsistsofanL298motordriverICanda78M055Vregulator.L298NModulecancontrolupto4DCmotors,or2DCmotorswithdirectionalandspeedcontrol.Howdoesl298nmotordriverwork?TheL298NisadualH-BridgemotordriverwhichallowsspeedanddirectioncontroloftwoDCmotorsatthesametime.ThemodulecandriveDCmotorsthathavevoltagesbetween5and35V,withapeakcurrentupto2A.Howdoiuseal298motordriverwithArduino?Startbyconnectingpowersupplytothemotors.InourexperimentweareusingDCGearboxMotors(alsoknownasTTmotors)thatareusuallyfoundintwo-wheel-driverobots.Theyareratedfor3to12V.So,wewillconnectexternal12VpowersupplytotheVCCterminal.WhatisthefunctionofHbridge?AnH-bridgeisanelectroniccircuitthatswitchesthepolarityofavoltageappliedtoaload.ThesecircuitsareoftenusedinroboticsandotherapplicationstoallowDCmotorstorunforwardsorbackwards.Whatisthedifferencebetweenl293dandl298n?L293isquadruplehalf-HdriverwhileL298isdualfull-Hdriver,i.e,inL293allfourinput-outputlinesareindependentwhileinL298,ahalfHdrivercannotbeusedindependently,onlyfullHdriverhastobeused....Hence,heatsinkisprovidedinL298.I.IntroductionDCmotorsarewidelyusedinvariousfieldsduetotheirgoodspeedregulationperformance,largestartingtorqueandstrongoverloadcapacity.Inrecentyears,thestructureandcontrolmethodsofDCmotorshaveundergonegreatchanges.Withcomputersenteringthecontrolfieldandthecontinuousemergenceofnewpowerelectronicpowercomponents,PWM(pulsewidthmodulation)speedregulationhasbecomeanewwayofDCmotorspeedregulation.Andwiththeadvantagesofhighswitchingfrequency,stablelow-speedoperation,excellentdynamicperformance,andhighefficiency,itiswidelyusedinDCmotorspeedregulation.Therefore,thispaperproposesthedesignofaDCmotorPWMcontrolsystembasedon80C196KCandL298N.CatalogI.IntroductionII.PrincipleofPWMSpeedControlSystemIII.ControlSystemHardwareDesign3.1IntroductiontoPowerIntegratedCircuitL298N3.2DCMotorControlSystemHardwareCircuit3.3Anti-interferenceandElectromagneticCompatibilityDesignIV.ControlSystemSoftwareRealizationV.ConclusionFAQOrdering&QuantityII.PrincipleofPWMSpeedControlSystemPWM,orpulsewidthmodulation,referstotheuseoftheswitchingcharacteristicsofhigh-powertransistorstomodulateafixedvoltageDCpowersupply,whichisturnedonandoffatafixedfrequency,andthelengthoftheonandofftimeinacycleischangedasneeded.BychangingthedutycycleofthevoltageonthearmatureoftheDCservomotor,theaveragevoltageischangedtocontrolthespeedofthemotor.Therefore,itisoftencalledaswitchdrivedevice.TheschematicdiagramofPWMcontrolisshowninFigure1.Figure1PWMcontrolschematicdiagramThereareusuallytwowaystochangethedutycycle:PWMandPFM(pulsefrequencymodulation).PWMisbychangingthewidthoftheon-pulse,whichiscommonlyreferredtoasthefixedfrequencywidthmodulationmethod.PFMmeansthattheon-pulsewidthisconstantandthedutycycleischangedbychangingtheswitchingfrequency.Becausewhenitencountersmechanicalresonanceataparticularfrequency,itoftenresultsinsystemvibrationandhowling.Therefore,inthecontrolofDCmotors,thePWMcontrolmethodismainlyused.III.ControlSystemHardwareDesignTheDCmotorspeedcontrolsystembasedon80C196KCandL298Niscomposedofthesmallestsingle-chipmicrocomputersystem,R/Dconverter,PWMpoweramplifiercircuit,A/DandD/Aconversioncircuit,andreceivingcommandinterfacecircuit.Theminimumsystemofthesingle-chipmicrocomputeradoptsthe16-bitsingle-chip80C196KCexternalexpansioninterfacecircuit,whichismainlyusedtorealizethefunctionsofdataacquisitionandPWMsignalgeneration.TheblockdiagramofthespeedcontrolsystemisshowninFigure2.Figure2BlockdiagramofPWMspeedcontrolsystem3.1IntroductiontoPowerIntegratedCircuitL298NInordertoimprovesystemefficiencyandreducepowerconsumption,thepoweramplifierdrivecircuitadoptstheintegratedcircuitL298NbasedonthebipolarH-bridgepulsewidthmodulationmethod.L298Nisahigh-performancepulse-widthmodulationpoweramplifierproducedbySGS,whichhasthecharacteristicsofsmallsizeandstrongdrivingability.ItcontainstwoH-bridgehigh-voltageandhigh-currentbridgedrivers,whichcanrealizethefull-bridgedriveofthemotorwithasinglechip,whichcandrivemotorsbelow46Vand2A.TheinternalstructureofL298NisshownasinFigure3.Figure3L298Ninternalstructureblockdiagram3.2DCMotorControlSystemHardwareCircuitL298NcandrivetwoDCmotors,becausethespeedcontrolsystemisasingle-axisstructure,inordertomakefulluseoftheloadcapacityofthepoweramplifiercircuit,sothatthesystemstartsatthemaximumaccelerationandbrakesatthemaximumacceleration,inthedesign,theinputterminalandtheoutputterminalareconnectedinparalleltocontroltheDCmotor.Thesingle-chip80C196KCgivesaPWMsignalaccordingtothecalculationresultsofthepositionloopandthespeedloop.ThePWMsignalisdirectlyoutputtotheIN1(IN3)terminal,andthePWMsignalisinvertedandoutputtoIN2(IN4)through7406.WhenthedutycycleofthePWManalogsignalis50%,thepositiveandnegativevoltagesatbothendsofthemotorareappliedforthesametime.Themotorisinastateoftremoratthisposition,thatis,inthepowerlubricationstate.Whenthedutycycleisgreaterthan50%,thesignalvoltageOUTAisgreaterthanOUTB,andthemotorrotatesforward,otherwisereverse.Therefore,theoutputpolarityofeachlinkmustbestraightenedouttoformnegativefeedbackandcompleteclosed-loopcontrol.RelyingonchangingthePWMdutycycletocontrolthemotorspeedcanalsochangethemotorrotationdirection,thecontrolmethodissimpleandreliable.Inaddition,becausethemotorisofelectriccoiltype,reverseelectromotiveforcewillbeformedwhenthemotorhasanemergencystopandsuddencommutation.ToensurethenormaloperationoftheL298Ndrivechip,twopairsofcontinuationsareaddedbetweentheoutputterminalsOUTA,OUTBandtheDCmotor.TheflowdiodeshuntsthecurrenttothepositiveorgroundterminalofthepowersupplytopreventbackelectromotiveforcefromdamagingtheL298N.3.3Anti-interferenceandElectromagneticCompatibilityDesignWhenthemotorisdriven,therapidon-offofthepowermainswitchingelementleadstoalargerateofchangeofpowercurrentandvoltage,whichnotonlyaffectsthedrivecircuitbutalsoentersthecontrolcircuitthroughthepowersupplyandground.Inaddition,whenthemotorstartsandbrakes,thetransientvoltageisgeneratedatthesuddenchangeoftheload,itsamplitudewillbehigherthanthepowersupplyvoltage,andtheleadingedgeissteep,thefrequencybandisverywide,anditentersthecontrolcircuitthroughtheDCpowersupply.Therefore,anti-interferenceandelectromagneticcompatibilitydesignisalsoveryimportant.Thesystemhasadoptedmeasuressuchascurrentsmoothing,deburringandshielding.Currentsmoothing:BecausetheinstantaneousenergyofthePWMswitchisrelativelylarge,theRCfilterisusedattheoutputofthePWMpoweramplifiertofilter.Byselectingtheappropriateresistanceandcapacitancevalues,high-frequencyharmonicsareeffectivelysuppressedandthepeakvoltageofthePWMpoweramplifierisabsorbed.Therebyreducingtheinterference;Deburring:Thesystemincreasesthefiltercapacitoronthepowersupplyside,andusesonelargeandonesmallcapacitorinparallel.Thelargecapacitorisresponsibleforthedecoupling,filtering,andsmoothingoflow-frequencyalternatingsignals,andthesmallcapacitoreliminatesmid-andhigh-frequencyparasiticscouplinginthecircuitnetwork,whicheffectivelyreducesspikesandburrs;Shielding:Themotordrivecableadoptsdouble-shieldedcables,andthewiringshouldbeseparatedfromothercablesasmuchaspossible.Figure4DrivehardwarecircuitdiagramIV.ControlsystemsoftwarerealizationThecontrolsystemadoptsthespeed-positionclosed-loopcombinationmethod,takingthepositioncontrolmethodasanexampletointroducetherealizationmethodofthesoftware.ThepositioncontrolisbasedontheclassicPIcontrolalgorithm,andtheproportionalandintegralparametersaresimplifieddesign,andthesegmentedPIcontrolisintroduced.,Thatis,thecalculatederrorisdividedintosections,anddifferentproportionalandintegralparametersparticipateintheadjustmentwithintheerrorrangeofeachsection,whichensuresthesmootherandmorestableoperationofthesystem.ThederivationandsimplificationprocessofPIformulaisasfollows:ThespecificsoftwareimplementationflowchartisshowninFigure5.Thatis,afterreceivingagivenanglecommand,firstcalculatethedifferencebetweenthesampledpositioninformationandthegivenangle,andthendividethedifferenceintonequalparts,andeachsegmentcorrespondstoasetofparametersKp1andki1participateinmediationcontrol,calculatetheoutputofPIcontrolandthenconvertitintothecorrespondingPWMnumericaloutput.Figure5ThespecificsoftwareimplementationflowchartV.ConclusionThisarticlesumsupthedesignschemeoftheDCmotorPWMcontrolsystembasedon80C196KCandL298N.Thesingle-chipmicrocomputergeneratesPWMsignaltothepowerintegratedcircuitL298N.TheclassicPIsegmentcontrolisusedtocontrolthemotor.Ithasthecharacteristicsofsimplecircuitandconvenientcontrol.Theoperatingtestresultsshowthatthesystemworksstablyandreliably,meetstherequirementsofthespeedregulationfunction,andhasbeensuccessfullyappliedtomanyairborneproducts.FAQWhatisl298n?ThisL298NMotorDriverModuleisahighpowermotordrivermodulefordrivingDCandStepperMotors.ThismoduleconsistsofanL298motordriverICanda78M055Vregulator.L298NModulecancontrolupto4DCmotors,or2DCmotorswithdirectionalandspeedcontrol.Whatistheuseofl298n?TheL298NisadualH-BridgemotordriverwhichallowsspeedanddirectioncontroloftwoDCmotorsatthesametime.ThemodulecandriveDCmotorsthathavevoltagesbetween5and35V,withapeakcurrentupto2A.Howdoesl298ncontrolDCmotorspeed?1.IfyousendaHIGHsignaltotheenable1pin,motorAisreadytobecontrolledandatthemaximumspeed;2.IfyousendaLOWsignaltotheenable1pin,motorAturnsoff;3.IfyousendaPWMsignal,youcancontrolthespeedofthemotor.Themotorspeedisproportionaltothedutycycle.Whatisl298nmotordrivermodule?ThisL298NMotorDriverModuleisahighpowermotordrivermodulefordrivingDCandStepperMotors.ThismoduleconsistsofanL298motordriverICanda78M055Vregulator.L298NModulecancontrolupto4DCmotors,or2DCmotorswithdirectionalandspeedcontrol.Howdoesl298nmotordriverwork?TheL298NisadualH-BridgemotordriverwhichallowsspeedanddirectioncontroloftwoDCmotorsatthesametime.ThemodulecandriveDCmotorsthathavevoltagesbetween5and35V,withapeakcurrentupto2A.Howdoiuseal298motordriverwithArduino?Startbyconnectingpowersupplytothemotors.InourexperimentweareusingDCGearboxMotors(alsoknownasTTmotors)thatareusuallyfoundintwo-wheel-driverobots.Theyareratedfor3to12V.So,wewillconnectexternal12VpowersupplytotheVCCterminal.WhatisthefunctionofHbridge?AnH-bridgeisanelectroniccircuitthatswitchesthepolarityofavoltageappliedtoaload.ThesecircuitsareoftenusedinroboticsandotherapplicationstoallowDCmotorstorunforwardsorbackwards.Whatisthedifferencebetweenl293dandl298n?L293isquadruplehalf-HdriverwhileL298isdualfull-Hdriver,i.e,inL293allfourinput-outputlinesareindependentwhileinL298,ahalfHdrivercannotbeusedindependently,onlyfullHdriverhastobeused....Hence,heatsinkisprovidedinL298.

405NM

IDescriptionDS18B20isawidelyuseddigitaltemperaturesensor,anditsoutputisadigitalsignal.DS18B20hasthecharacteristicsofsmallsize,lowhardwareoverhead,stronganti-interferenceabilityandhighprecision.TheDS18B20digitaltemperaturesensoriseasytowireandcanbeusedinmanyoccasionsafterbeingpackaged.Suchaspipe,thread,magnetadsorption,stainlesssteelpackageandsoon.ThisArduinoforbeginnerstutorialwillteachyouhowtoreadtheDS18B201-wiretemperaturesensor.CatalogIDescriptionIIIntroductiontoDS18B202.1DS18B20BasicInformation2.2DS18B20Features2.3DS18B20StructureIIIIntroductiontoComponents3.1Memory3.264-bitLithographyROM3.3ConnectionofExternalPowerSupply3.4ConfigurationRegister3.5TemperatureReadingIVDS18B20WorkingPrincipleVConclusionFAQOrdering&QuantityIIIntroductiontoDS18B202.1DS18B20BasicInformationDS18B20isanimprovedintelligenttemperaturesensornewlylaunchedbyAmericanDALLASSemiconductorafterDS1820.Comparedwiththetraditionalthermistor,DS18B20candirectlyreadthemeasuredtemperatureandcanrealizethe9-12-digitdigitalvaluereadingmodethroughsimpleprogrammingaccordingtoactualrequirements.Itcanalsocomplete9-bitand12-bitdigitalquantitiesin93.75msand750ms,respectively.Moreover,theinformationreadfromtheDS18B20ortheinformationwrittenintotheDS18B20onlyneedsoneportline(single-wireinterface)toreadandwrite,andthetemperatureconversionpowercomesfromthedatabus.ThebusitselfcanalsosupplypowertotheconnectedDS18B20withouttheneedforanadditionalpowersupply.Therefore,theuseofDS18B20canmakethesystemstructuresimplerandmorereliable.DS18B20hasgreatlyimprovedcomparedwithDS1820intermsoftemperaturemeasurementaccuracy,conversiontime,transmissiondistance,andresolution.Itbringsmoreconvenientuseandmoresatisfyingeffectstousers.2.2DS18B20FeaturesUnique1-WireInterfaceRequiresOnlyOnePortPinforCommunicationReduceComponentCountwithIntegratedTemperatureSensorandEEPROMMeasuresTemperaturesfrom-55Cto+125C(-67Fto+257F)0.5CAccuracyfrom-10Cto+85CProgrammableResolutionfrom9Bitsto12BitsNoExternalComponentsRequiredParasiticPowerModeRequiresOnly2PinsforOperation(DQandGND)SimplifiesDistributedTemperature-SensingApplicationswithMultidropCapabilityEachDeviceHasaUnique64-BitSerialCodeStoredinOn-BoardROMFlexibleUser-DefinableNonvolatile(NV)AlarmSettingswithAlarmSearchCommandIdentifiesDeviceswithTemperaturesOutsideProgrammedLimitsAvailablein8-PinSO(150mils),8-PinSOP,and3-PinTO-92Packages2.3DS18B20StructureTheexternalstructureofDS18B20isshowninthefigure1.Amongthem:VDDisthepowerinputterminal;DQisthedigitalsignalinput/outputterminal;GNDisthepowerground.Figure1.DS18B20ExternalStructureTheinternalstructureofDS18B20mainlyincludes4parts:64-bitlithographyROM;Temperaturesensor;Non-volatiletemperaturealarmtriggersTHandTL;Configurationregister.Figure2.DS18B20ExternalStructureInthe64-bitROM,themanufacturerhasa64-bitserialnumberburnedbythemanufacturerbeforetheproductleavesthefactory.TheserialnumbercanberegardedastheaddressserialcodeofDS18B20,usedtodistinguisheachDS18B20.Soastobetterrealizethemulti-pointmeasurementoffieldtemperature.IIIIntroductiontoComponents3.1MemoryThememoryofDS18B20includeshigh-speedscratchpadRAMandelectricallyerasableRAM.TheelectricallyerasableRAMalsoincludestemperaturetriggersTHandTL,andaconfigurationregister.Thememorycancompletelydeterminethecommunicationoftheone-lineport,andthenumberiswrittenintotheregisterwiththecommandofwritingtheregister.Thenyoucanusethereadregistercommandtoconfirmthesenumbers.Afterconfirmation,youcanusethecopyregistercommandtotransferthesenumberstotheelectricallyerasableRAM.Whenthenumberintheregisterismodified,thisprocesscanensuretheintegrityofthenumber.ThescratchpadRAMiscomposedof8bytesofmemory.Theninthbytecanbereadwiththereadregistercommand.Thisbyteistocheckthepreviouseightbytes.3.264-bitLithographyROMFor64-bitlithographyROM:Thefirst8bitsaretheowncodeofDS18B20Thenext48bitsareconsecutivedigitalcodesThelast8bitsaretheCRCcheckofthefirst56bits.The64-bitlithographyROMalsoincludes5ROMfunctioncommands:readROM,matchROM,skipROM,searchROMandalarmsearch.3.3ConnectionofExternalPowerSupplyDS18B20canuseexternalpowerVDDorinternalparasiticpower.WhentheVDDportisconnectedtoavoltageof3.0V-5.5V,anexternalpowersupplyisused.AninternalparasiticpowersupplyisusedwhentheVDDportisgrounded.Inaddition,whetheritisaninternalparasiticpowersupplyoranexternalpowersupply,theI/Oportlineshouldbeconnectedtoapull-upresistorofabout5K.3.4ConfigurationRegisterTheconfigurationregisteristoconfiguredifferentdigitstodeterminethetemperatureanddigitalconversion.ItcanbeknownthatR1andR0arethedeterminingbitsoftemperature.DifferentcombinationsofR1andR0canbeconfiguredas9-digit,10-digit,11-digit,and12-digittemperaturedisplay.Inthisway,theconversiontimecorrespondingtodifferenttemperatureconversionpositionscanbeknown.Theresolutionsofthefourconfigurationsare0.5C,0.25C,0.125Cand0.0625C,respectively,andareconfiguredto12bitsatthefactory.3.5TemperatureReadingDS18B20isconfiguredas12bitsatthefactory,and16bitsarereadwhenreadingtemperature.Thefirst5bitsaresignbits.Whenthefirst5digitsare1,thetemperaturereadisanegativenumber;whenthecurrent5digitsare0,thetemperaturereadisapositivenumber.Themethodofreadingwhenthetemperatureispositiveis:justconvertthehexadecimalnumbertodecimal.Whenthetemperatureisnegative,thereadingmethodis:invertthehexadecimalnumber,thenadd1onthisbasis,andthenconverttodecimal.Example:0550H=+85degrees,FC90H=-55degrees.IVDS18B20WorkingPrincipleThereadandwritesequenceandtemperaturemeasurementprincipleofDS18B20arethesameasDS1820.Onlythenumberofdigitsofthetemperaturevalueobtainedvarieswiththeresolution.Andthedelaytimeduringtemperatureconversionisreducedfrom2sto750ms.ThetemperaturemeasurementprincipleofDS18B20isshowninFigure3.Figure3.DS18B20TemperatureMeasurementPrincipleDiagramTheoscillationfrequencyofthecrystaloscillatorwithlowtemperaturecoefficientinthepictureislittleaffectedbytemperature.Itisusedtogenerateafixedfrequencypulsesignalandsendittothesubtractioncounter1.Thehightemperaturecoefficientcrystaloscillatorchangesitsoscillationfrequencysignificantlywithtemperaturechanges.Atthesametime,thegeneratedsignalisusedasthepulseinputofthesubtractioncounter2.Thefigurealsoimpliesacountinggate.Whenthecountinggateisopened,DS18B20countstheclockpulsesgeneratedbythelowtemperaturecoefficientoscillatortocompletethetemperaturemeasurement.Theopeningtimeofthecountinggateisdeterminedbythehightemperaturecoefficientoscillator.Beforeeachmeasurement,firstputthebasecorrespondingto-55℃intothesubtractioncounter1andthetemperatureregisterrespectively.Thesubtractioncounter1andthetemperatureregisterarepresettoabasevaluecorrespondingto-55℃.Thesubtractioncounter1subtractsthepulsesignalgeneratedbythelowtemperaturecoefficientcrystaloscillator.Whenthepresetvalueofthesubtractioncounter1isreducedto0,thevalueofthetemperatureregisterwillincreaseby1,thepresetofthesubtractioncounter1willbereloaded,andthesubtractioncounter1willrestartcountingthepulsesignalsgeneratedbythelowtemperaturecoefficientcrystaloscillator.Thisloopuntilthesubtractioncounter2countsto0,stoptheaccumulationofthetemperatureregistervalue.Thevalueinthetemperatureregisteristhemeasuredtemperatureatthistime.Figure4.DS18B20Theslopeaccumulatorisusedtocompensateandcorrectthenonlinearityinthetemperaturemeasurementprocess,anditsoutputisusedtocorrectthepresetvalueofthesubtractioncounter.Aslongasthecountinggateisnotclosed,repeattheaboveprocessuntilthetemperatureregistervaluereachesthemeasuredtemperaturevalue.ThisisthetemperaturemeasurementprincipleofDS18B20.Inaddition,becausetheDS18B20single-wirecommunicationfunctioniscompletedintimesharing,ithasastrictconceptoftimeslots.Therefore,thereadandwritetimingisveryimportant.VariousoperationsofthesystemtoDS18B20mustbecarriedoutaccordingtotheagreement.Theoperatingprotocolis:initializeDS18B20(sendresetpulse)sendROMfunctioncommandsendmemoryoperationcommandprocessdata.ThetimingdiagramofvariousoperationsisthesameasthatofDS1820.VConclusionInconclusion,thisblogsummarizesthefollowing3aspectsofDS1820:Features,structureandworkingprinciple.DS1820mainlychangesitsappearanceaccordingtodifferentapplications.ThepackagedDS18B20canbeusedinvariousnon-limitingtemperatureapplications.Includingcabletrenchtemperaturemeasurement,blastfurnacewatercirculationtemperaturemeasurement,boilertemperaturemeasurement,machineroomtemperaturemeasurement,agriculturalgreenhousetemperaturemeasurement,cleanroomtemperaturemeasurement,ammunitionstoragetemperaturemeasurement,etc.Inaddition,DS1820isabrasion-resistantandimpact-resistant,smallinsize,easytouse,anddiverseinpackaging,suitablefordigitaltemperaturemeasurementandcontrolofvariousnarrowspaceequipment.FAQWhatisDS18B20temperaturesensor?TheDS18B20isa1-wireprogrammabletemperaturesensorfrommaximintegrated.Itiswidelyusedtomeasuretemperatureinhardenvironmentslikeinchemicalsolutions,minesorsoiletc.Theconstrictionofthesensorisruggedandalsocanbepurchasedwithawaterproofoptionmakingthemountingprocesseasy.HowdoestheDS18B20work?Itworksontheprincipleofdirectconversionoftemperatureintoadigitalvalue.IsDS18B20athermistor?Athermistorisathermalresistor-aresistorthatchangesitsresistancewithtemperature....Thermistorshavesomebenefitsoverotherkindsoftemperaturesensorssuchasanalogoutputchips(LM35/TMP36)ordigitaltemperaturesensorchips(DS18B20)orthermocouples.HowaccurateisDS18B20?TheDS18B20readswithanaccuracyof0.5Cfrom-10Cto+85Cand2Caccuracyfrom-55Cto+125C.Whatisds1820?TheDS18B20isonetypeoftemperaturesensoranditsupplies9-bitto12-bitreadingsoftemperature....Thecommunicationofthissensorcanbedonethroughaone-wirebusprotocolwhichusesonedatalinetocommunicatewithaninnermicroprocessor.HowdoIconnectmyDS18B20tomyRaspberryPi?OnceyouveconnectedtheDS18B20,powerupyourPiandlogin,thenfollowthesestepstoenabletheOne-Wireinterface:1.Atthecommandprompt,entersudonano/boot/config.txt,thenaddthistothebottomofthefile:2.dtoverlay=w1-gpio.3.ExitNano,andrebootthePiwithsudoreboot.WhatistheworkingprincipleofDS18B20?TheDS18B20DigitalThermometerprovides9to12-bit(configurable)temperaturereadingswhichindicatethetemperatureofthedevice.Itcommunicatesovera1-Wirebusthatbydefinitionrequiresonlyonedataline(andground)forcommunicationwithacentralmicroprocessor.Inadditionitcanderivepowerdirectlyfromthedataline(parasitepower),eliminatingtheneedforanexternalpowersupply.ThecorefunctionalityoftheDS18B20isitsdirect-to-digitaltemperaturesensor.Theresolutionofthetemperaturesensorisuser-configurableto9,10,11,or12bits,correspondingtoincrementsof0.5C,0.25C,0.125C,and0.0625C,respectively.Thedefaultresolutionatpower-upis12-bit.WheretouseDS18B20Sensor?TheDS18B20isa1-wireprogrammableTemperaturesensorfrommaximintegrated.Itiswidelyusedtomeasuretemperatureinhardenvironmentslikeinchemicalsolutions,minesorsoiletc.Theconstrictionofthesensorisruggedandalsocanbepurchasedwithawaterproofoptionmakingthemountingprocesseasy.Itcanmeasureawiderangeoftemperaturefrom-55Cto+125withadecentaccuracyof5C.EachsensorhasauniqueaddressandrequiresonlyonepinoftheMCUtotransferdatasoitaverygoodchoiceformeasuringtemperatureatmultiplepointswithoutcompromisingmuchofyourdigitalpinsonthemicrocontroller.HowconnectDS18B20toArduino?FirstplugthesensoronthebreadboardtheconnectitspinstotheArduinousingthejumpersinthefollowingorder:pin1toGND;pin2toanydigitalpin(pin2inourcase);pin3to+5Vor+3.3V,attheendputthepull-upresistor.OnanATMega328P,whyisaDS18B20temperaturesensorreturningincorrecttemperaturevalues?Severalpossibilities:1.Ifitisjustreadingalittlehigh,itmightbecausedbyselfheating.Addaheatsinkand/ormakemeasurementslessfrequently.2.Especiallyifthevaluesarereallywhacky,itmightbecodewitherrorsormis-wiring.Useapublishedsketchtocheckoperation.3.TheDS18B20mightbedefective.Tryanother.4.Itsaccurateto0.5C.Areyouexpectingittobemoreaccurate(likedowntotheLSBofthereadvalue)?

IDescriptionInthisblog,wewillintroduceamultifunctionalelectronicthermometer.Thiskindofthermometercannotonlyaccuratelyandconvenientlymeasurebodytemperatureandfoodtemperature,butalsocanbeusedtomeasureindoorandoutdoortemperature,refrigeratortemperature,etc.Inaddition,italsohasmultiplefunctionssuchastemperaturemeasurementtiming,temperaturememory,soundprompt,backlightdisplay,andautomaticshutdown.Moreover,ithasthecharacteristicsofaccuratemeasurement,simpleoperation,portabilityandlowprice.Therefore,itcanbewidelyusedinhospitalsandhomesasageneraltemperaturemeasuringinstrument.Intermsofitsworkingprinciple,thethermometerusesthedigitaltemperaturesensorDS18B20todetecttemperatureandtransmitsthedigitaltemperaturesignaltothesingle-chipmicrocomputer.Thetemperaturevalueandmeasurementtimecalculatedandcorrectedbythesingle-chipmicrocomputeraredisplayedinrealtimebytheliquidcrystaldisplay.AtutorialonhowtousetheDallasMaxim1-WireDS18B20digitaltemperaturesensorwiththeArduino.CatalogIDescriptionIIDS18B20IntroductionIIIHardwareCircuit3.1PowerCircuit3.2DigitalTemperatureSensorandCalibration3.3MCUCircuit3.4LCDDisplay3.5AudioCircuitIVSoftwareDesignVConclusionFAQOrdering&QuantityIIDS18B20IntroductionDS18B20isasingle-wiredigitaltemperaturesensorproducedbyDALLAS.Itintegratestemperaturesensing,signalconversion,A/Dconversionandheatingfunctionsintoonechip,andbelongstoanewgenerationofintelligentdigitaltemperaturesensorswithmicroprocessors.DS18B20hasatotalof3pins,(respectivelydigitalsignalinput/output,ground,powersupply),usingTO-92small-volumepackaging.DS18B20MainSpecifications:Thetemperaturemeasurementrangeis-55℃~+125℃;Programmableto9to12bitA/Dconversionaccuracy;Thetemperaturemeasurementresolutioncanreach0.0625℃,andtheerroris0.5℃;Theworkingpowersupplycanbeintroducedattheremoteend(3-wireworkingmode)orgeneratedbyparasiticpowersupply(2-wireworkingmode);Themeasuredtemperatureisseriallyoutputwithasign-extended16-bitdigitalquantity;Eachsensorhasaunique64-bitserialnumber,whichisstoredintheROMofthesensor;Thesensoralsohastwotemperatureupperandlowerlimitstorageunits.IIIHardwareCircuitThemultifunctionalelectronicthermometerismainlycomposedofthefollowingparts:PowercircuitDigitaltemperaturesensorSinglechipcomputerLCDMonitorAudiocircuit...ItshardwarecircuitschematicdiagramisshownasinFig.1.Figure1.HardwareCircuit(rightclicktoviewbigpicture)3.1PowerCircuitU1isthemicropowerconsumptionstep-downDC/DCconverterLT3470introducedbyLinearTechnology.Here,U1convertsthe9Vdrybatteryvoltageinto5VDCvoltagetopowertheentirecircuit.So,howtostartandshutdownautomatically?WeonlyneedtopressthestartbuttonS2.Afterstarting,pin1(SHDN)ofU1getsahighlevel,pin5ofU1outputsa5VstableDCvoltage,andthethermometerstartstoworkatthistime.Then,the14-pin(P1.2)oftheone-chipcomputeroutputsahighlevelthroughD2tokeepthe1pinofU1high.When6minutesareup,the14-pinofthesingle-chipmicrocomputeroutputsalowlevel,andthe1pinofU1becomesalowlevel,andthecircuitautomaticallypowersdown.3.2DigitalTemperatureSensorandCalibrationThedigitaltemperaturesensorDS18B20isusedasatemperaturemeasuringprobetocollecttemperaturesignals.Andthedigitizedtemperaturesignalisinputthroughthe19-pin(P1.7)ofthemicrocontroller.DS18B20adopts2-wireworkingmode,andtheworkingpowerisgeneratedbyparasiticpower.Forexample,usethisthermometertomeasurethetemperatureofababy.Wecanfixthetemperatureprobeonaspecialbandageandtieittothearm.Sothatthesensorislocatedunderthearmpit.Inthisway,itcanbeavoidedthatthetemperaturemeasuringprobeisdetachedfromthetestsite.Duetoinfantactivitiesorcryingwhenmeasuringthebodytemperatureoftheinfant,andthemeasurementisconvenient.Foranotherexample,thetemperatureprobecanalsomeasureindoorandoutdoortemperature,refrigeratortemperature,etc.Thespecialprobeformeasuringfoodtemperatureadoptsnon-toxicstrawandnon-toxicsilicagelpackage,whichiseasytoclean.SinceDS18B20isintherangeof-10℃~85℃,itsmeasurementerroris0.5℃.Inordertoaccuratelymeasurebodytemperature,thisblogusesaself-madeconstanttemperaturewaterbathsystemtodeterminethetemperaturecurveofeachsensor.WecancalibratetheDS18B20accordingtothetemperaturecurvetomakethemeasurementerrorwithintherangeof25℃~50℃be0.1℃.3.2.1ConstantTemperatureWaterBathSystemTheconstanttemperaturewaterbathsystemconsistsofthefollowingthreeparts:anelectriccookerwithheatpreservation,acylindricalcopperbodywithgoodheatconduction,andanautomatictemperaturecontroller.Weneedtomake50roundholeswithadiameterof5mmandaheightof30mmonacylindricalcopperbodywithadiameterof120mmandaheightof80mm.Inthisway,thetemperaturesensorcanbefixedandthetemperatureofallthesensorsinthecopperbodycanbekeptconsistent.Putthecylindricalcopperbodyintotheelectriccooker,andadddistilledwatertosubmergethecopperbody.3.2.2DS18B20ActualTemperatureCurveMeasurementInsertmultipleencapsulatedsensorstobetested(nomorethan49)intothesmallholesofthecopperbodyoftheconstanttemperaturewaterbath;Insertthehigh-precisiondigitalthermometerintothesmallholeofthecopperbodytoaccuratelymeasurethecurrenttemperature;Thewiresofallsensorsareledoutthroughtheuppercoverholeoftheelectriccookerandconnectedtotheuppercomputer.Covertheelectriccookerwithheatpreservationmaterial;Turnonthepower,changethetemperaturesettingoftheautomaticthermostat,andcontrolthetemperatureoftheconstanttemperaturewaterbath;Monitorthetemperaturevalueofthedigitalthermometer.Wheneverthespecifiedtemperaturevalueisreached,starttheuppercomputertemperaturemeasurementprogramandsimultaneouslymeasurethecurrenttemperatureofallthesensorstobetested;From25℃~60℃,measure1setofdataevery5℃,andautomaticallygeneratetheactualtemperaturecurveofeachsensor.3.2.3CorrectionofDS18B20Byanalyzingthemeasuredtemperaturecurveofthesensor,wecanfindthatwithintherangeof25℃~50℃,theerroris-0.1℃~-0.3℃.Inthedesignofthisblog,thecurrenttemperaturevalueofDS18B20plus0.2℃isusedastheactualmeasuredtemperature,sothatthemeasurementerrorintherangeof25℃~50℃isreducedto0.1℃.3.3MCUCircuitThemicrocontroller(U2)isthecorecomponentofthethermometer.Ithasthefollowingfunctions:Temperaturesignalreading,processingcalculation,correctionTemperaturemeasurementtimingTemperaturememorySoundprompt,Automaticshutdown...ThisdesignadoptsAT89C2051single-chipmicrocomputerproducedbyAmericanATMELcompany.Itisabuilt-inflashmemorymicrocontrollerthatisfullycompatiblewiththeMCS-51series,withonly20pins.Itisthemostcompact,smallest,andcheapestFlashROMmicrocontrollerintheAT89C51series.Providesthefollowingstandardfunctions:An8-bitCPU;2kBflashmemory;128bytesRAM;Two16-bittimers;Acomplete8-bitbidirectionalI/Oport;5interruptsources.Afterstartingthethermometer,themicrocontrollerstartsaninternaltimertorecordthetemperaturemeasurementtime.ItalsoreadsthedigitaltemperaturesignalsentbyDS18B20,processesandcorrectsittoobtainthereal-timetemperaturevalue.ThetemperaturevalueandtemperaturemeasurementtimearesenttotheLCDdisplayviaserialcommunicationviapin1(P3.0)andpin2(P3.1);Whenthetemperaturemeasurementtimereaches5minutes,thecurrenttemperaturevalueisautomaticallyregistered,andpin11outputsalowleveltocontroltheaudiocircuittogiveasoundprompt;Whenthetemperaturemeasurementtimereaches6minutes,thesingle-chip14pinoutputslowlevel,andthethermometerisautomaticallypoweredoff.3.4LCDDisplayThisblogusesa3andahalfliquidcrystaldisplay(LCD)todisplaytemperatureandtemperaturemeasurementtime.Thedisplayhasthefollowingcharacteristics:Useglassencapsulation;Thereare5pinsintotal;SerialcommunicationWith3andahalfdisplayareaand℃unitdisplay;Functionwithbacklight;Thepowersupplyvoltagerangeis2V~5V.Thisdesignusesthemaindisplayareatoindicatethetemperature,andthesub-displayareatoindicatethetemperaturemeasurementtime.3.5AudioCircuitTheaudiocircuitconsistsofthefollowingparts:TransistorQ2(9015)resistanceR12;CapacitanceC12;BuzzerB1;Whenthepin11ofthesingle-chipmicrocomputeroutputslowlevel,thetransistorQ2issaturatedandturnedon,andthebuzzergeneratesanaudibleprompt.IVSoftwareDesignTheprogramiswrittenin89C51seriesClanguageanddebuggedonthesingle-chipsimulationsystem.TheprogramflowchartisshowninFigure2.Figure2.BlockDiagramofMainProgramAfterpower-onreset,initializetheDS18B20,inputandoutputports,timers,etc.ReadthetemperaturevalueofthelastmeasurementandstoragefromthelowertemperaturelimitstorageunitofDS18B20anddisplayitfor3seconds.StarttheinternaltimerT0ofthemicrocontrollertorecordthetemperaturemeasurementtime.Obtainthetemperaturevalueandcorrecttheerror.AccordingtothecommunicationprotocolofDS18B20,thetemperaturesignalisreadfromthesensor,thesignisdistinguished,andthetemperaturevalueisobtainedaftercalculationandprocessing.Then,add0.2Ctothetemperaturevalueastheactualtemperature,andcorrectthemeasurementerrorwithintherangeof25Cto50Cto0.1C.Displayoftemperature.Accordingtothecommunicationprotocoloftheliquidcrystaldisplay,thetemperaturevalueandtemperaturemeasurementtimearesenttothedisplayfordisplay.Themaindisplayareaindicatesthetemperature,andthesecondarydisplayareaindicatesthetemperaturemeasurementtime.Whenthetemperaturemeasurementtimereaches5minutes,the11-pinofthesingle-chipmicrocomputeroutputsalow-levelcontrolaudiocircuittoemitapromptsound,andthecurrenttemperatureissenttothelowertemperaturestorageunitofDS18B20forregistration,andsenttothesecondarydisplayareafordisplay.Whenthetemperaturemeasurementtimereaches6minutes,the14-pinofthesingle-chipmicrocomputeroutputslowlevel,andthethermometerautomaticallypowersdown.VConclusionComparedwithtraditionalthermometers,theDS18B20Multi-functionElectronicThermometerdesignedinthisbloghasmanyadvantages.Thelatterovercomesthedifficultyofreadingmercurythermometersandiseasytobebrokenandpollutetheenvironment.Atthesametime,comparedwithsimpleelectronicthermometers,multifunctionalelectronicthermometersalsoovercometheshortcomingsofpoormeasurementaccuracy.Becauseofitscompletefunctions,stableperformance,smallsize,lightweight,lowpowerconsumption,andlowprice,itcanbeusedasageneraltemperaturemeasuringinstrumentandwidelyusedinhospitalsandhomes.FAQWhatisDS18B20temperaturesensor?TheDS18B20isa1-wireprogrammabletemperaturesensorfrommaximintegrated.Itiswidelyusedtomeasuretemperatureinhardenvironmentslikeinchemicalsolutions,minesorsoiletc.Theconstrictionofthesensorisruggedandalsocanbepurchasedwithawaterproofoptionmakingthemountingprocesseasy.HowdoestheDS18B20work?Itworksontheprincipleofdirectconversionoftemperatureintoadigitalvalue.IsDS18B20athermistor?Athermistorisathermalresistor-aresistorthatchangesitsresistancewithtemperature....Thermistorshavesomebenefitsoverotherkindsoftemperaturesensorssuchasanalogoutputchips(LM35/TMP36)ordigitaltemperaturesensorchips(DS18B20)orthermocouples.HowaccurateisDS18B20?TheDS18B20readswithanaccuracyof0.5Cfrom-10Cto+85Cand2Caccuracyfrom-55Cto+125C.Whatisds1820?TheDS18B20isonetypeoftemperaturesensoranditsupplies9-bitto12-bitreadingsoftemperature....Thecommunicationofthissensorcanbedonethroughaone-wirebusprotocolwhichusesonedatalinetocommunicatewithaninnermicroprocessor.HowdoIconnectmyDS18B20tomyRaspberryPi?OnceyouveconnectedtheDS18B20,powerupyourPiandlogin,thenfollowthesestepstoenabletheOne-Wireinterface:1.Atthecommandprompt,entersudonano/boot/config.txt,thenaddthistothebottomofthefile:2.dtoverlay=w1-gpio.3.ExitNano,andrebootthePiwithsudoreboot.WhatistheworkingprincipleofDS18B20?TheDS18B20DigitalThermometerprovides9to12-bit(configurable)temperaturereadingswhichindicatethetemperatureofthedevice.Itcommunicatesovera1-Wirebusthatbydefinitionrequiresonlyonedataline(andground)forcommunicationwithacentralmicroprocessor.Inadditionitcanderivepowerdirectlyfromthedataline(parasitepower),eliminatingtheneedforanexternalpowersupply.ThecorefunctionalityoftheDS18B20isitsdirect-to-digitaltemperaturesensor.Theresolutionofthetemperaturesensorisuser-configurableto9,10,11,or12bits,correspondingtoincrementsof0.5C,0.25C,0.125C,and0.0625C,respectively.Thedefaultresolutionatpower-upis12-bit.WheretouseDS18B20Sensor?TheDS18B20isa1-wireprogrammableTemperaturesensorfrommaximintegrated.Itiswidelyusedtomeasuretemperatureinhardenvironmentslikeinchemicalsolutions,minesorsoiletc.Theconstrictionofthesensorisruggedandalsocanbepurchasedwithawaterproofoptionmakingthemountingprocesseasy.Itcanmeasureawiderangeoftemperaturefrom-55Cto+125withadecentaccuracyof5C.EachsensorhasauniqueaddressandrequiresonlyonepinoftheMCUtotransferdatasoitaverygoodchoiceformeasuringtemperatureatmultiplepointswithoutcompromisingmuchofyourdigitalpinsonthemicrocontroller.HowconnectDS18B20toArduino?FirstplugthesensoronthebreadboardtheconnectitspinstotheArduinousingthejumpersinthefollowingorder:pin1toGND;pin2toanydigitalpin(pin2inourcase);pin3to+5Vor+3.3V,attheendputthepull-upresistor.OnanATMega328P,whyisaDS18B20temperaturesensorreturningincorrecttemperaturevalues?Severalpossibilities:1.Ifitisjustreadingalittlehigh,itmightbecausedbyselfheating.Addaheatsinkand/ormakemeasurementslessfrequently.2.Especiallyifthevaluesarereallywhacky,itmightbecodewitherrorsormis-wiring.Useapublishedsketchtocheckoperation.3.TheDS18B20mightbedefective.Tryanother.4.Itsaccurateto0.5C.Areyouexpectingittobemoreaccurate(likedowntotheLSBofthereadvalue)?L298DescriptionTheL298isanintegratedmonolithiccircuitina15-leadMultiwattandPowerSO20packages.Itisahighvoltage,ahighcurrentdualfull-bridgedriverdesignedtoacceptstandardTTLlogiclevelsanddriveinductiveloadssuchasrelays,solenoids,DCandsteppingmotors.Twoenableinputsareprovidedtoenableordisablethedeviceindependentlyoftheinputsignals.Theyaremostlyused:whenitisneededtooperatedifferentloadslikemotorsandsolenoidetcwhereanH-BridgeisrequiredwhenhighpowermotordriverisrequiredwhenthecontrolunitcanonlyprovideTTLoutputswhencurrentcontrolandPWMoperablesingle-chipdeviceisneededCatalogL298DescriptionL298CircuitDiagramL298FeaturesandSpecificationsL298PinConfigurationsandFunctionsL298PackageOutlineandMechanicalDataWheretouseL298ICHowtouseL298ICL298ApplicationsL298ComparewithOtherMotorsProductManufacturerComponentDatasheetFAQOrdering&QuantityL298CircuitDiagramL298FeaturesandSpecificationsOperatingsupplyvoltageupto46vTotalDCcurrentupto4A25wratedpower2enablecontrolterminalstoenableordevicewithoutinputtingsignals.Abletodriveatwo-phasesteppermotor,four-phasesteppermotorortwoDCmotorsLowsaturationvoltageOvertemperatureprotectionLogical0inputvoltageupto1.5V(highnoiseimmunity)Operatingtemperature:-23Cto130CStorageTemperature:-40Cto150CL298PinConfigurationsandFunctionsPinoutFunctions:L298PackageOutlineandMechanicalDataL298(Multiwatt15V)L298(Multiwatt15H)L298(PowerSO20)WheretouseL298ICHereareafewareaswhereL298ispreferred:L298isbasicallyusedwhereH-BRIDGEisrequired.Whereahighpowermotordriverisrequired.Inthemarked,thereareH-bridgeslikeL293whichareusedforthelowpoweredapplicationwhileL298isspeciallydesignedforthehighpowerapplications.WherecurrentcontrolandPWMoperablesingle-chipdeviceisneeded.ThechipispreferredwhencontrolunitcanonlyprovideTTLoutputAlso,thechipdoesnotneedanyadditionalcomponentstobeinstalledforoperating.HowtouseL298ICForunderstandingtheworkingofL298IC,considerthesimplecircuitconfigurationshownbelow.HereweareusingoneofH-BRIDGESofl298IC.AsshowninthecircuitwehavetwopushbuttonsQ1andQ2whichactascontrolsinputsforbridge-A.TheselogicinputsareprovidedbyMicrocontrollerorMicroprocessorinapplicationcircuits.ThefourdiodesareFLYBACKdiodesusedforprotectingtheICforminductivevoltagespikes.Theenablepinispulledhighthrougharesistorsobridge-Awillbefunctioningallthetime.Ifitspulledtogroundthebridge-Awillbedisablednomattertheinputcontrollogic.AfterallthecircuitaresetupweneedtopressthebuttonsQ1andQ2tochangetheflowofcurrentbetweenpinsOUT1andOUT2.Thelogiccontroltableisgivenbelow.INPUTSFUNCTIONQ1=HIGH,Q2=LOWForwardcurrentQ1=LOW,Q2=HIGHReversecurrentQ1=Q2FastMOTORstopSoifonlyQ1ispressed,thecurrentflowsfromOUT1toOUT2.WiththatMOTORrotatesclockwisedirection.IfonlyQ2ispressed,thecurrentflowsfromOUT2toOUT1.WiththatMOTORrotatesanti-clockwisedirection.IfbothbuttonsarepressedorreleasedsimultaneouslytheMOTORcomestostopimmediately.Inthisway,wecancontrolthemotorrotationusingtheL298chip.L298ApplicationsRoboticarmsRobotsRelaydriversVendingmachinesIndustrialmachinesEngineeringsystemsMeasuringinstrumentsHobbyprojectsL298ComparewithOtherMotorsWithsomanymotordriverscurrentlysuchasServoMotorsandsteppermotors,whatreallyarethedifferencesbetweenthemotordriversandwhichonetochoose?Noworries,aswehavecraftedatablejustforyoutocomparethevariousmotordriverssoyouknowwhichmotordriverfitsthebestforyourproject.TypeMotorDriversChipActuatorWorkingVoltageWorkingCurrentGroveGroveI2CMotorDriverL298N2DCmotoror1Stepper6v-15v2.0Aeach(Max)GroveI2CMotorDriver(TB6612FNG)TB6612FNG2DCmotoror1Stepper2.5v-13.5v(5Avg,15vMax)1.2A(Avg)to3.2A(Max)GroveI2CMiniMotorDriverDRV88302DCMotor2.75v-6.8v0.2Ato1AeachShieldMotorShieldV2.0L298N2DCmotoror1Stepper6v-15v2.0Aeach(Max)4AMotorShieldMC339322DCMotor6v-28v5.0Aeach(Max)BrushlessMotorShield(TB6605FTG)TB6605FTG1DCBrushlessMotor9v-24v-ProductManufacturerSTmicroelectronics(ST)groupwasestablishedinJune1988asaresultofthemergerofSGSMicroelectronicsofItalyandThomsonOfFrance.InMay1998SGS-ThomsonMicroelectronicschangeditsnametoSTmicroelectronicsLimited.Itistheworldslargestmanufacturerofdedicatedanalogchipsandpowerconversionchips,theworldslargestsupplierofindustrialsemiconductorsandset-topboxchips,andaworldleaderindiscretecomponents,mobilephonecameramodules,andautomotiveintegratedcircuits.ComponentDatasheetL298DatasheetFAQWhatisl298n?ThisL298NMotorDriverModuleisahighpowermotordrivermodulefordrivingDCandStepperMotors.ThismoduleconsistsofanL298motordriverICanda78M055Vregulator.L298NModulecancontrolupto4DCmotors,or2DCmotorswithdirectionalandspeedcontrol.Whatistheuseofl298n?TheL298NisadualH-BridgemotordriverwhichallowsspeedanddirectioncontroloftwoDCmotorsatthesametime.ThemodulecandriveDCmotorsthathavevoltagesbetween5and35V,withapeakcurrentupto2A.Howdoesl298ncontrolDCmotorspeed?1.IfyousendaHIGHsignaltotheenable1pin,motorAisreadytobecontrolledandatthemaximumspeed;2.IfyousendaLOWsignaltotheenable1pin,motorAturnsoff;3.IfyousendaPWMsignal,youcancontrolthespeedofthemotor.Themotorspeedisproportionaltothedutycycle.Whatisl298nmotordrivermodule?ThisL298NMotorDriverModuleisahighpowermotordrivermodulefordrivingDCandStepperMotors.ThismoduleconsistsofanL298motordriverICanda78M055Vregulator.L298NModulecancontrolupto4DCmotors,or2DCmotorswithdirectionalandspeedcontrol.Howdoesl298nmotordriverwork?TheL298NisadualH-BridgemotordriverwhichallowsspeedanddirectioncontroloftwoDCmotorsatthesametime.ThemodulecandriveDCmotorsthathavevoltagesbetween5and35V,withapeakcurrentupto2A.HowdoIuseanl298motordriverwithArduino?Startbyconnectingpowersupplytothemotors.Inourexperiment,weareusingDCGearboxMotors(alsoknownasTTmotors)thatareusuallyfoundintwo-wheel-driverobots.Theyareratedfor3to12V.So,wewillconnecttheexternal12VpowersupplytotheVCCterminal.WhatisthefunctionoftheHbridge?AnH-bridgeisanelectroniccircuitthatswitchesthepolarityofavoltageappliedtoaload.ThesecircuitsareoftenusedinroboticsandotherapplicationstoallowDCmotorstorunforwardsorbackwards.Whatisthedifferencebetweenl293dandl298n?L293isaquadruplehalf-HdriverwhileL298isdualfull-Hdriver,i.e,inL293allfourinput-outputlinesareindependentwhileinL298,ahalfHdrivercannotbeusedindependently,onlyfullHdriverhastobeused....Hence,heatsinkisprovidedinL298.

TDA7294IntroductionTheTDA7294isamonolithicintegratedcircuitinMultiwatt15package,intendedforuseasaudioclassABamplifierinHi-Fifieldapplications(HomeStereo,self-poweredloudspeakers,TopclassTV).Thankstothewidevoltagerangeandtothehighoutcurrentcapabilityitisabletosupplythehighestpowerintoboth4Ωand8Ωloadseveninpresenceofpoorsupplyregulation,withhighSupplyVoltageRejection.Thebuilt-inmutingfunctionwithturn-ondelaysimplifiestheremoteoperationavoidingswitchingon-offnoises.ThisisabuildandevaluationoftheTDA7294100wattaudioamplifierI.C.CatalogTDA7294IntroductionTDA7294FeaturesTDA7294PinConfigurationandFunctionsTDA7294BlockDiagramTDA7294PackageOutlineTDA7294AlternativesWhereandHowtouseTDA7294TDA7294ElectricalSpecificationsTDA7294ApplicationsDifferenceBetweenTDA7294andTDA7293ProductManufacturerComponentDatasheetOrdering&QuantityTDA7294FeaturesVeryhighoperatingvoltagerange(40V)DMOSpowerstageHighoutputpower(upto100wmusicpower)Muting/stand-byfunctionsNoswitchon/offnoiseNoBoucheroncellsVerylowdistortionVerylownoiseShortcircuitprotectionThermalshutdownTDA7294PinConfigurationandFunctionsPinfunctions:PinNo.PinNamePinDescription1Stand-ByGNDStand-ByGND,outputgetsconnectedtoground2InvertinginputTheInvertinginput3Non-InvertinginputTheNon-Invertinginput4SVRSupplyVoltageRejectionusedforpowersupplyrippleornoiserejection5N.C.Notconnected6BootstrapUsedtostep-upcharge7+VsSupplyPositivesupply8-VsSupplyNegativesupply9Stand-byStandbycontrolpinusedforlowpowermode,outputrunsinlowcurrentmode10MuteAudioisdisabledoftheoutput11N.C.Notconnected12N.C.Notconnected13+VsPowerPositivepowersupply14OutOutputpin15-VsPowerNegativepowersupplyTDA7294BlockDiagramTDA7294PackageOutlineMultiwatt15VpackageinformationMechanicalData:Multiwatt15HpackageinformationMechanicalData:TDA7294AlternativesTDA7293,TDA7295,LM3886WhereandHowtoUseTDA7294TDA7294canbeusedincircuitsrequiringhighpowerandhigh-efficiencyamplificationapplications.R1istheinputresistanceanditsrecommendedvalueis22kΩ.R2=680ΩandR3=22kΩdecidestheloopgainoftheamplifier.TheR4=22kΩandC4=10FdeterminethestandbyON/OFFtimeduration.TheR5=10kΩandC3=10Fareusedfordecidingthemutetimeconstant.DecouplingusedisC1=0.47F.C2=22mFisthefeedbackDC.C5=22mFBootstrapping.C6,C8=1000mFandC7,C90.1mFareusedforsupplyvoltagebypass.TDA7294ElectricalSpecificationsMaximumVSSupplyVoltage(NoSignal)50VMaximumIOOutputPeakCurrent10AMaximumTopOperatingAmbientTemperatureRange0to70CMaximumTstg,TjStorageandJunctionTemperature150CVSSupplyRangeisminimum10Vandmaximumvalue40VOpen-LoopVoltageGain80dBClosed-LoopVoltageGainminimum24dB,typically30dBandmaximum40dBIbInputBiasCurrent500nATDA7294ApplicationsHI-FICAR-RADIOBridgeApplicationCircuitAnaudioclassABamplifierStereossystemSubwooferDifferencesBetweenTDA7294andTDA7293FeaturesofTDA7293MultipowerBCDtechnologyVeryhighoperatingvoltagerange(50V)DMOSpowerstageHighoutputpower(100Winto8Ω@THD=10%,withVS=40V)Mutingandstand-byfunctionsNoswitchon/offnoiseVerylowdistortionVerylownoiseShort-circuitprotected(withnoinputsignalapplied)ThermalshutdownClipdetectorModularity(severaldevicescaneasilybeconnectedinparalleltodriveverylowimpedances)BoththeseaudiochipsuseDMOSordouble-diffusedmetaloxidesemiconductoroutputstages.Supplyrailsare+/-60VDCmaxfortheTDA7293and+/-50VDCfortheTDA7294,transformersupplyrailsAC32V-0-32Vto35V-0-35V,recommendationis32V-0-32Vfor8ohmoperation.TheconversionratevalueofTDA7293isalso10V/us,butithasawidervoltagesupplyrange,andthehighestavailabledual50VDCpowersupply,whichmeansthatithasalargerdynamicrangeandhigheroutputpowerthanTDA7294.Indual40VDCpowersupply,anaverageoutputpowerof100Wcanbeachievedat8ohmload.Ofcourse,ifthevoltageisincreasedtodouble50V,orasmallerloadsuchas4ohm,therewillbegreateroutputpower,accordingtothecharacteristicsofTDA7293,whenselectingatransformer,dual28VACvoltagecanbeselected,sothevoltageafterrectificationandfilteringisabout40V,ofcourse,thevoltagecanalsobeincreased.Consideringthatthereisafluctuationinthegridvoltage,itisbesttobelessthanthemaximumvoltageof50V,sothatthecircuitcanworkinamorestablecondition.ProductManufacturerSTMicroelectronics(ST)groupwasestablishedinJune1988asaresultofthemergerofSGSMicroelectronicsofItalyandThomsonOfFrance.InMay1998SGS-ThomsonMicroelectronicschangeditsnametoSTMicroelectronicsLimited.Itistheworldslargestmanufacturerofdedicatedanalogchipsandpowerconversionchips,theworldslargestsupplierofindustrialsemiconductorsandset-topboxchips,andaworldleaderindiscretecomponents,mobilephonecameramodules,andautomotiveintegratedcircuits.ComponentDatasheetTDA7294DatasheetTDA2030DescriptionTheTDA2030isamonolithicintegratedcircuitinPentawattpackage,intendedforuseasalow-frequencyclassABamplifier.Typicallyitprovides14Woutputpower(d=0.5%)at14V/4Ω;at14Vor28V,theguaranteedoutputpoweris12Wona4Ωloadand8Wonan8Ω(DIN45500).TheTDA2030provideshighoutputcurrentandhasverylowharmonicandcross-overdistortion.Further,thedeviceincorporatesanoriginal(andpatented)shortcircuitprotectionsystemcomprisinganarrangementforautomaticallylimitingthedissipatedpowersoastokeeptheworkingpointoftheoutputtransistorswithintheirsafeoperatingarea.Aconventionalthermalshut-downsystemisalsoincluded.HowToMakeHighPowerAmplifierUsingTDA2030/DC12v(EnglishSubtitle)CatalogTDA2030DescriptionTDA2030PinConfigurationsTDA2030FunctionalBlockDiagramTDA2030PackageOutlineTDA2030FeaturesTDA2030FunctionalEquivalentsTDA2030PopularitybyRegionTDA2030ApplicationsWheretoUseTDA2030?HowtoUseTDA2030?ProductManufacturerComponentDatasheetOrdering&QuantityTDA2030PinConfigurationsPinNumberPinNameDescription1NonInvertingInputNon-invertingend(+)ofAmplifier2InvertingInputInvertingend(-)ofAmplifier3Vs(Ground)Connecttothegroundofthecircuit4OutputThispinoutputstheamplifiedsignal5Vs(Power)Supplyvoltage,Minimum6VandMaximum36VTDA2030FunctionalBlockDiagramTDA2030PackageOutlineMechanicalData:TDA2030FeaturesFewexternalcomponentsMinimalbootimpactLow-frequencyclassABamplifier,mostsuitableforaudioamplificationCanprovideupto20wattsofoutputpowerWiderangepowersupplyfrom6Vto36VCanprovideshortcircuitandthermalprotectionBreadboardfriendlyAvailablein5-pinTO220packageTDA2030FunctionalEquivalentsTDA2030PopularitybyRegionTDA2030ApplicationsForaudiosignalamplificationSuitableforhighpoweramplificationAbletorunondual/splitpowersuppliesCanbeusedtocascadeaudiospeakersWheretouseTDA2030?TheTDA2030isapowerfulaudioamplifierIC.Anaudioamplifierisnothingbutonethathasthecapabilitytoamplifytheaudiosignalsfromanyaudiosourcesuchasmobilephonejackormicrophonesothatvolumeisincreasedwhentheaudioisplayedinaspeaker.Audioamplifiercircuitscanalsobemadeusingsimpleop-amps,butifyouneedthehighervolumethatisloudenoughforaroomthenthispoweraudioamplifieriswillbethebestchoice.ThisICcandeliverupto20Wofoutputpower,soyoucanruna4Ωspeakerat12Woran8Ωspeakerat8W.HowtouseTDA2030?TheTDA2030isbreadboardfriendlyandhencecanbeeasilytestedusingabreadboard.TheTDA2030AdatasheetgiveninthepaperconsistsofsomebasiccircuitswhichcanbeusedtomakethisICwork.Ihavealsogivenaverybasiccircuitbelow.TheICcanwitherworkondualpowersupplyorsinglemodepowersupply,tokeepthissimpleIhavepreferredsingle-modesupplybyusinga9Vbattery.The5thpin(Vs)isconnectedtothepositiveterminalofthebatteryandthe3rdpin(Ground)isconnectedtothenegativeterminalofthebattery.ThisICisapoweramplifierICandhencerequiresadecentamountofcurrenttooperate,hencemakesureyourbatterycansourceenoughcurrent.TheresistorR1andR2formapotentialdivideracrossthepins4and2.ThetwodiodesD1andD2areusedtoprotecttheICfromreversecurrents.ThespeakerLS1canbeanyordinaryspeakerofvalue4Ω,6Ωor8Ω.TheaudiosourceC2(1)canbeanyaudiosourcefromamobilejackorevenamicrophone.JustconnectthepositivepointtoC2(1)andgroundtheotherpoint.Also,notethatthisamplifiercanamplifyonlymonochannelsoundsignals.Soifyouhavetwoaudiowiresforleftandrightchannelcombinethembothtomakeitasasinglechannel.ProductManufacturerTheSTMicroelectronics(SGS-THOMSON,ST)groupwasestablishedin1987bythemergerofSGSMicroelectronicsinItalyandThomsonSemiconductorinFrance.InMay1998,SGS-THOMSONMicroelectronicschangeditscompanynametoSTMicroelectronicsCo.,Ltd.STMicroelectronicsisoneoftheworldslargestsemiconductorcompanies.Itaimstobethemarketleaderinmultimediaapplicationintegrationandpowersolutions.STMicroelectronicshastheworldsmostpowerfulproductlineup,includingdedicatedproductswithhighintellectualpropertyrights.Products,therearealsoinnovativeproductsinmanyfields,suchasdiscretedevices,high-performancemicrocontrollers,securitysmartcardchips,andmicro-electromechanicalsystems(MEMS)devices.Indemandingapplicationssuchasmobilemultimedia,set-topboxesandcomputerperipherals,STMicroelectronicsisapioneerinthedevelopmentofcomplexICsusingplatform-baseddesignmethods,andcontinuestoimprovethisdesignmethod.STMicroelectronicshasawell-balancedproductportfoliothatcanmeettheneedsofallmicroelectronicsusers.Globalstrategiccustomerssystem-on-chip(SoC)projectsalldesignateSTMicroelectronicsasthepreferredpartner.Atthesametime,thecompanyalsoprovidesfullsupportforlocalcompaniestomeetlocalcustomersneedsforgeneral-purposedevicesandsolutions.ComponentDatasheetTDA2030Datasheet

DescriptionULN2003AisaDarlingtontransistorarraywithhighvoltageandhighcurrent.ItconsistsofsevenNPNDarlingtonpairswithahighvoltageoutputandacommoncathodeclampdiodeforswitchinginductiveloads.CatalogDescriptionULN2003APinoutULN2003ADocumentsandMediaULN2003AECADModelULN2003AFeaturesULN2003AAdvantagesWheretouseULN2003HowtouseULN2003ULN2003AApplicationULN2003APackageInformationULN2003ARepresentativeSchematicDiagramProductManufacturerFAQOrdering&QuantityULN2003APinoutULN2003ADocumentsandMediaResourceTypeLinkDatasheetsULN2003A,ULQ2003AHTMLDatasheetULN2003A,ULQ2003AULN2003AECADModelULN2003ADR2GSymbolsULN2003ADR2GFootprintsULN2003AFeaturesTheULN2003isknownforitshigh-current,high-voltagecapacity.Thedriverscanbeparalleledforevenhighercurrentoutput.Evenfurther,stackingonechipontopofanother,bothelectricallyandphysically,hasbeendone.Generallyitcanalsobeusedforinterfacingwithasteppermotor,wherethemotorrequireshighratingswhichcannotbeprovidedbyotherinterfacingdevices.ULN2003Mainspecifications:500mAratedcollectorcurrent(singleoutput)50Voutput(thereisaversionthatsupports100Voutput)IncludesoutputflybackdiodesInputscompatiblewithTTLand5-VCMOSlogicULN2003AAdvantagesTheULN2003AisanarrayofsevenNPNDarlingtontransistorscapableof500mA,50Voutput.Itfeaturescommon-cathodeflybackdiodesforswitchinginductiveloads.ItcancomeinPDIP,SOIC,SOPorTSSOPpackaging.InthesamefamilyareULN2002A,ULN2004A,aswellasULQ2003AandULQ2004A,designedfordifferentlogicinputlevels.TheULN2003AisalsosimilartotheULN2001A(4inputs)andtheULN2801A,ULN2802A,ULN2803A,ULN2804AandULN2805A,onlydifferinginlogicinputlevels(TTL,CMOS,PMOS)andnumberofin/outputs(4/7/8).WheretouseULN2003ULN2003ICisoneofthemostcommonlyusedMotordriverIC.ThisICcomesinhandywhenweneedtodrivehighcurrentloadsusingdigitallogiccircuitslikeOp-maps,Timers,Gates,Arduino,PIC,ARMetc.Forexampleamotorthatrequires9Vand300mAtoruncannotbepoweredbyanArduinoI/OhenceweusethisICtosourceenoughcurrentandvoltagefortheload.ThisICiscommonlyusedtodriveRelaymodules,Motors,highcurrentLEDsandevenStepperMotors.Soifyouhaveanythingthatanythingmorethan5V80mAtowork,thenthisICwouldbetherightchoiceforyou.HowtouseULN2003TheULN2003isa16-pinIC.IthassevenDarlingtonPairsinside,whereeachcandriveloadsupto50Vand500mA.ForthesesevenDarlingtonPairswehavesevenInputandOutputPins.AddingtothatwecanagroundandCommonpin.Thegroundpin,asusualisgroundedandtheusageofCommonpinisoptional.ItmightbesurprisingtonotethatthisICdoesnothaveanyVcc(power)pin;thisisbecausethepowerrequiredforthetransistorstoworkwillbedrawnfromtheinputpinitself.ThebelowcircuitisasimplecircuitthatcanbeusedtotesttheworkingofULN2003IC.InthecircuitconsidertheLEDtobetheloadsandthelogicpins(bluecolor)asthepinsconnectedtotheDigitalcircuitorMicrocontrollerlikeArduino.NoticethatthePositivepinoftheLEDisconnectedtothepositiveloadvoltageandthenegativepinisconnectedtotheoutputpinoftheIC.ThisisbecausewhentheinputpinoftheICgetshightherespectiveoutputpinwillgetconnectedtoground.SowhenthenegativeterminaloftheLEDisgroundeditcompletesthecircuitandthusglows.Theloadsconnectedtotheoutputpincanbemaximumof50Cand500mAeach.Howeveryoucanrunhighercurrentloadsbuycombiningtwoormoreoutputpinstogather.Forexampleifyoucombinethreepinsyoucandriveupto(3*500mA)~1.5A.TheCOMpinisconnectedtogroundthroughaswitch,thisconnectionisoptional.Itcanbeusedatestswitch,meaningwhenthispinisgroundedalltheoutputpinswillbegrounded.ULN2003AApplicationTypicalusageoftheULN2003Aisindrivercircuitsforrelays,lampandLEDdisplays,steppermotors,logicbuffersandlinedrivers.AULN2003installedinabreakoutboardtobeusedasaunipolarsteppermotordriverwitha28BYJsteppermotorontheleft.ULN2003APackageInformationULN2003ARepresentativeSchematicDiagramProductManufacturerONSemiconductor(Nasdaq:ON)isdrivingenergyefficientinnovations,empoweringcustomerstoreduceglobalenergyuse.Thecompanyoffersacomprehensiveportfolioofenergyefficientpowerandsignalmanagement,logic,discreteandcustomsolutionstohelpdesignengineerssolvetheiruniquedesignchallengesinautomotive,communications,computing,consumer,industrial,LEDlighting,medical,military/aerospaceandpowersupplyapplications.ONSemiconductoroperatesaresponsive,reliable,world-classsupplychainandqualityprogram,andanetworkofmanufacturingfacilities,salesofficesanddesigncentersinkeymarketsthroughoutNorthAmerica,Europe,andtheAsiaPacificregions.FAQWhatistheuseofuln2003a?TypicalusageoftheULN2003Aisindrivercircuitsforrelays,lampandLEDdisplays,steppermotors,logicbuffersandlinedrivers.Whatisthefunctionofuln2003driverininterfacingofsteppermotor?Knownforitshighcurrentandhighvoltagecapacity,theULN2003givesahighercurrentgainthanasingletransistorandenablesthelowvoltageandlowcurrentoutputofamicrocontrollertodriveahighercurrentsteppermotor.WhatisaDarlingtonarray?Darlingtondevicesarehigh-voltage,high-currentswitcharrayscontainingmultipleopen-collectorDarlingtonpairsormultipleDarlingtontransistorswithcommonemitters,andintegralsuppressiondiodesforinductiveloads.HowtousetheULN2003ATransistorArraywithArduino?I.DescriptionTheroleofanalog-to-digitalconversion(AD)istoconvertcontinuousanalogquantitiesintodiscretedigitalquantitiesthroughsampling.Itiswidelyusedincircuitdesign,suchasthedigitizationofanalogquantitiessuchasimage,voltage,andcurrent.ThefunctionoftheADchipistocompletetheanalog-to-digitalconversionfunction.TherearemanykindsofADchips.ThisarticletakesADC0804asanexampletoelaborateonthesoftwareandhardwaredesignmethodsoftheADconversioncircuit.CatalogI.DescriptionII.ADC0804IntroductionIII.CircuitConnectionDiagramIV.ADC08904TimingAnalysis4.1ADC08904StartConversionTimingAnalysis4.2ADC0804ReadDataTimingAnalysisV.ADC0804Analog-to-digitalConversionTestProgramVI.ConclusionFAQOrdering&QuantityII.ADC0804IntroductionADC0804isastep-by-stepcomparisonADconverter,usingCMOSmanufacturingprocess,20pins,8-bitresolution,theinputanalogvoltagerangeis0-5V,andthetypicalconversiontimeis100us.Thechipcontainsathree-statedataoutputlatch,whichcanbedirectlyhungonthedatabusofthemicrocontroller.III.CircuitConnectionDiagramFigure1CircuitconnectiondiagramThecircuitconnectiondiagramisshowninFigure1above,whichmainlyincludesAT89S52single-chipmicrocomputer,ADC0804and8light-emittingdiodes.The31-pinoftheone-chipcomputerisconnectedtohighlevel,thepurposeistomaketheone-chipcomputerstarttoexecutetheprogramfromtheinternalROMafterpower-on.ThefollowingfocusesontheperipheralcircuitdesignoftheADC0804chipandtheconnectionbetweenthecorrespondingpinsandthemicrocontroller.The20thpinofADC0804isconnectedto5Vforpoweringitself,andpin0isthepowerground.Pins11-18aretheconverteddigitalsignaloutputterminals,whicharerespectivelyconnectedtoP1.7-P1.0ofthesingle-chipmicrocomputerandconnectedtotheanodesof8light-emittingdiodes(LED1-LED8).Thefunctionofconnectingthelight-emittingdiodeistointuitivelytestthecorrectnessofthecircuitdesignandprogrammingbyobservingthechangeofitson-offstate.Thedetailswillbegivenlater.Pin1CSisthechipselectionterminal,connectedtopinP3.5ofthemicrocontroller,andthelowlevelisactive.OnceCSisactive,ADC0804isreadytostartworkingimmediately.Pin2RDisthereadsignalinputterminal,connectedtopinP3.7ofthesingle-chipmicrocomputer,lowleveliseffective.3pinWRisthewritesignalinputterminal,connectedtothesingle-chipP3.6pin,thelowlevelisvalid,andtheWRisvalid,theADconversionisstartedimmediately.The19-pinCLKRistheexternalresistanceendoftheinternalclockgenerator.TheRCoscillatorcircuitisformedbya10Kresistoranda150pfcapacitor.Theoscillationsignaloutputbytheoscillatorcircuitisconnectedtothe4-pinCLKINastheclockpulseofADC0804.Thepulsefrequencyis1/(1.1R*C),ifthecapacitorisselectedtoomuch,theconversionratewillbeaffected.Pin5INTRistheinterruptsignaloutputterminal.Whenitoutputsalowlevel,itindicatestheendofanADconversionandpromptsthecontrollertodothecorrespondingprocessing.Thisarticledoesnotusetheinterruptmode,sothepinisleftfloating.6-pinVIN+and7-pinVIN-formapairofanalogdifferentialsignalinputterminals.Amongthem,pin6VIN+isconnectedtoanadjustableresistorthrougha10Kcurrentlimitingresistor.Byadjustingthesizeoftheadjustableresistor,avoltagebetween0-5Vcanbeobtained.Sincepin7VIN-isgrounded,thevoltageisItistheanaloginputvoltageofADC0804.ThetaskofADC0804istoconverttheanalogvoltageintoan8-bitdigitalquantity,therangeis0x00-0xFF.Pin9VREF/2isthereferencevoltageinputterminal.Thereferencevoltageis2.5V,whichisobtainedbydividingthe5Vvoltagethroughtwo1Kresistors.IV.ADC08904TimingAnalysis4.1ADC08904StartConversionTimingAnalysisFigure2ADC08904startconversiontimingdiagramAccordingtotheADC0804startconversiontimingdiagram(Figure2),itcanbeseenthattheADC0804startstheconversionthroughthefollowingseriesofprocesses:first,clearCS,thatis,changeCStolowlevel,afteraslightdelay,changeWRfromhighleveltolowlevel,andthenchangeWRtohighlevelafteraslightdelay,andtheADconversionisofficiallystarted.After1-8ADconversiontimeperiods,theanalog-to-digitalconversioniscompleted,andtheconversionresultisautomaticallystoredintheinternallatch.Atthesametime,theINTRinterruptoutputterminalbecomeslowleveltoinformtheMCUofthisADconversionjunction,andtheMCUthentakesoutthedatabyreadingforsubsequentprocessing.4.2ADC0804ReadDataTimingAnalysisFigure3ADC0804readdatatimingdiagramAccordingtotheADC0804readdatatimingdiagram(Figure3),itcanbeseenthattheADC0804readdataoperationneedstogothroughthefollowingseriesofprocesses:firstclearCS,thatis,CSbecomeslow,andafteraslightdelay,RDchangesfromhightohighLowlevel,afterTacctime,thedataonthedigitalsignaloutputterminal(digitalsignalafterA/Dconversion)canbestabilized.Atthistime,themicrocontrollercanreadthedataonthedigitalsignaloutputterminal,andthenpullRDtoahighlevel.V.ADC0804Analog-to-digitalConversionTestProgramThisarticlewritesacompleteADC0804analog-to-digitalconversiontestprogram,asshownbelow,andgivestheprogramfunctioncommentslinebyline.TheprogramiswrittenstrictlyinaccordancewiththeADC0804start-upconversiontimingandreaddatatiming.ItsfunctionistoobtaindifferentvoltagesbyadjustingtheadjustableresistorR2inFigure1.ThisvoltageisusedastheanaloginputofADC0804,whichisconvertedto8-bitdigitalquantitybyADC0804,anddrives8-bitlight-emittingdiodesrespectively.Differentvoltagesareconvertedintodifferentdigitalquantities,sothatthebrightnessofthe8-bitLEDisdifferent.Observingthisphenomenonindicatesthatthedesignoftheanalog-to-digitalconversioncircuitinthisarticleiscorrect.VI.ConclusionInthispaper,8051single-chipmicrocomputerisusedasthecontroller,theADC0804-basedanalog-to-digitalconversioncircuitisdesigned,theworkingprincipleofADC0804isdiscussed,andacompletetestprogramisgivenandannotated.Throughtesting,thecircuitcanworknormally,layingagoodfoundationforfurtherresearchinthefieldofcircuitdesigninthefuture.FAQWhatisadc0804?TheADC0804isacommonlyusedADCmodule,forprojectswereanexternalADCisrequired.Itisa20-pinSinglechannel8-bitADCmodule.MeaningitcanmeasureoneADCvaluefrom0Vto5Vandtheprecisionwhenvoltagereference(Vrefpin9)is+5Vis19.53mV(Stepsize).Whatisthedifferencebetweenadc0804andmax1112?ADC0804isusedforparallelADCandMAX1112isusedforserialADC.Whichpinoftheadc0804indicatesendofconversion?PIN-5Interrupt(INTR)ThispinautomaticallygoeslowwhenconversionisdonebyADC0804orwhendigitalequivalentofanaloginputisready.PIN-6Vin(+)connectinputanalogsensorpin/inputvoltagetothispin.WhatisADCandDAC?ADCstandsforAnalogtoDigitalConverter,whichconvertstheanalogsignalintothedigitalsignal.DACstandsforDigitaltoAnalogConverteranditconvertstheDigitalsignalintoananalogsignal.Whatistheresolutionof8bitADC?Forexample,anADCwitharesolutionof8bitscanencodeananaloginputtoonein256differentlevels(28=256).Thevaluescanrepresenttherangesfrom0to255(i.e.asunsignedintegers)orfrom128to127(i.e.assignedinteger),dependingontheapplication.

访客,请您发表评论:

Powered By Tkool Electronics

Copyright Your WebSite.sitemap