Sie sind auf Seite 1von 9

print|close

UseAnalogTechniquesToMeasureCapacitanceInCapacitive
Sensors
ElectronicDesign

MartinTomasz
Tue,2012111309:56

Capacitivesensorsarefoundinawiderangeofequipment,fromconsumerelectronicstoindustrial/process
control.Touchbuttonsareincreasinglyfoundinlampsanddimmers.Motiondetectorscandetectminiscule
changesindeflection.Hygrometersindicatehumiditychanges.Pressuresensorsandaccelerometersare
movingtowardcapacitivesensing.And,capacitivedisplacementsensorsareevenfoundindiskdrives.
Thesesensorsproduceanoutput:capacitance.Measuringthiscapacitanceisaninherentlyanalogproblem
thatcanbeverytricky.Often,thesesensorsprovidethemosttroubleforengineerstointerfaceto
microcontrollers.Whilesomemicrocontrollersofferbuiltinsimpleroutinesforcapacitivetouchbuttons,
theirmeasurementsarerelativelycrudeanddesignedformeasuringachangeincapacitanceusefulfor
detectingafingerplacedonatouchsensor,butnotforindustrialanddisplacementsensingrequiring
absoluteaccuracy.
Related
SensorFusionOrSensorConfusion?
AnalogsRoleKeepsGrowingInTheDigitalWorld
TheEvolutionOfSensorAnalogFrontEnds

CapacitiveSensors
Asaspecificexampleofacapacitivesensor,consideracapacitiverelativehumidity(RH)sensor.Inthistype
ofsensor,thedielectricmaterialisdesignedtoabsorbwatervaporfromtheexternalenvironmentwhen
exposed.Theelectricalcapacitanceincreasesasthedielectricabsorbswater,sincethedielectriccoefficient
increaseswithincreasedmoistureadirectindicationoftherelativehumidity.Thenetdielectriccoefficient
isalsosensitivetotemperaturevariations,sothehumiditycalculationinvolvesbothameasurementof
capacitanceandtemperature.
Humiditysensorsexhibitarelativelysmallchangeincapacitanceovertheiroutputrange.Acapacitance
changeof40to50pFover0%to100%RHwitha0%RHcapacitance(C0RH)of100to200pFisnot
uncommon.Atypicalsensoroffering3%absoluteaccuracy(with1%repeatability)correspondstoa
resolutionrequirementof1.5pF.
Somecapacitivesensorsmeasuredisplacement.Intheirsimplestform,thesesensorsareconstructedwith
precisionmetalplatesincloseproximity,andanelectricfieldismaintainedbetweenthem.Theresulting
outputcapacitance(usuallysmall,inthe10pFrange)dependswidelyonthegeometryofthesesensors.

TimerApproaches
Themostcommonapproachtomeasuringcapacitivesensorsissimplytouseananalogtimercircuitto
generateafrequencythatisinverselyproportionaltocapacitanceandthenutilizeamicrocontrollertocount
pulseswithinagivenperiodtocalculatethefrequency(Fig.1).Thus,thereisnorequirementforananalog
todigitalconverter(ADC)orcomparatorinthemicrocontroller.Thebasicequationrelatingthemeasured
capacitorCandfrequencyFis:
F=1/(C*(R1+2*R2)*ln2)

1.Digitizingthevalueofacapacitivecensorofteninvolvesgeneratingafrequencythatisinversely
proportionaltothecapacitanceandcountingpulsesoverafixedperiodtodeterminethefrequency.
Astabletimers,suchastheclassic555,operatebycharginganddischargingacapacitor.Thecapacitor
voltagetriggersthechargeanddischargecyclesasittransitionsacrossalowerandupperthreshold.Despite
specificationstoutinghigherthan1MHzoperation,typicalCMOS555sliketooperateinthe5to10kHz
rangeforbestaccuracy(Fig.2).


2.Theschematic(a)illustratespassiveandactivecompensationmethods:CX=4pF.Foranactiveshield,a
remotelylocatedcapacitorisconnectedtothetimeracross12in.ofRG316shieldedcable(29.4pF/ft).The
plotsshowmeasuredresultsfornocompensation,passivecompensation,andactiveshieldconditions.

Thetableshowssomebasiclimitationsinthesecircuits.ErrorA,thefirst,showsthatafewpicofaradsof
inputcapacitanceexistontheTHandTRpins.Sincethisistheconnectionpointforthecapacitormeasured,
thisparasiticcapacitance(alongwiththestraycapacitanceshowninrowFinthetable)addserroneouslyto
themeasuredcapacitorvalue.Forcapacitancemeasurementsabove100pF,thiscanbeaccountedby
characterizationandsubsequentaccountingwhenarrivingatthecapacitancevalue.(Forlowercapacitance
values,seethediscussionbelow.)

ComparatortimingdelaysandafinitedischargeFETonresistance(BandC,respectively)settheupper
frequencyboundforoperation.Farbelowthesespeeds,errorscreepinfromthevariabilityofthese
parameters,makingthemhardtocalibrateout.Forexample,thereisastrongtemperaturedependencefor
thedischargeFETonresistanceandaVDDdependencyforcomparatordelay.

MeasuringLowCapacitanceValues
Tomeasuresmallercapacitancevalues,theeffectsofTHandTRpininputcapacitancecanbecompensated
(electronicallysubtracted).Twomethodsincludepassiveandactivecompensation.
Passivecompensationinvolvesconnectingcompensationcapacitorstocreateachargepumptonullthe
effectofpininputcapacitance.TheQ(output)pinswingsatahigherlevelthanthecapacitorvoltageramp,
sostrappingacapacitorfromQtoTHandTReffectivelytransfersnetcoulombsintothemeasured
capacitor.AsCandQareinverselyrelated,thisequalsanegativecapacitance,asseenbycalculatingthetotal

chargeQaccumulatedonthemeasuredcapacitorCforagivenchargingcycle:
Nocompensation:
Q=C*1/3*VCC
Withcompensation:
Q=(C+Cx)*1/3*VCCCX*VCC
Q=(C2*Cx)*1/3*VCC
So,tofirstorder,2*CXcapacitanceissubtractedfromC(assumingCX<<C).
Avoltagestepwillbeseenonthemeasurementcapacitorfromchargetransfer.Thisdoesntaffecttimer
operationadversely.Itsimplyshowschargeaddedandsubtractedtocompensatefortheaddedparasiticpin
capacitance.Sincecapacitanceatdcalsoaffectstheoutput,asmallcapacitorisaddedtheretoo.
AchoiceofCX=4pFwasfoundempiricallytobeacceptable.Asecondcapacitor,CY(notshown),wasalso
addedtocompensatetheinputcapacitanceatdc.
Activecompensationrequiresanopampandcanresultinamoreprecise,adjustablecompensation.Anop
ampsoutputisconnectedtothecompensationcapacitorCX,drivingitinconcertwiththecapacitors
voltageramp.(Besuretouseastableopampdrivingthiscapacitance!)ByvaryingthegainGoftheopamp,
andthustheamplitudeoftheramp,youcanvarytheamountofcompensationcapacitancetosubtract,
accordingto:
Ceq =CCX(G1)
Alternatively,ahybridofpassiveandactivecompensationcanbeimplemented,whichsavesthecostofthe
opampwhileretainingadjustability.Avariableamplitudecomparatorcanbeutilized,withanadjustmentto
theamplitudeofthesquarewavemadebyadjustingthevoltageofalinearregulator.

RemoteSensing
Sometimesitsnotpossibletocolocatethesensorandthemeasurementelectronics.Thecapacitance
measuredcanbeplacedsomedistanceawayfromthemeasurementelectronics.Butunknowncapacitances
togroundalongthewiredpathofthecapacitorwilladdandsubtractfromthemeasuredcapacitancevalue
inthiscase,especiallyifitscabled.
Theimpedancesdrivingthecapacitoraregenerallyhigh(>500k),andlongwirelengthscanpickup
electricfieldsandinducespuriousvoltages(especiallyfrom60Hzacmains).Shieldingthecablecanhelp,
butthisnaturallycreatesadditionalcapacitancesthatvaryaccordingtocablelength,addingtothe
capacitancemeasurementerrors.
Thesolutionisanactiveshield,drivenbyanopamptodynamicallyservotheshieldtothesamevoltageas
thecapacitorvoltage,nullingthecapacitancefromshieldtocapacitorvoltage.Thisremotecapacitor
solutionessentiallyrequiresthreeconnections:shield,capacitorvoltage,andaseparatewiredground
return.Theprincipleissimilartotheactivepincapacitancecompensationdescribedearlier.Theshieldcan
alsobedrivenwithagainslightlyhigherthan1toadditionallycompensateforpincapacitance,thoughthe

chosengainwillnecessarilyneedtochangewithdifferentcablelengths(Fig.3).

3.TouchstoneSemiconductorsTS3002timerICisa555typedevicethatoperatesdownto2V.
TheTouchstoneTS3002advancedtimerICisoptimizedaroundasmalltimingcapacitor(<10pF).It
includesonchippincapacitancecompensationandwasdesignedtoworkatverylowpower
lessthan1A,
1.8Vsupply,butoperatingtoaslowas0.9V.Thelowcapacitorchargingcurrentsassociatedwiththe
TS3002makethisICbestforlowspeedmeasurementswithaveraging(Fig.4).


4.Otherapproachessuchasachargebalancingscheme(a)andasimplifiedcapacitivebridge(b)can
measurecapacitancemorequickly.

MeasurementSpeedAndAccuracy
Themeasurementspeedofthesecapacitancetofrequencysystemsisdeterminedbythetimeittakesto
countthenumberofclockcyclescorrespondingtothecapacitancevalue.Accuracytofirstorderis
determinedbythenumberofcyclescounted.Sincecapacitanceisinverselyproportionaltofrequency,given
afixedmeasurementtime,theschemesnaturallyprovidethehighestbitresolutionforthelowest
capacitancevaluesinagivenrange.Thisisnotnecessarilythedesiredresult,sincethelowestcapacitance
valueswillhavethehighestanalogerrors.
Alternatively,utilizingafastmicrocontrollerclocktodeterminethetimersperiodprovidesahigher
resolutionforhighercapacitancevalues.(A24MHzsystemclockcanresolvea14bitvaluefor1kHz,inthe
1nFrange.)Insomemicrocontrollers,thishigherfrequencyclockoperateswithhigheraccuracythanthe
lowerfrequencyclocks.
Noiseinthemeasurementwilllikelydrivethemeasurementtimeandaveraginglengths.Frequencynoisein
thetimersisprimarilygeneratedbythecomparatorstimingjitter.Thisjitterincreasesasapercentageas
theperiodfrequencydecreases,makingsmallcapacitorvaluemeasurementsnoisier.

FasterApproaches
Afewotherapproachesareworthmentioning,someofwhichyieldfasterresults(Fig.5).


5.Inthisopampbasedcapacitormeasurementcircuit,theopampisdriveninanastablefashion,triggering
ahystereticcomparatortoswitchingthepolarityattwothresholds.Likethetimercircuit,thiscircuitoffers
averysimplerelationshipbetweenCandF:F=34*R1*C.
Inthechargebalancingscheme,areferencecapacitorischargedtoaknownvoltageandthendischarged
acrossthemeasuredcapacitor.Besidestheproblemofprovidingareferencecapacitor,therearetwomajor
problemswiththismethod.
First,theswitchitselfinjectschargeintothecircuit,affectingtheresult.Eventheverybestanalogswitches
exhibitatleast1pCofchargeinjection,limitingtheschemetohighermeasuredcapacitorvalues.Second,
thebufferopampmusthaveextremelylowleakage.For1nFcapacitormeasurement,10nAleakagedrops
thevoltageonthemeasurementcapacitorby1mVwithin100s.
Capacitivebridgemethodsinvolveinjectingaknownexcitationfrequencyintoacapacitivebridge(often
simplyanRCnetwork)andcomparingtheresultingresponsewithareferencepath.Atruebridgecircuit
wouldinvolvetwoRCarmsinthebridgewithanullingschemeutilizingadjustablecapacitors.
ThereferencepathhereisasimpleresistivedividerandservesasthereferenceforaratiometricADC
measurement,consideredamorepracticalmethod.TheschemerequiresafastADCtoconvertthe
amplitudeoftheRCnetworkandtodeducethemeasuredcapacitorvalue.TheADCmustbefast,andsome

signalprocessingmaybeinvolvedinthemeasurement.Extremecarealsomustbetakentolimittheloading
(capacitiveandresistive)onthemeasuredcapacitor.

OpAmpIntegratorMethods
Opampintegratorbasedcapacitormeasurementschemesdriveprecisioncurrentsintothecapacitor,
determiningcapacitancebyassessingintegrationtime.Aprecisionresistor(goodabsolutetoleranceis
required),anopamp,andpotentiallyacomparator(toturntheintegratorintoanastableoscillator)are
requiredtogeneratethemeasurementcurrenttofeedthecapacitor.However,somebenefitsmayoutweigh
theextracomponentsovertimerbasedsystems.
Thecircuitessentiallydrivesonesideofthecapacitorwhilemaintainingavirtualgroundattheotherside.
Thebenefitsofavirtualgroundaretwofold.First,theopampsinputpincapacitancenolongeraffectsthe
measurements,sincethisnoderemainsatground.Second,thecapacitornowcanbemeasuredremotely
withoutanactivelydrivenshield(theshieldcanremainatgroundpotential),relievingtherequirementfor
anopampcapableoffollowingthetimerrampanddrivinghighcapacitance.
Figure5showsanexamplecircuitforthisapproach,utilizinganopampandcomparator.Here,theopamp
isdriveninanastablefashion,triggeringahystereticcomparatortoswitchingthepolarityattwo
thresholds.Likethetimercircuit,thiscircuitoffersaverysimplerelationshipbetweenCandF:
F=34*R1*C
TheTouchstoneTS12011nanopoweropamp/comparator/referenceICisusedheresinceitoffersbotha
comparatorandanopampinasinglepackage.Additionally,theentirecircuitrunsatlessthan5A(froma
1.8Vsupply)andcanrunfromsupplyvoltagesaslowas1V.Thecircuitisbestusedformeasuring
capacitancesfrom1nFandhigher,sincetheresultingfrequencyoutputiswellwithinthebandwidthofthe
opamp,andthevariationinthecomparatordelaysaddsasmallerrortotheresult.
Forlowervaluecapacitancemeasurement,ahigherbandwidthopampwouldbeappropriate,togetherwith
afastercomparator.Tokeepthefrequenciesrelativelylow,minimizingtimingdelaybasederrors,low
leakageinputopampssuchasJFETinputopampsarebest.

Conclusion
Thereareseveralwaystomeasurecapacitivesensors.Withsomecarefuldesignandinappropriate
capacitanceranges,traditionaltimercircuitsmaysuffice.Forlowcapacitancevaluesandhighaccuracy,
otheroptionssuchasintegratorbaseddesignsmayneedconsideration.
SourceURL:http://electronicdesign.com/analog/useanalogtechniquesmeasurecapacitance
capacitivesensors

Das könnte Ihnen auch gefallen