Software Power Off
Chad George
Posts: 138
I'm working on a new Propeller based circuit design that needs to have a software Power-Off feature.
The idea is to have a momentary switch turn the system on, but only turn off under software control. Originally, I thought this would be pretty easy, but after several design iterations I've found it to be trickier than expected.
One issue is that the system needs to maintain power after being turned on even if the Propeller isn't in control (ie. its being programmed or is reset). This has ruled out simple solutions involving holding a line low immediately after the Propeller turns on.
I've come up with a solution, but I'm not convinced its the best way to do it. I'm using some auto-mux power switches to select between battery or external power that have an active low enable line (with internal pullup).
The idea is to have the momentary switch and a mosfet in parallel. The momentary switch pulls the enable line low to turn the system on, then the mosfet keeps it there. System power holds the mosfet on. When the propeller wants to turn the system off it pulls the mosfet base low which kills the enable.
My problem is analyzing what's going to happen as system power starts to drop. Obviously, at some point I'll loose the Propeller that's holding the mosfet OFF. My concern is there might be enough residual voltage left on bypass capacitors to turn the mosfet back on and re-enable the power switch.
Maybe I'm just making things too complicated and somebody out there has a better solution or a way to make mine work.
Thanks.
The idea is to have a momentary switch turn the system on, but only turn off under software control. Originally, I thought this would be pretty easy, but after several design iterations I've found it to be trickier than expected.
One issue is that the system needs to maintain power after being turned on even if the Propeller isn't in control (ie. its being programmed or is reset). This has ruled out simple solutions involving holding a line low immediately after the Propeller turns on.
I've come up with a solution, but I'm not convinced its the best way to do it. I'm using some auto-mux power switches to select between battery or external power that have an active low enable line (with internal pullup).
The idea is to have the momentary switch and a mosfet in parallel. The momentary switch pulls the enable line low to turn the system on, then the mosfet keeps it there. System power holds the mosfet on. When the propeller wants to turn the system off it pulls the mosfet base low which kills the enable.
My problem is analyzing what's going to happen as system power starts to drop. Obviously, at some point I'll loose the Propeller that's holding the mosfet OFF. My concern is there might be enough residual voltage left on bypass capacitors to turn the mosfet back on and re-enable the power switch.
Maybe I'm just making things too complicated and somebody out there has a better solution or a way to make mine work.
Thanks.
Comments
Here's a circuit for you.
Pushing the button activates the SCR which will draw its power through and Mosfet and remain on. When you want to turn the system off just pull the Mosfet's gate low. By doing that the SCR will then turn off until the button is hit again. You attach the chip to the other end of the SCR.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 3/22/2009 9:23:03 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
Your circuit shows a pMOS FET, but I'm sure this is not what you meant. But, assuming you meant an nMOS FET, the 3.3V gate voltage will not hold it on in a source follower circuit, such as yours, since VGS will be nearly zero.
-Phil
The SCR seems like an interesting idea, but what kind of voltage drop does it normally have?
My system has to be powered off a single cell Li-Po battery so I don't really have any headroom for the 3V3 regulators as it is. Thats why I went with the auto-mux switches...I couldn't even take another Schottky diode drop.
mctrivia,
unfortunately, I need this to really power everything off. I have other mechanisms in place for "low-power" modes, but here I'm looking for as close to a physical ON-OFF switch as I can get.
I came up with another solution that I'm pretty sure will work. I added another mosfet basically making a bistable multivibrator. This way I'm pretty sure it'll hold itself off as system power goes away (even after the propeller has dropped out due to low voltage)
But this seems really overkill...maybe I'm just being too paranoid. Has anyone done something like this before?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
When the button is pressed, the pMOSFET gate is pulled low, and it conducts, raising the base of the NPN, so that it, too, conducts, holding the gate low. A low on the /Kill pin pulls the NPN base below its 0.6V threshold, releasing the collector and turning off the MOSFET. Once the MOSFET is off, the gate pullup will keep it off.
You will need a low RON pMOSFET with very low gate threshold. A Fairchild FDT434P would work, but it may be overkill. Moreover, the off-state leakage current in this circuit should be virtually nil.
-Phil
PS will you have a 5v rail available? if not then it would not be workable.
Nice!.. I like your "Hybrid discrete SCR" approach. As you know SCR's can be tricky to turn off because they latch "ON" so hard, but that's if it’s a complete bi-polar solution. Your design looks like it would not have that problem at all. I'll have to simulate it, but it looks good.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I don't always have a 5V rail, sometimes its the only on battery power with is 3.6 to 4.2V
Phil,
I like your design. One question I still have is what happens when the system voltage drops below the level required for the Propeller? The propeller will stop pulling the Kill signal low, but there will still be some residual voltage left in the system (mainly due to capacitors).
I keep wondering if its possible for everything to turn back on as soon as the propeller drops out?
Thats why I was thinking I needed a solution where as soon as the kill signal goes low it doesn't have to "stay" low for the system to still completely shutoff.
Maybe this isn't as big of a concern as I'm making it out to be.
Post Edited (Chad George) : 3/23/2009 1:40:50 PM GMT
Phil's circuit is better, I like it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
That's how I'd read the schematic.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DGSwaner
"When in doubt, use C4" - Jamie Hyneman, Myth Buster
I am building a module like that right now. see
the thread about boost/buck
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
Its pretty easy to hold the enable low with another mosfet, but my concern is in the behavior of the system during the shutdown transient.
The moment power is cutoff (ie the enable line goes high), system voltage will drop off at a rate determined by system capacitance. At some point the Propeller goes into an under-voltage reset state and I'm concerned that existing suggestions might just turn back on again when this happens.
The supervisor will drive the '3904's base low when it's supply voltage drops below around 2.9V; high when above. Therefore, once the /KILL pin is asserted low, it will stay low until Vdd drops to 2.7V. By then, the supervisor will have taken over and will continue holding the pin low.
If there were positive-reset, open-drain supervisors available, the supervisor could actually replace the '3904. But I haven't found one that's suitable. The problem with using a push-pull unit, like the MCP810, is that a high output could still be far enough below 3.3V to keep the MOSFET "on". That's why I left the '3904 in the circuit and used a negative-reset supervisor instead.
-Phil
_
Post Edited (Phil Pilgrim (PhiPi)) : 3/23/2009 8:25:57 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
I'm glad to hear I wasn't going crazy and imagining this problem.
I like your approach, but still want to use the auto-mux switch since I also have the problem of needing external and battery power.
Do you think my bistable-multivibrator approach is viable?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
why not use a low-power 5V relay, activated by a 2N2222. The base of the NPN can either be pulled high by a pushbutton or an output pin. No worries, cannot restart on its own, etc. Definitely not very elegant though.
WOOPS ! Missed the bit about staying on during programming ... sorry... Could you replace the momentary contact switch with a SPST toggle switch that you keep On during reprogramming?
Cheers!
Paul Rowntree
Post Edited (TreeLab) : 3/23/2009 9:29:16 PM GMT
The bistable approach would probably work. The only problem I see is that it draws power (about 330µA) when the Prop is off, since one of those transistors always has to be "on".
-Phil
I guess the important question is whether the bistable will hold its state as system voltage goes away.