You are on page 1of 11

10/13/2016

USBDataAcquisitionUnitsinEn

Volume5,Number1,Fall2004

USBDataAcquisitionUnitsinEngineeringTechnology
Applications

DaleH.Litwhiler
ElectricalEngineeringTechnology
PennStateBerks
Reading,PA19610
dhl10@psu.edu

TerranceD.Lovell
ElectricalEngineeringTechnology
Student
PennStateBerks

ABSTRACT

TheUniversalSerialBus(USB)hasbecomeaubiquitoustechnologyforcomputerperipherals.Itis
availableonvirtuallyeverynewcomputerandinmostcasesprovidesaseamlessconnectionmethodfora
varietyofconsumerelectronicsdevicessuchasdigitalcameras,scannersandprinters.Thiseaseof
connectiontogetherwiththeinherenthighdatarateofUSBalsomakesthistechnologyveryusefulfordata
acquisitionandcontrolunits.ThispaperpresentstheuseofUSBdataacquisitionunitsinan
electromechanicalengineeringtechnologylaboratoryenvironment.Features,advantagesanddisadvantages
ofthehardwarearediscussed.TheLabVIEWsoftwaretools(virtualinstruments)developedtointerface
withtheUSBdevicearepresented.Examplesofsensingandcontrolsystemsexperimentsandprojectsare
alsogiven.

INTRODUCTION

TheUniversalSerialBus(USB)hasquicklyfounditswayfromconsumerelectronics(cameras,scanners,
printers,cellphones,etc.)tolaboratoryequipment.Theeaseofconnectionandrelativelyhighdatarateof
USBmakesthistechnologyveryusefulforportabledataacquisitionunits.Severalunitsarenowavailableat
veryreasonablecostfromcompaniessuchasLabJack,MeasurementComputingCorporationandNational
Instruments.TheunitcurrentlyusedbyengineeringtechnologystudentsatPennStateBerksisthe
LabJackU12.TheLabJackU12featuresaretypicaloftheUSBdevicescurrentlyavailable.These
featuresincludemultichannelanalogvoltageinputandoutput,digitalI/O,eventcounterinputand+5V
powersupplyoutput(suppliedfromthehostcomputerviatheUSBcable).Thissetoffeaturesmakesthese
devicesidealformanytypesofengineeringtechnologyeducationapplications.

CombiningUSBdataacquisitionhardwarewiththecapabilitiesofLabVIEWsoftwaremakesavery
powerfulandportablemeasurementandcontrolsystemforlaboratory/classroomexperimentsandhardware
intheloop(HIL)designprojects.1UnliketraditionalISAorPCIbusplugincards,theUSBdevicescanbe
easilymovedtodifferentcomputers.Whenpairedwithalaptopcomputer,thesystembecomescompletely
mobilewhichprovidesmanymoreapplicationpossibilities.ThelowcostoftheseUSBdataacquisition
devicesalsomakesthemaviableoptionforstudentstopurchaseontheirownforhomeexperimentation.
Thiscapabilitygreatlyenhancesthestudentslearningprocess.2,3

TheLabJackunitprovidesaverygoodinterfaceformanytypesoftransducersincludingtemperature,
position,velocityandacceleration/tiltsensors.Somesensors,however,requireanalogsignalconditioning
http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

1/11

10/13/2016

USBDataAcquisitionUnitsinEn

priortoconnectiontotheLabJacktobufferorscalethesignals.Furtherprocessingofsignalsacquiredfrom
thesedevices,aswellasthegraphicaluserinterfaceisperformedwithLabVIEWsoftware.Thisiswherethe
realcreativityofsystemdesigntakesplace.UsingLabVIEWsoftware,therangeofapplicationsthatcanbe
constructedaroundtheUSBdevicesisenormous.AsetofLabVIEWvirtualinstruments(VI)hasbeen
developedfortheLabJackU12bytheauthorsforusebyengineeringtechnologystudents.Thispaper
presentsanddiscussesthehardwareandsoftwarefeaturesandcapabilitiesofaUSBdataacquisitionsystem
foruseintheengineeringtechnologyeducationenvironment.Examplesofexperimentsandapplicationsare
alsoincluded.

HARDWARE

TheLabJackU12deviceisalightweightUSBperipheraldevicehousedinadurableplasticcaseasshownin
Figure1.TheunitisconnectedtothecontrollingcomputerviaastandarddetachableUSBcable.Powerfor
theU12isobtainedthroughtheUSBcablethusnoexternalpowersupplyisneeded.Someoftheexternal
dataacquisitionandcontrolsignalconnectionsaremadethroughthescrewterminalsontopoftheunit
(screwdriverincluded!)whileothersareviaa25pinDconnectorontheside.4

Figure1:LabJackUSBDataAcquisitionUnit

TheLabJackU12haseight,12bitanalogvoltageinputs(AI0AI7)thatcanbeconfiguredviasoftwarefor
eithersingleendedordifferentialmeasurements.Allanaloginputvoltagesmustbebetween+10Vand10V
withrespecttounitground(GND).Whenconfiguredfordifferentialinput,thegaincanbeadjustedvia
softwarewhichincreasesthevoltageresolutionwhileproportionallyreducingthespan.Theinputbias
currentoftheanaloginputsisratherhigh(roughly90A)andisapredictablefunctionoftheinputvoltageas
acknowledgedbythemanufacturer.Becauseofthisinputbiascurrent,caremustbetakenwheninterfacing
withhighimpedancesources.Thisissueisaddressedlaterinanexampleapplication.

TherearetwoanalogoutputsontheLabJackU12(AO0AO1).Eachanalogoutputhasaresolutionof10
bitsoveraratiometricspanfromzerovoltstothe+5VUSBpowersourcevoltage.Theoutputimpedanceof
eachanalogoutputistypically20ohms.Ifgreaterprecisionisneededoriftheoutputisdrivingheavyloads,
ananaloginputcanbeusedtomeasureandcorrecttheanalogoutputvoltageinsoftware.

Digitalinputsandoutputsareavailablethroughthescrewterminals(IO0IO3)andaDconnector(D0
D15)onthesideoftheLabJackU12unit.Allofthesesignalscanbeconfiguredaseitherinputoroutput,
however,therearesomedifferencesbetweentheI/OandtheDdigitalinputsandoutputs.TheI/O
connectionshaveaninternal1.5kresistorinserieswiththeterminalstohelpprotectfromdamagedueto
http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

2/11

10/13/2016

USBDataAcquisitionUnitsinEn

externalshortcircuitstogroundor+5V.Thisresistancethusalsolimitsthecurrentsourceandsink
capabilityofthissignal.D0D15donothaveanyintentionalsourceresistanceandcanthereforesource
andsinkupto25mAbutcaremustbetakennottoshortcircuitthemtoanylowimpedancevoltages.

Thedigitalinputsandoutputs(bothIOandDsignals)areextremelyusefulformanyapplications.Sinceall
inputsaresampledsimultaneously,theU12canbeusedasalowfrequency,twentychannellogicanalyzer.
Thedigitaloutputscanalsobeusedtoformasteppermotorcontrollerwithallofthephasingandsequencing
handledinsoftware.

AnotherextremelyusefulfeatureoftheLabJackU12isthefrequency/eventcounterinput(CNT).This32
bitcounterinputacceptsTTLandCMOSlogiclevelsandhasamaximumfrequencyof1MHz.Many
transducercircuitsaredesignedtoproduceasignalfrequencyoutputthatisafunctionofthemeasured
quantity.5TheU12countercanbeusedtoreceivethesesignalswhicharethendecoded(linearized)in
software.

The+5VpowersupplyoutputvoltageavailableontheLabJackU12isveryconvenientforpoweringanalog
anddigitalsignalconditioning(glue)circuits.Thisvoltagecomesdirectlyfromthehostcomputer(oraUSB
hub)andisthereforecurrentlimitedbythisequipment.Regardlessofthesource,atleast50mAwillbe
available,whichismorethanenoughtopoweropampordigitallogiccircuits.

SOFTWARE

SoftwaredriversfortheLabJackU12areavailablefordownloaddirectlyfromthemanufacturerswebsite.4
AllofthenecessaryUSBinterfacesoftwareiscontainedinonedynamiclinklibrary(DLL)file.Thereare
alsoseveralutility/applicationsavailableformanyplatformsandoperatingsystems.TheLabVIEW
examplesavailablefromLabJackareparticularlyusefulbecauseoftheeaseofprogrammingandpopularity
ofLabVIEWinengineeringtechnology.Theseexamplesareeasilydissectedforuseincustomapplications.

TheLabVIEWvirtualinstruments(VIs)describedinthefollowingexampleshaveevolvedoverseveral
semestersandthroughfourversionsofLabVIEW(from6ito7.1).Thefunctionsusedintheexamplesare
compatiblewiththelatestrevisionoftheLabVIEWstudentversionwhichatthetimeofthiswritingis
version7Express(7.0).Bykeepingthiscompatibility,studentscanexperimentwiththeVIswiththeirown
LabJackandpersonalcomputerathome.

EXAMPLES

ThesimplefunctionalityoftheLabJacktogetherwiththepowerofLabVIEWallowsforthedevelopmentof
verysophisticatedapplicationsinmeasurementandcontrol.Thefollowingexamplesdemonstratearangeof
possibilities.Atfirst,thefacultydevelopedbasicVIstogetthestudentsstarted.Soon,motivatedstudents
weretakingtheseVIstoawholeotherlevelofcomplexity.

THERMISTORTEMPERATURESENSOR

Inthisexample,anegativetemperaturecoefficientthermistorisusedasatemperaturesensor.Thethermistor
resistancechangesasafunctionoftemperatureandcanbeapproximatedforarangeoftemperaturesbyan
exponentialexpression.Ifthethermistorresistanceismeasured,thetemperature,indegreesCelsius,ofthe
thermistorcanthereforebedeterminedbyanexpressionoftheform:

Inthisexpression,,T0andRT0areconstantsforagiventhermistorandRTisthemeasuredthermistor
resistance.

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

3/11

10/13/2016

USBDataAcquisitionUnitsinEn

Figure2:LabJackWiringDiagramforThermistorExperiment

Inthefirstpartoftheexperiment,thestudentsusetheLabJacktomeasuretheresistanceofthethermistorat
variouswaterbathtemperatures.Alaboratorythermometerisusedasthereference.Figure2showsthe
thermistorconnectionstotheLabJack.TheLabJackisconfiguredtomaketwodifferentialvoltage
measurements.Onedifferentialvoltagemeasurementistheactualthermistorvoltage(AI4AI5),whilethe
othermeasurementisthecurrentsensingresistorvoltage(AI6AI7).The+5Vpowersupplyvoltageofthe
LabJackisusedtopowerthecircuitsonootherpowersupplyisneeded.Usingthisdata,thestudentsthen
estimatethevaluesof,T0andRT0usingstandardtechniques.Theestimatedvaluesfor,T0andRT0are
thenusedtoverifytheperformanceofthemodel.Figure3showstheLabVIEWfrontpanelfortheVIused
inthisexperiment.Figure4showsthecorrespondingLabVIEWblockdiagram.

Figure3:LabVIEWFrontPanelforThermistorExperiment

Figure4:LabVIEWBlockDiagramforThermistorExperiment

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

4/11

10/13/2016

USBDataAcquisitionUnitsinEn

ReferringtoFigure4,thedifferentialvoltagemeasurementsaremadeinthesubVIblockslabeled,LJ
EAI.Thesevoltagemeasurementsarethenprocessedbythesoftware(equationnode)todeterminethe
thermistorresistance,Rth.TheIbtermisusedtocompensatefortheinputLabJackanaloginputbias
currentsasafunctionofthemeasuredvoltage.Alsonoticethatacorrectiontermfortheselfheatingeffect
ofthethermistoriscalculatedbydeterminingthepowerdissipatedinthethermistor,Pth.Eachofthese
correctionsiseasilyhandledinthesoftware.Thestudentsquicklyappreciatethepowerofthesoftwareto
performsuchoperations.

ACCELEROMETERTILTSENSOR

ThisexampleusestheADXL311accelerometerfromAnalogDevicestogetherwiththeLabJackand
LabVIEWtoproduceatwoaxistiltsensor(pitchandroll).TheADXL311isasolidstate(MEMS)device
anditscharacteristicsarestudiedaspartofajuniorlevelinstrumentationcourse.Forthisapplication,a
smallcircuitboardwasfabricatedtoholdtheADXL311andtheanalogsignalconditioningelectronics.
Figure5showsaschematicoftheconditioningcircuitboard.

Figure5:AccelerometerSignalConditioningSchematic

TheXandYoutputsoftheADXL311produceavoltagethatisafunctionoftherespectiveaxisacceleration
withazeroglevelof1.5Vandasensitivityof167mV/g(withasupplyvoltageof3.0VDC).Becausethis
deviceisabletosenseconstantacceleration(minimumfrequencyincludeszero),theaccelerationdueto
gravitycanbeusedtodeterminethephysicalorientationofthedevice(pitchandroll)withrespecttothe
surfaceoftheearth.6

Thesignalconditioningboardwasdesignedbyamotivatedengineeringtechnologystudent(secondauthor
ofthispaper).TheADXL311isonlyavailableinaceramicleadlesschipcarrierpackagesoaprintedcircuit
boardisneededtomakereliableconnectiontothedevice.Thecircuitboardalsoprovidesaregulated
3.0VDCsupplyvoltage(derivedfromtheLabJack+5Voutput)fortheADXL311aswellasbuffer
amplifiersforthehighimpedanceXandYaccelerationoutputs.ThezerogvoltagefortheXandYoutputs
http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

5/11

10/13/2016

USBDataAcquisitionUnitsinEn

isonehalfofthesupplyvoltage.Inordertoprovidethehighestresolution,aonehalfVDDreference
voltageisdevelopedontheboard(R3,R4divider).TheXandYoutputsarethenmeasureddifferentially
withrespecttothisreferenceusingtheLabJackanaloginputs.Thedifferentialanaloginputvoltagesarethen
amplifiedusingtheLabJackamplifierstoobtainthehighestpossibleresolution.Thecircuitboardwasalso
designedsuchthattheexternalconnectionpointsalignwiththerespectiveLabJackterminalsforeaseof
wiring.Figure6showsaphotographofthecircuitboardmountedontheLabJackU12.

Figure6:AccelerometerCircuitBoardonLabJack

TheLabVIEWsoftwareforthetiltsensorreadstheLabJackanaloginputscorrespondingtothe
accelerometerXandYoutputsinacontinuousloop.Figure7ashowstheLabVIEWfrontpanelforthis
applicationtheblockdiagramisshowninFigure7b.Theusercanchoosetoaveragethereadingstohelp
smooththeresponseifneeded.Therawvoltagereadingsaredisplayedaswellasvaluesthatarecorrected
viaasimplecalibrationprocedure.Tocalibratethesystem,theuserplacestheaccelerometerparalleltothe
horizonandnotestheXandYoutputreadings.ThesereadingsareenteredasthePitchandRollCenter
valueforeachaxis.Theuserthenrotatestheaccelerometerthroughplusandminus90degreesinboththe
pitchandrolldirectionsandnotesthemaximumandminimumvoltages.Thesereadingsareenteredasthe
appropriateLeft,Right,UpandDownvalues.Thesoftwarethenusesallofthesereadingsascorrection
factorsinthefinaloutputdisplay.Thepolarplotdisplaysthecurrentattitudeoftheaccelerometerinthe
samemannerasanaircraftArtificialhorizoninstrument.

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

6/11

10/13/2016

USBDataAcquisitionUnitsinEn

Figure7a:LabVIEWFrontPanelofAccelerometerTiltSensorVI

Figure7b:LabVIEWDiagramofADXL311TiltSensorVIExample

Inthelaboratoryexperiment,thepitchandrollanglesoftheaccelerometercircuitboardaremeasuredand
comparedtothedisplayedresults.Theoffsetandfullscalereadingsareusedtocalibratethesetupandthe
procedureisrepeated.Resultsarerecordedandcompared.Thepolarattitudedisplaygivestheexperimenta
gamelikefeelwhichhelpstoretainthestudentsinterestandaidsintheunderstandingofthetiltsensors
operation.

FUNCTIONGENERATORCONTROL

Inthisexampleofclosedloopcontrol,theoutputfrequencyofalaboratoryfunctiongeneratoriscontrolled
andmeasuredwiththeLabJackU12.Thefunctiongeneratoroutputfrequencyiscontrolledviaitsvoltage
controlledoscillator(VCO)inputusingaLabJackanalogoutputvoltagesignal.Thefunctiongenerator
outputfrequencyismeasuredwiththeLabJackcounterinput.

Figure8:LabVIEWFrontPanelforFunctionGeneratorExample

ThefunctiongeneratorusedforthisexampleistheBKPrecisionModel4011.Theoutputfrequency,
regardlessofwaveshapeandfrequencyrangeselected,varieslinearlyasfunctionoftheVCOinputvoltage.
AnincreasingVCOinputvoltageproducesadecreasingoutputfrequency.

Figures8and9showtheLabVIEWfrontpanelandblockdiagramforthisexample.Whenstarted,the
LabVIEWVIfirstentersacalibrationroutineinwhichtheVCOvoltage,producedbyaLabJackanalog
http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

7/11

10/13/2016

USBDataAcquisitionUnitsinEn

output,issteppedfrom+5Vdowntozeroin0.25Vincrements.Theoutputfrequency(fromtheTTLoutput
jack)ismeasuredwiththeLabJackcounterateachsteptocreateacalibrationtable.Throughinterpolation,
thistableisthenusedtochoosetherequiredVCOinputvoltagetoachievethedesiredfunctiongenerator
frequencysetbytheuser.

Figure9:LabVIEWDiagramforFunctionGeneratorExample

CAPACITIVEPOSITIONTRANSDUCER
Thefrequency/eventcounteroftheLabJackU12isusedinthisexperimenttodemonstratethefunctionofa
positiontocapacitancetransducer.ThetransduceristheTK294HbyFeedbackInc.showninFigure10.
Thetransducerconstructionformsacoaxialcapacitorsuchthattheareaofoverlapbetweentheinnerand
outerconductivecylindersisafunctionoftheplungerposition.Thusthecapacitanceisafunctionofplunger
position.Ashorttwistedpairofwiresisusedtoconnectthetransducertotheoscillatorcircuit.

Figure10:VariableCapacitancePositionTransducer
Thisvariablecapacitorisplacedinanoscillatorcircuittoproduceanoutputfrequencythatisafunctionof
position.Theoscillatorforthissystemusesthe555timercircuitshowninFigure11whereCtisthe
transducercapacitance.NoticethatthecircuitispowereddirectlyfromtheLabJack's+5Voutputsonoother
equipmentisrequired.

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

8/11

10/13/2016

USBDataAcquisitionUnitsinEn

Figure11:CapacitivePositionTransducerOscillatorCircuit
Thetransducerandoscillatorsystemmustfirstbecalibratedbythestudents.Theplungerisplacedatseveral
knownpositionsandthecorrespondingoscillatorfrequencyismeasuredusingtheLabVIEWvirtual
instrumentshowninFigures12aand12b.Thepositionandfrequencydataisenteredintoaspreadsheet
formattedtextfile.ThiscalibrationdatafileisthenusedbythefrequencytopositionVIshowninFigures
13aand13b.

Figure12a:FrequencyCounterVIFrontPanel

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

9/11

10/13/2016

USBDataAcquisitionUnitsinEn

Figure12b:FrequencyCounterVIBlockDiagram

Figure13a:FrequencytoPositionConverterVIFrontPanel

Figure13b:FrequencytoPositionConverterVIBlockDiagram
TheFrequencytoPositionVIhasmanyfeaturestohelpthestudentsunderstandtherelationshipbetweenthe
positionoftheplungerandthefrequencyandperiodoftheoscillator.Theconceptsofastaticcalibration
curveanditsusearedemonstratedbythefrequencyandperiodinterpolationperformedbytheVI.Theleast
squaresbestfitoftheoscillatorperioddataisalsocomputedandusedasyetanotherwayofestimatingthe
positionoftheplungerfromthemeasuredfrequency.NoticeinFigure13bthatthemeasuredfrequencydata
ispassedthroughamedianfiltertohelpsmooththedisplayedresults.Itisimportantthatengineering
technologystudentsrecognizeandbecomefamiliarwiththistypeofdatamanipulationthatismadepossible
byvirtualinstrumentation.

SUMMARYANDCONCLUSIONS

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

10/11

10/13/2016

USBDataAcquisitionUnitsinEn

TheLabJackU12iswellreceivedbytheengineeringtechnologystudents.Thesestudentsareveryfamiliar
withconsumerelectronicUSBdevicessuchasdigitalcamerasandfilestoragedevicesandaretherefore
comfortablewiththetechnology.Inthelaboratory,thestudentsquicklyhavetheunitsconnectedtothe
computerandreadyforassemblingtheexperimentsetup.Thescrewterminalstripsmakeiteasytowire
manysmallcircuitsdirectlyontheLabJackwithouttheneedforanextrawiringboard.Thestudentshave
becomequiteskilledatthiswiringpractice.Thescrewdriverthatisincludedwitheachunitiscarefully
guardedbyeachlabgroupandisjokinglyreferredtoasthemostimportantpieceofequipmentinthelab.

ThetoylikeappearanceoftheLabJackU12causessomestudentstodoubtitsrelevancetoequipmentused
inindustry.ThesestudentsarereferredtoliteraturefromsuchcompaniesasNationalInstruments,
MeasurementComputingCorporationandDataqallofwhichproduceequipmentwithsimilarspecifications
forindustrialapplications.Whethertheyseeitasatoyoratool,engineeringtechnologystudentsappreciate
thesophisticatedmeasurementsystemsthatcanbecreatedaroundtheLabJack.Afewstudentshaveeven
beensomotivatedastopurchasetheirownLabJackforhomeuseinvarioushobbyapplications.

ThepopularityoftheLabJackunitsatPennStateBerkscontinuestogrow.Morefacultymembersarenow
interestedinapplicationsoftheU12.OneoftheseapplicationsusestheLabJackdigitaloutputstocontrola
steppermotor.TheLabVIEWsoftwarethenprovidesauserinterfacetoallowstudentstoexperimentwith
motorrotationdirections,stepratesandvariousanglesandfixednumbersofsteps.

USBdataacquisitiondevicesprovideaveryflexibleinterfaceforgettingrealworldmeasurementsintoa
computerandforcontrollingrealworldprocesseswithacomputer.ThepowerandeaseofuseofLabVIEW
softwareprovidesanexcellentmeansforengineeringtechnologystudentstoanalyzemeasurementsand
implementcontrolschemes.Studentscanquicklycreateverysophisticatedapplicationsatveryreasonable
cost.Herethestudentscanbegintoappreciatehowsoftwarecanbecreatedtoperformtheworkofthe
systemoncetheexternalmeasurementshavebeenacquired.Examplespresentedherearejustasmall
samplingofthekindofsystemsthatcanbecreatedwiththiscombinationofhardwareandsoftware.

BIBLIOGRAPHY

[1]Litwhiler,D.H.,ASimpleSoftwareandHardwareSystemSolutionforProcessMeasurementand
ControlinEngineeringTechnologyStudentDesignProjects,ProceedingsoftheAmericanSociety
forEngineeringEducationAnnualConferenceandExposition,2004.

[2]Rogers,C.,DataAcquisitionfortheDormRoom:TeachingExperimentationTechniquesUsing
LEGOMaterials,ProceedingsoftheAmericanSocietyforEngineeringEducationAnnual
ConferenceandExposition,2001.

[3]Braun,C.G.,ExperimentsontheCheap:UsingaStudentDataAcquisitionSystem,Proceedingsof
theAmericanSocietyforEngineeringEducationAnnualConferenceandExposition,1997.

[4]http://www.LabJack.com.

[5]Johnson,CurtisD.,ProcessControlInstrumentationTechnology,7thedition,PrenticeHall,2003,pp
148153.

[6]http://www.analog.com/UploadedFiles/Data_Sheets/39398238692761ADXL311_a.pdf

http://ijme.us/issues/fall2004/articles/DataAcquisitionPaper.htm

11/11