Shop OBEX P1 Docs P2 Docs Learn Events
Low Power — Parallax Forums

Low Power

KitmanKitman Posts: 7
edited 2008-12-01 17:20 in BASIC Stamp
·HI, I was wondering how you would be able to tell when your robot is low on power.· I would like the robot·to flash an LED when the power source is low.·
··· Also, how could I switch to a new power source without the program restarting.· I·am making a long program and I want to be able to switch power sources without starting the program over.· I don't know if either of these things are possible, but if they are I would love your input.· Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-30 22:11
    Look on this website for suggestions for reading battery voltage using an RCTIME statement (www.emesystems.com using the app-notes link).

    You can automatically switch power sources by using a diode (preferably Schottky diodes because of their low voltage drop) from each power source to the robot. Whichever power source has the highest voltage will supply power to the robot automatically.
  • KitmanKitman Posts: 7
    edited 2008-11-30 22:22
    Thanks.· Would you connect·the diode·to the negative or postive side of the battery?

    Post Edited (Kitman) : 11/30/2008 10:28:23 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-30 22:26
    You could use either the negative or positive side, but using the positive side keeps all the grounds at the same potential.
    The two cathodes of the diodes are connected together and to the robot. Each anode is connected to a (+) battery terminal.
  • KitmanKitman Posts: 7
    edited 2008-11-30 22:49
    Thanks for your help!
  • UghaUgha Posts: 543
    edited 2008-12-01 01:24
    What would happen if you replaced the diode with an LED?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-01 02:27
    LEDs are not great diodes. They have a high forward voltage (1.7V to as much as 3.7V depending on the diode construction), a relatively high reverse leakage current and low reverse breakdown voltage. For this application, you want as low a forward voltage as possible (which is why Schottky diodes are good for this), a low reverse leakage current and high reverse breakdown voltage.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-01 03:51
    Mike Green said...
    For this application, you want as low a forward voltage as possible (which is why Schottky diodes are good for this), a low reverse leakage current and high reverse breakdown voltage.
    Hi, Mike --

    I'm curious about your reasoning.· I wouldn't consider any of these characteristics particularly important for this application.· Here's why, but I'm open to ideas, because your ideas are usually pretty good.

    Forward voltage:· a difference in forward drop of, say, 1/4 volt wouldn't make much difference in the length of time the Stamp could run on battery, I think.· Also, I'd just as soon dissipate a little of the waste power in the diode instead of the Stamp.· I might even use two diodes in series for just this reason.

    Low reverse leakage:· Even several tens of microamperes would be negligible, wouldn't you say? -- and that's a LOT of reverse leakage.· What happens if you have a lot of reverse leakage?· A little current will leak from the better battery into the worse one.· What would be the result?· At, say, ten volts remaining in the dead battery,·and 10 microamperes leakage into it, you'd lose 100 microwatts to heating the dead one.· Utterly harmless.·

    High reverse breakdown voltage:· it needs to be safe when one battery is totally dead, or shorted, and the other is fresh.· Say, twenty volts, for a good safety margin.·

    I have to say I don't like this whole scheme anyway.· Why?· There's no intelligent switching between the two batteries.· They'll both just run down simultaneously, and the eventual failure, while it will occur after a longer time, will still be sudden, without warning.· If I were designing it, I'd try to·run the first battery all the way down, then switch to the second battery, and I'd like an indicator to tell me when either battery was dead (so I could replace it before the equipment stopped working).· I think I could do it with a comparator, two transistors, and three resistors for the switching.· You could do it with two resistors, but a third lets you introduce controlled hysteresis into the comparator.

    Or two A/D converters, some resistors, two transistors, and a Stamp pin or two to let the Stamp make the decision and do the notificatiion.· Then you don't need the diodes or comparators.· More fun that way, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2008-12-01 04:59
    The nice thing about diode switching is that it's practically foolproof, instantaneous, low power and super simple. Sometimes that extra quarter volt does make a difference, especially when the system current demand fluctuates from microamps to amps.. Say, it is a system that has to operate from a solar panel and with a battery charge from 10.5 volts to 14.2 volts and with a minimum of 10.0. On the other hand, if it is a 5 volt system operating from a 9 or 12 volt supplies, the choice of diode won't matter much.

    Schottky diodes have considerable reverse leakage current (comes with the low bandgap voltage of 0.2 or 0.3 volts), but it is true that the leakage is usually not a big factor, a few microamps at most. Usually the backup battery will have a lower voltage than the main battery, so it will only come into play at the end of life of the main battery and allow enough time for a replacement. Some backup batteries such as lithium primary cells are intolerant of leakage current coming into the battery.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SRLMSRLM Posts: 5,045
    edited 2008-12-01 05:39
    Parallax sells a module that detects low voltage (4.2 volts if I remember right). I'm not sure how to hook it up, but I'm guessing it's a simple high/low pin state.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-01 06:10
    SRLM,
    The module you're referring to is a brownout detector. This is basically a comparator with hysteresis for a fixed threshold that has an open drain/open collector output. It's used to hold a microprocessor (or other chip) in reset when the supply voltage is too low for reliable operation

    Carl,
    I was thinking in terms of Tracy's first sentence. You're probably right in that a regular silicon diode would work fine for the primary supply, but a Shottky diode might still be better for the backup supply. Best arrangement would be a 7.2V NiMH battery pack for the primary supply and a 6V alkaline battery pack for the backup supply. The primary supply would have to be pretty exhausted by the time the backup supply kicked in. I agree that there are some nice switchover circuits with only a few parts needed, but the diode switching is very simple and reliable. For reverse leakage, I was thinking in terms of tens of microAmps max. For reverse breakdown voltage, I was thinking of all of 30-50V.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-01 13:42
    Thanks, Mike & Tracy.· There is merit in what you say, especially if the main & backup batteries are dissimilar.· Diode switching is certainly simple, and simplicity is a major virtue -- but I'd still rather have actual switching instead of simultaneous exhaustion.
    ·
    I was thinking in terms of identical batteries.· In fact I had assumed that, which is a major error since Kitman never said anything of the kind.· Anyway, if the batteries are identical, rather than use diodes I'd probably just hook them in parallel (this is often done)·without any diodes at all -- unless, as Tracy points out, they're lithiums, which I had neglected to consider.· Incidentally, last night I measured the leakage at 9.11v of several 1N4001 of different manufacture.· Each was less than 10 microamps even when slightly warmed by a propane torch.· Amazing -- I didn't burn any of them up with the torch.

    It might be sufficient to have just an indicator (perhaps a Schmitt trigger or comparator lighting an LED when the battery is low), along with a shorting SPDT switch.· By "shorting" I mean a switch that closes the second connection before before opening the first -- a little harder to find, but not uncommon.· If the LED glows, you throw the switch, then change the dead battery.· The momentary connection between the exhausted battery and the new one will do no harm.· Of course, my luck would be that I'd goof up and unplug the one I'm running on, thus killing my power.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-12-01 16:06
    If the batteries are identical, and you hook them in parallel, you'll get simultaneous exhaustion, which is what you said you didn't want.

    Usually, I've seen a diode used when an AC line is coupled with a battery -- when AC is on, the diode prevents the battery from charging (or exploding, for that matter). When AC is off, the diode lets the battery power the circuit. This application of the diode is used for AC outage battery backup, where in "normal" circumstances the AC derived DC voltage powers the circuit.

    If the situation is using two diodes for two battery packs, then you're right, I would want something more 'positive' than a simple diode-OR circuit, which again would lead to simultaneous exhaustion.

    I like your idea of the "shorting SPDT switch".
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-01 17:20
    Well, yes, of course.· What I meant was that since the diodes wouldn't prevent simultaneous exhaustion, I see little reason to use them.

    With rechargeable batteries I often parallel them with well-regulated AC-fed supplies, and no isolating diodes at all.· I adjust the regulator in the supply so that it serves as a float charger to keep the backup charged but not overcharged.· With 12v automotive batteries, for example, I use little Lambda supplies, carefully set to 13.5 volts.

    One must be careful, though.· With some Lambdas, for example, you've got to have a diode in series with the supply, though none on the battery.· Some large Lambdas have automatic crowbars that short the output when you turn the supply off.· I once had a 13.5v 75-ampere Lambda produce amazing fireworks on being turned off -- I had been floating it across an automotive battery.· The effect would do credit to an artillery barrage.· That was an expensive error.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net

    Post Edited (Carl Hayes) : 12/1/2008 5:33:59 PM GMT
Sign In or Register to comment.