Shop OBEX P1 Docs P2 Docs Learn Events
Propeller auto power-off circuit - help please! — Parallax Forums

Propeller auto power-off circuit - help please!

wmosscropwmosscrop Posts: 409
edited 2011-01-07 10:22 in Propeller 1
I'm looking for a way to implement power management so that the propeller can turn off the power to a device (and itself), not just go into low-power mode.

My device will be using a 9v battery for power. In order to maximize the life of the battery, I would like to have a circuit that:
* Uses no (ideal) or very little power (ok) when off.
* Turns on when a button is pressed (this button is not connected to the propeller and serves only as a power on request)
* Stays on until turned off by the propeller sending an appropriate (low or high) signal via an I/O pin.

Thanks!

Walter Mosscrop

Comments

  • pacmanpacman Posts: 327
    edited 2011-01-03 21:26
    Do some reseach into "latching relay"

    I have used some in the past and they solved this problem beautifully..

    HTH
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-03 21:36
    I think Beau Schwabe posted such a circuit, but I don't have a link to it. It might be someone else though. He had originally posted a Stamp version (for 5V), then revised it for the Propeller. It does exactly what you want ... allows the Propeller to turn itself (and other circuitry) off with a separate pushbutton turning everything back on again. The "off" current drain is on the order of nanoAmps.
  • Miner_with_a_PICMiner_with_a_PIC Posts: 123
    edited 2011-01-03 21:43
    This might be the link Mike is referring to >>

    http://forums.parallax.com/showpost.php?p=730860&postcount=7
  • wmosscropwmosscrop Posts: 409
    edited 2011-01-04 07:23
    This might be the link Mike is referring to >>

    http://forums.parallax.com/showpost.php?p=730860&postcount=7

    Mike & Miner_with_a_PIC - that's exactly what I was looking for... I had searched the forums but didn't find that post.

    Thanks!
  • jeff-ojeff-o Posts: 181
    edited 2011-01-04 12:25
    Check out this IC from Linear Technology:

    http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1805,P131515

    It's a low-frequency oscillator, and can be configured for a period of up to 9.5 hours! In the datasheet there's an example where it is used to wake up a microcontroller after a set interval. The microcontroller does its thing, then can send a signal to the timer to go into "reset" again until the next interval. It would be easy enough to add a button in there that acts as a manual "wake up" signal for the system.
  • wmosscropwmosscrop Posts: 409
    edited 2011-01-05 07:59
    I built Beau's circuit last night and it works, despite my best efforts :)

    (Memo to self: buy a good magnifying glass)

    It was nice to be able to build something from less than $1 in parts (that I already had, a first!)

    I just have two more questions:
    It appears that the maximum current rating for a 2n3904 is 200mA, so the circuit (including the voltage regulators) will be limited to about 150mA continuous current in practice. Correct?
    If so, what transistors could I use to safely support 300mA of continuous current? I'm not sure if I'll need that much current, but I'm driving a LCD w/LED backlights that uses 80mA by itself, along with the propeller, an IR LED, and several other LED's.

    Thanks in advance!

    Walter
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2011-01-05 08:44
    wmosscrop,

    I'm glad you got it working!! This is a pretty forgiving circuit, it's basically a gated SCR (Silicon Controlled Rectifier) ... in fact you could substitute one for the NPN and the PNP whose base-emitter junction has a 10k resistor across them. ... In this case you will need to rate both of those transistors in the 'SCR' to your particular LOAD demand. The real trick is in turning an SCR off once it has been turned on. Once they are turned on, they become VERY saturated. The NPN of the 'SCR' has a path to ground through the LM2940-5 voltage regulator creating a necessary voltage drop that helps to facilitate turning the SCR off. This drop in voltage allows the NPN connected to the I/O pin to 'crowbar' the ground across the B-E junction of the 'SCR's' NPN allowing it to turn completely off.
  • Jean-MarieJean-Marie Posts: 128
    edited 2011-01-06 08:36
    Hello wmosscrop and Beau Schwabe,

    Last month, I was involved in a Timer project with an Atmega where I was faced with the same sort of problem. I wanted the system to be triggered with a mercury switch and to switch itself off at the end of the count down. I used a schematic with 2 transistors (see the first attached picture).

    I understand that this schematic will not work with the Propeller if this one takes 1 or 2 seconds to start. So I am very interested in the schematic of Beau Schwabe but I am not an ingeneer and I don't quite understand how it works (see picture2) . (I added some identifications to transistors and resistors).

    I see that when the switch is ON, the base of T1 is driven low, so T1 becomes passing, driving at the same time the base of T2 high. T2 continues to drive low the base of T1 so the system is latched, giving the power to the first voltage regulator. Here is my first difficulty : the power supply has to cross two parallel systems made of one transistor and one 10K resistor ==> not much will be able to pass through.

    I have a second difficulty when one wants to cut off the system. I suppose it is obtained when the Prop is driving high the base of T3 through R4. Then the base of T2 becomes lower than its emitter ==> T2 is blocked ==> the base of T1 becomes high and T1 is blocked as well. My question is: when the base of T3 becomes high, there seems to be a short between the power supply and GND through T1 and T3 which could ruine these transistors.
    514 x 503 - 26K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-06 08:55
    Jean-Marie,

    You raise an interesting point: i.e. how much current is the circuit able to pass when it must all flow through two 10K resistors and/or two base-emitter junctions. IOW, there's no solid emitter-collector current path in the circuit. Moreover, your point about the dead short during turnoff is well taken. Perhaps Beau can fill us in.

    -Phil
  • wmosscropwmosscrop Posts: 409
    edited 2011-01-06 09:22
    Jean-Marie,

    You raise an interesting point: i.e. how much current is the circuit able to pass when it must all flow through two 10K resistors and/or two base-emitter junctions. IOW, there's no solid emitter-collector current path in the circuit. Moreover, your point about the dead short during turnoff is well taken. Perhaps Beau can fill us in.

    -Phil

    Phil, in my application I need only about 150mA... which seems to be within the design limits of the transistors.

    The turnoff pulse generated by the propeller (to create the dead short) is very short... a fraction of a second or so. I've used 1/8 second and it seems to work reliably.

    However, I agree that shorting is normally not desirable.

    Beau - would the addition of a resistor between the shutoff transistor's emitter and ground solve the issue? If so, what would be an appropriate value? I understand the basic workings of the circuit but the calculation of this value is beyond my limited mental facilities :)
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2011-01-06 09:48
    T1 and T2 form a typical SCR the 10K's are to bias them so that they stay OFF. As far as "the power supply has to cross two parallel systems made of one transistor and one 10K resistor ==> not much will be able to pass through." - this is not entirely true, the B-E junction of a transistor acts like a diode regardless if the transistor is on or not, so when the 'SCR' is on or latched, the equivalent circuit would be ...
              10k      C-E
          o--/\/\--o--->|---o
          |        |   T2   |
          |   E-B  |        |
    +V ---o--->|---o        |
          |   T1       B-E  |
          |        o--->|---o---> To Regulator          
          |        |   T2   |
          |        |        |
          |   E-C  |   10k  |
          o--->|---o--/\/\--o
              T1
    

    essentially 2 diodes in series, with two other series diodes in parallel, so you have 2-diode drops (about 1.2V)

    "Beau - would the addition of a resistor between the shutoff transistor's emitter and ground solve the issue?" - probably not, SCR's latch hard and you need to crow-bar them to turn them off. The amount of time that the 'short' is introduced is very brief.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-06 09:59
    Beau,

    I guess the difficulty I have with the SCR "equivalent" circuit, is that, even though the B-E junctions are conducting, they're not typically rated for the kind of current the C-E pathway is designed to handle. IOW, given that a real SCR is a monolithic circuit with a clearly defined high-current pathway, is the "equivalent" circuit really an adequate real-world substitute? Or does it serve merely as a pedagogical example for engineering students?

    Thanks,
    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2011-01-06 11:17
    Phil,

    "...even though the B-E junctions are conducting, they're not typically rated for the kind of current the C-E pathway is designed to handle." - Correct, but for the 2n3904 and the 2n3906, the maximum base current is rated at 100mA ... Essentially you have two B-E paths in parallel, so this being the 'weakest link' with the SCR arrangement, you should be able to drive 200mA.

    2n3904 Datasheet reference
    2n3906 Datasheet reference
  • Jean-MarieJean-Marie Posts: 128
    edited 2011-01-06 11:37
    Thank you Beau Schwabe.

    It is much clearer for me now.
  • wmosscropwmosscrop Posts: 409
    edited 2011-01-06 13:01
    Jean-Marie wrote: »
    Thank you Beau Schwabe.

    It is much clearer for me now.

    And thank you to everyone from me too. I have learned quite a bit from this deceptively simple exercise--and have a working circuit to boot!

    Walter
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-01-06 13:04
    I once used an actual SCR as a power-off mechanism for a Tandy M100 computer. Its operating current of over 60 mA was enough to keep the SCR turned on, but when the M100 executed its Sleep command, the current dropped down to a few milliamps, which was less than the SCR holding current.

    The nice thing about that is that there is no need for a signal connection back to turn off the SCR. It is an issue of the ratio of operating current to sleep current. In the case of the Prop, it could drop back to RCslow and that would end up in it being completely turned off. There are nice SCRs in TO92 packages that can easily handle 150 mA.

    I've heard a rule of thumb that the base current for a transistor should be limited to 1/3 of the rated average collector current, or 1/10 for a Darlington or superbeta transistor.
  • LawsonLawson Posts: 870
    edited 2011-01-06 14:49
    I wouldn't worry too much about over stressing the BJTs. Type 1 Solar Engine uses nearly the identical circuit to run a motor from a small solar cell.

    @Tracy Allen: Beau's circuit could emulate that function fairly easily using 2K ohm resistors in place of the 10K resistors and switching the voltage regulators to low quiescent current devices. (any of Microchip's MCP170x series would work well with <2uA quiescent current)

    Lawson
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-01-07 10:22
    If an 4-layer semiconductor will do the job, then it is one single component in place of 4 (two transistors and two resistors). The Teccor S101 SCR is a TO92 rated at 1 A max, and the holding current is 20mA. To turn it off automatically the circuit would have to power down to something less than about 10 mA. That is a non-sensitive gate SCR, one with a built-in resistor from gate to cathode, and it takes about 1 mA to trigger it. If the Prop can't power down the whole circuit to less than 10 mA, then it will still require a commutation scheme as in Beau's circuit.
Sign In or Register to comment.