Shop OBEX P1 Docs P2 Docs Learn Events
Monitoring power supply voltage — Parallax Forums

Monitoring power supply voltage

ArchiverArchiver Posts: 46,084
edited 2001-05-06 19:41 in General Discussion
Hello all. Does anyone have any experience with monitoring the power
supply that is powering the STAMP? I would like to hook an AD
converter up to the power supply so that I can determine if the
battery is good, dead or needs replacing. Is the ADC overkill? Could
I just use a cap, resistor and RCTime?

Thanks in advance,

--Jeff

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-05-05 09:22
    Jeff
    Look at
    http://www.emesystems.com
    This site, from Tracy Allen, is a gold mine of tips and tricks for the Basic
    stamp.
    It is a "must be seen" for all serious Basic stamp users.
    Note that I have no relation with Tracy Allen but I use this message to thank
    him
    for the very interesting site.
    Regards
    ECO

    Original Message
    From: <bs2web@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: samedi 5 mai 2001 09:21
    Subject: [noparse][[/noparse]basicstamps] Monitoring power supply voltage


    > Hello all. Does anyone have any experience with monitoring the power
    > supply that is powering the STAMP? I would like to hook an AD
    > converter up to the power supply so that I can determine if the
    > battery is good, dead or needs replacing. Is the ADC overkill? Could
    > I just use a cap, resistor and RCTime?
    >
    > Thanks in advance,
    >
    > --Jeff
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-05 14:52
    You don't really need much to do this, depending on how fancy you want to
    get. The Stamp has a certain threshold on its logic pins (I think it is
    about 2.4V on the regular Stamp -- you can test it to be sure). Below the
    threshold is a 0, above is a 1.

    So say you have a 9V battery and you want to know when it gets to 7V. You
    could arrange a voltage divider so that 7 --> 2.4

    That's 34.29% (about). So if you put a 10K resistor between the pin and
    ground, you'd need a 19.156K resistor between 9V and the pin. Say you use a
    20K resistor since you won't find 19.156 in your junk box.

    At 9V that would give you 3V -- enough for a solid 1 reading.
    At 7V that would give you 2.3V - A zero.

    So you'd get a zero somewhere just above 7V. You could juggle the resistor
    values around to get whatever threshold you wanted. A pot is infinitely
    variable, but they aren't very temperature stable necessarily. 1% resistors
    would be better -- depends on how crucial things are.

    If the 10K resistor is R2 and the 20K resistor is R1 then:

    Vout = Vin*R2/(R1+R2)

    Why? Assume the Stamp pin has no impedance (its resistance is much higher
    than R1 and R2). Then the current flowing through the resistors must be:

    Itotal = Vin/(R1+R2)

    And the voltage seen on the pin is the voltage across R2 (which is grounded
    on one end). So:

    Vpin = R2 * Itotal

    or

    Vpin = R2 * Vin / (R1+R2)

    But it is customary to write the resistors together to form a ratio:
    R2/(R1+R2) and then multiply the ratio by Vin. Math-wise this is the same
    answer either way (12*3/6 = 3*12/6)

    More on things like this at http://www.al-williams.com/wd5gnr/basiccir.htm


    One thing to look for is that you might get a "bouncing" between 1 and 0
    right at the threshold. You could clean this up in software. Or you could
    use a comparator with hysterisis. You'd set up another divider to get your
    threshold voltage using 5V (which is regulated) and compare the two
    voltages. Because of the hysterisis, you wouldn't get the bounce. You could
    also design your input divider so that the low voltage point was at 5V and
    compare to your regulated supply directly.

    You could use an A/D. You could also use the charge rate of a cap, although
    really that's the same thing as the voltage divider (measurement against
    your threshold) so I don't know what the benefit would be.

    Regards,

    Al Williams
    AWC
    *Mention Code M7SHIP on or before May 7 2001 and get FREE standard US
    shipping on any order! http://www.al-williams.com/awce/




    >
    Original Message
    > From: bs2web@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=-J4NnP-PbCLd0345pN8C0sE8ng5kaQc44JRVd8ydJWmR76hPab136sdC8MwFyD7TY0-S3k4yEQ]bs2web@y...[/url
    > Sent: Saturday, May 05, 2001 2:21 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Monitoring power supply voltage
    >
    >
    > Hello all. Does anyone have any experience with monitoring the power
    > supply that is powering the STAMP? I would like to hook an AD
    > converter up to the power supply so that I can determine if the
    > battery is good, dead or needs replacing. Is the ADC overkill? Could
    > I just use a cap, resistor and RCTime?
    >
    > Thanks in advance,
    >
    > --Jeff
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-05 18:09
    Thanks for the complement, ECO. Jeff, th article about using RCtime
    to measure the battery voltage can be found at
    http://www.emesystems.com/BS2rct.htm

    >Jeff
    >Look at
    > http://www.emesystems.com
    >This site, from Tracy Allen, is a gold mine of tips and tricks for
    >the Basic stamp.
    >It is a "must be seen" for all serious Basic stamp users.
    >Note that I have no relation with Tracy Allen but I use this message
    >to thank him
    >for the very interesting site.
    >Regards
    >ECO
    >
    >
    > > Hello all. Does anyone have any experience with monitoring the power
    > > supply that is powering the STAMP? I would like to hook an AD
    > > converter up to the power supply so that I can determine if the
    > > battery is good, dead or needs replacing. Is the ADC overkill? Could
    > > I just use a cap, resistor and RCTime?
    > > Thanks in advance,
    > > --Jeff
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-05 19:06
    Hi All,

    I've been wondering myself how best to monitor the input voltage to the
    stamp. The RC time example on Tracy's site works very well(surprise!). One
    thing that has been bothering me about using RCtime or a simple voltage
    divider is that it seems it will increase the current requirements of the
    project?. I've just finished trying out using a transistor to switch the
    voltage to the voltage divider on and off. This gets me back to the nominal
    sleep current of around 25 microamps. This seems to work well, when taking
    into account the voltage drop from the transistor. The voltage drop from
    the transistor will change slightly due to temperature, but maybe not
    enough to significantly change the incoming voltage to the voltage divider?

    What I'm trying to say is, how best to measure the stamps input voltage,
    without increasing the current consumption while the stamp is sleeping?

    Thanks

    ---Steve





    At 10:09 AM 05/05/2001 -0700, you wrote:
    >Thanks for the complement, ECO. Jeff, th article about using RCtime
    >to measure the battery voltage can be found at
    > http://www.emesystems.com/BS2rct.htm
    >
    >>Jeff
    >>Look at
    >> http://www.emesystems.com
    >>This site, from Tracy Allen, is a gold mine of tips and tricks for
    >>the Basic stamp.
    >>It is a "must be seen" for all serious Basic stamp users.
    >>Note that I have no relation with Tracy Allen but I use this message
    >>to thank him
    >>for the very interesting site.
    >>Regards
    >>ECO
    >>
    >>
    >> > Hello all. Does anyone have any experience with monitoring the power
    >> > supply that is powering the STAMP? I would like to hook an AD
    >> > converter up to the power supply so that I can determine if the
    >> > battery is good, dead or needs replacing. Is the ADC overkill? Could
    >> > I just use a cap, resistor and RCTime?
    >> > Thanks in advance,
    >> > --Jeff
    >
    >
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-06 19:41
    At 1:06 PM -0500 5/5/01, sargent@s... wrote:
    >I've been wondering myself how best to monitor the input voltage to the
    >stamp. The RC time example on Tracy's site works very well(surprise!). One
    >thing that has been bothering me about using RCtime or a simple voltage
    >divider is that it seems it will increase the current requirements of the
    >project?. I've just finished trying out using a transistor to switch the
    >voltage to the voltage divider on and off. This gets me back to the nominal
    >sleep current of around 25 microamps.
    >...
    >What I'm trying to say is, how best to measure the stamps input voltage,
    >without increasing the current consumption while the stamp is sleeping?
    > > http://www.emesystems.com/BS2rct.htm

    The example at the above URL shows a 100kohm resistor and 0.068uf
    capacitor as the timing components.

    Increase the resistor to 1 megaohm (1% film resistor) and decrease
    the capacitor to 0.0068uf, and the timing will be the same. And
    current "lost" will be reduced to 7 microamps. (assuming a 12.0 volt
    battery and that the RCtime pin is turned around to be an INPUT or a
    HIGH OUTPUT before your program hits the SLEEP command. [noparse][[/noparse]12-5]/1M =
    7 u-amps)

    I think the following is also true. I would have to check it again
    to see if I am remembering right. The 7 microamps actually is _not
    lost_. If the pin is a high output or an input, that current flows
    directly into the Vdd power supply and actually decreases the current
    that has to be supplied by the 5 volt regulator. So the sum total
    stays at 25 microamps.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
Sign In or Register to comment.