Measuring Capacitance....update
Archiver
Posts: 46,084
Sorry to bore you all to death but as an update I adjusted the
resistance to as high a value as possible to maximize the value
returned by RCTIME in the hopes of minimizing the effect of the
RCTIME resolution error. New calculated values for the 1000uF cap
were 905uF, much better.
I just wanted to share that with any other "geek" like me who might
be interested in measuring capacitors with their Basic Stamps.
Sincerely,
-Dave
--- In basicstamps@yahoogroups.com, "nuclearspin2000"
<nuclearspin2000@y...> wrote:
> Actually I believe I've come to a workable solution, although it
was
> anything but simple as I originally had suspected. A good value for
R
> for this circuit was about 100 ohms which should be enough to limit
> the Stamp pin current to a safe level when discharging the
capacitor,
> 50mA safe? I used the equation for a first order step response of
an
> RC circuit:
>
> Vc=Is*R+(Vo-Is*R)*e^(-t/RC)
>
> I replaced Is in my circuit with the Norton equivalent as dictated
by
> the equation and then solved for C.
>
> A simple RCTIME command then gives the charge time of the capacitor
> from 0 to 1.4V (threshold). Since everything else is known I can
then
> calculate C.
>
> By doing this I calculated a capacitance of 785uF for a 1000uF
marked
> cap. That's a little more than then stated plus or minus 20% error
> but there's probably some round off error going on not to mention
the
> resolution of the RCTIME command which could contribute as well.
>
> I like your idea of using the 555 timer, especially considering
> measuring larger caps would require lower resistances and result in
> higher currents through the Stamp pins using RCTIME. I'll try that
> next. Best regards,
>
> -Dave
>
>
> --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
> wrote:
> > Your points are valid and RCTIME not intended for large
capacitance
> > values; for the reason you state: to keep the discharge timing in
> range
> > your R value is way too low and you'll have problems. The whole
> point
> > of the 220 is to protect the Stamp pin from a direct short to
ground
> > where R should be.
> >
> > What you may want to do is use your cap in a 555 circuit and
> measure the
> > output with PULSIN.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: nuclearspin2000 [noparse][[/noparse]mailto:nuclearspin2000@y...]
> > Sent: Tuesday, January 06, 2004 8:08 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] Re: Measuring Capacitance
> >
> >
> > Hi Jon,
> >
> > I read through that thoroughly. But there are fundamental
problems
> > with Parallax's description of the circuits used in the examples
> from
> > the help file. As examples they present circuit A (preferred) and
> > circuit B. Circuit A has two variations, the first one is:
> >
> > Vdd=+5
> >
> > |
> > |
> > C
> > |
> > |---220---I/O pin (7)
> > R
> > |
> > |
> > Gnd
> >
> > Example code from the help file:
> >
> > result VAR Word ' Word to hold result
> >
> > Main:
> > HIGH 7 ' Discharge the cap
> > PAUSE 1 ' for 1 ms
> > RCTIME 7, 1, result ' Measure RC charge time
> > DEBUG ? result ' Show value on screen
> > END
> >
> > The problem is that the instruction HIGH 7 doesn't discharge the
> > capacitor as long as the suggested 220 ohm resistance is there.
The
> > voltage at the lower side of the cap is whatever the voltage drop
> > across R is when HIGH 7 is executed and it isn't +5V unless R is
> much
> > greater than 220 and then it's still an approximation.
> >
> > Omitting the 220 ohm resistor fixes the above problem and I've
done
> > this in the past but I'm trying to measure a capacitor marked as
> > 1000uF. After working out about a page of calculations I get that
R
> > must be no more than about 43 ohms to keep the time constant
small
> > enough so that the value returned by RCTIME falls within the
range
> > for my BS2SX which is no more than 52.43mS based on 65535*
(0.8uS),
> > and that's also assuming a natural response RC circuit, maybe
> that's
> > where I'm going wrong.
> >
> > Now if I omit the 220 ohm resistor and pull pin 7 high, the
current
> > flowing from the stamp pin is minimally 5V/43ohms=116mA and I fry
> my
> > stamp pin.
> >
> > Maybe I'm making this too complicated but it doesn't seem like it
> has
> > a simple solution to me. I guess I'll have to break out my
circuits
> > books.
> >
> > -Dave
> >
> >
> >
> >
> > --- In basicstamps@yahoogroups.com, "Jon Williams"
<jwilliams@p...>
> > wrote:
> > > Take a look at the Stamp RCTIME command.
> > >
> > > -- Jon Williams
> > > -- Applications Engineer, Parallax
> > > -- Dallas Office
> > >
> > >
> > >
Original Message
> > > From: nuclearspin2000 [noparse][[/noparse]mailto:nuclearspin2000@y...]
> > > Sent: Tuesday, January 06, 2004 6:57 PM
> > > To: basicstamps@yahoogroups.com
> > > Subject: [noparse][[/noparse]basicstamps] Measuring Capacitance
> > >
> > >
> > > Hi All,
> > >
> > > Can anyone direct me to an article or link that shows how to
> > measure
> > > capacitance using a Stamp? I just think it would be neat to try.
> > I'm
> > > familiar with the famous equation V(t)=Vo*e^(-t/tau). The
problem
> > is
> > > is after charging the capacitor to Vo, you then have to
disconnect
> > > the source so the cap starts to discharge through R, and start
an
> > > RCTIME command until the V(t) hits logic swing. I can't think
of
> > how
> > > to do these two things at precisely the same time. Thanks for
any
> > > help.
> > >
> > > -Dave
> > >
> > >
> > > To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > > from the same email address that you subscribed. Text in the
> > Subject
> > > and Body of the message will be ignored.
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > > To visit your group on the web, go to:
> > > http://groups.yahoo.com/group/basicstamps/
> > >
> > > To unsubscribe from this group, send an email to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > >
> > > Your use of Yahoo! Groups is subject to:
> > > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > > This message has been scanned by WebShield. Please report SPAM
to
> > > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject
> > and Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
resistance to as high a value as possible to maximize the value
returned by RCTIME in the hopes of minimizing the effect of the
RCTIME resolution error. New calculated values for the 1000uF cap
were 905uF, much better.
I just wanted to share that with any other "geek" like me who might
be interested in measuring capacitors with their Basic Stamps.
Sincerely,
-Dave
--- In basicstamps@yahoogroups.com, "nuclearspin2000"
<nuclearspin2000@y...> wrote:
> Actually I believe I've come to a workable solution, although it
was
> anything but simple as I originally had suspected. A good value for
R
> for this circuit was about 100 ohms which should be enough to limit
> the Stamp pin current to a safe level when discharging the
capacitor,
> 50mA safe? I used the equation for a first order step response of
an
> RC circuit:
>
> Vc=Is*R+(Vo-Is*R)*e^(-t/RC)
>
> I replaced Is in my circuit with the Norton equivalent as dictated
by
> the equation and then solved for C.
>
> A simple RCTIME command then gives the charge time of the capacitor
> from 0 to 1.4V (threshold). Since everything else is known I can
then
> calculate C.
>
> By doing this I calculated a capacitance of 785uF for a 1000uF
marked
> cap. That's a little more than then stated plus or minus 20% error
> but there's probably some round off error going on not to mention
the
> resolution of the RCTIME command which could contribute as well.
>
> I like your idea of using the 555 timer, especially considering
> measuring larger caps would require lower resistances and result in
> higher currents through the Stamp pins using RCTIME. I'll try that
> next. Best regards,
>
> -Dave
>
>
> --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
> wrote:
> > Your points are valid and RCTIME not intended for large
capacitance
> > values; for the reason you state: to keep the discharge timing in
> range
> > your R value is way too low and you'll have problems. The whole
> point
> > of the 220 is to protect the Stamp pin from a direct short to
ground
> > where R should be.
> >
> > What you may want to do is use your cap in a 555 circuit and
> measure the
> > output with PULSIN.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: nuclearspin2000 [noparse][[/noparse]mailto:nuclearspin2000@y...]
> > Sent: Tuesday, January 06, 2004 8:08 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] Re: Measuring Capacitance
> >
> >
> > Hi Jon,
> >
> > I read through that thoroughly. But there are fundamental
problems
> > with Parallax's description of the circuits used in the examples
> from
> > the help file. As examples they present circuit A (preferred) and
> > circuit B. Circuit A has two variations, the first one is:
> >
> > Vdd=+5
> >
> > |
> > |
> > C
> > |
> > |---220---I/O pin (7)
> > R
> > |
> > |
> > Gnd
> >
> > Example code from the help file:
> >
> > result VAR Word ' Word to hold result
> >
> > Main:
> > HIGH 7 ' Discharge the cap
> > PAUSE 1 ' for 1 ms
> > RCTIME 7, 1, result ' Measure RC charge time
> > DEBUG ? result ' Show value on screen
> > END
> >
> > The problem is that the instruction HIGH 7 doesn't discharge the
> > capacitor as long as the suggested 220 ohm resistance is there.
The
> > voltage at the lower side of the cap is whatever the voltage drop
> > across R is when HIGH 7 is executed and it isn't +5V unless R is
> much
> > greater than 220 and then it's still an approximation.
> >
> > Omitting the 220 ohm resistor fixes the above problem and I've
done
> > this in the past but I'm trying to measure a capacitor marked as
> > 1000uF. After working out about a page of calculations I get that
R
> > must be no more than about 43 ohms to keep the time constant
small
> > enough so that the value returned by RCTIME falls within the
range
> > for my BS2SX which is no more than 52.43mS based on 65535*
(0.8uS),
> > and that's also assuming a natural response RC circuit, maybe
> that's
> > where I'm going wrong.
> >
> > Now if I omit the 220 ohm resistor and pull pin 7 high, the
current
> > flowing from the stamp pin is minimally 5V/43ohms=116mA and I fry
> my
> > stamp pin.
> >
> > Maybe I'm making this too complicated but it doesn't seem like it
> has
> > a simple solution to me. I guess I'll have to break out my
circuits
> > books.
> >
> > -Dave
> >
> >
> >
> >
> > --- In basicstamps@yahoogroups.com, "Jon Williams"
<jwilliams@p...>
> > wrote:
> > > Take a look at the Stamp RCTIME command.
> > >
> > > -- Jon Williams
> > > -- Applications Engineer, Parallax
> > > -- Dallas Office
> > >
> > >
> > >
Original Message
> > > From: nuclearspin2000 [noparse][[/noparse]mailto:nuclearspin2000@y...]
> > > Sent: Tuesday, January 06, 2004 6:57 PM
> > > To: basicstamps@yahoogroups.com
> > > Subject: [noparse][[/noparse]basicstamps] Measuring Capacitance
> > >
> > >
> > > Hi All,
> > >
> > > Can anyone direct me to an article or link that shows how to
> > measure
> > > capacitance using a Stamp? I just think it would be neat to try.
> > I'm
> > > familiar with the famous equation V(t)=Vo*e^(-t/tau). The
problem
> > is
> > > is after charging the capacitor to Vo, you then have to
disconnect
> > > the source so the cap starts to discharge through R, and start
an
> > > RCTIME command until the V(t) hits logic swing. I can't think
of
> > how
> > > to do these two things at precisely the same time. Thanks for
any
> > > help.
> > >
> > > -Dave
> > >
> > >
> > > To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > > from the same email address that you subscribed. Text in the
> > Subject
> > > and Body of the message will be ignored.
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > > To visit your group on the web, go to:
> > > http://groups.yahoo.com/group/basicstamps/
> > >
> > > To unsubscribe from this group, send an email to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > >
> > > Your use of Yahoo! Groups is subject to:
> > > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > > This message has been scanned by WebShield. Please report SPAM
to
> > > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject
> > and Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
Comments
STAMP .
But i do think you would be able to discharge the " cap under test " .
With a "power transistor " or transistor driven relay . With a STAMP
output pin .
So after the cap is discharged bring this pin low .
Then with a second STAMP pin at the "output " of the discharge
circuit & " cap ".
You can watch the charge - ramp with the RC function .
And maybe use several discharge relays with different value
resistors between between the
relays outputs and the cap under test - start with a " high " value .
and a short pause check for a " high or low " . If it is still
high because the cap under test is a very large
value then you can use a discharge relay & resistor of a lower
value . So you might be able to add a
" auto - range " to be able to test both small - mid - large
value caps
Good luck
>
>