Using Propeller to control it's power source? / Beau Schwabe Challenge!
Neutron
Posts: 21
My initial question has been solved several times over. Thanks everyone!
See post # 21 for Beau's push on/off circuit challenge
Hello everyone, I've been a long time lurker here. I have not yet had a question that I could not find an answer to by searching. I now have an excuse to post
I have been playing with Xbees and Props & have some wireless control projects in mind. I'm putting together a handheld remote & would like to power it with a single 9V battery. In an effort to make the battery live more than a couple days I have eliminated the 5v regulator that comes in the PE kit and am now powering the LM2937 directly off the battery.
My problem is that the 3.3v regulator still has an idle current of 1.38mA. Which puts battery life in the neighborhood of 2 weeks, if I don't even use it. So now I'm trying to figure out a way to shut the voltage regulation circuit down completely while the unit is not in use (which will be most of the time).
In the attached schematic I'm switching the ground of the board and V-reg to the battery negative.
One of the propeller pins is connected to the end of the diode shown unconnected.
The idea is:
- From a power off state, one can press pb1.
- This will switch the mosfet & power on.
- The propeller will then set this pin high holding the power on.
- Then after a period of inactivity the prop can then drive this pin low to shut off all power.
This works just fine while I'm controlling the mosfet gate with a jumper wire or the push button shown. However, when I connect the Propeller to the circuit, it just stays powered up regardless of pin state.
A couple more tidbits:
- I am currently powering this circuit with a wall wart in place of the 9v batt, it's outputting 7.65 volts.
- With the mosfet gate connected to the propeller I placed my voltmeter leads across the battery negative and VSS and came up with a reading of 3.309V.
- I then disconnected the gate from the prop, and held down pb1 the voltage difference then read 0.049V
Perhaps somebody can help me understand what my circuit is actually doing versus what I was hoping it would do?
Should I be looking at switching the positive leg instead?
Is there a better/simpler/more reliable way to accomplish the same ends?
Thanks,
Levi
Comments
Select a standard Enhancement Mode P-Chanel MOSFET suitable for the current you need.
I used a 2N7000 N-Chanel for control but I think your BS170 is OK too.
This should consume only nA of current when off.
When the switch is pushed 3.3V will be sent to the Prop. The first thing the Prop needs to do is set the pin high to hold power on.
When ready to turn off the Prop needs to bring the pin low.
Duane
BTW, this basic configuration can be also be done with bipolar transistor.
Original Post:
http://forums.parallax.com/showthread.php?87287-Low-Power-Mode....&p=598763&viewfull=1#post598763
Propeller Version:
http://forums.parallax.com/showthread.php?104132-auto-power-on-off-amp-battery-saver-circuit-ideas&p=730860&viewfull=1#post730860
Recently I have been working with a friend of mine at the local hacker space, using a derivative of my above circuit for a push "on/off" design... I'll see if he wants to share the circuit or part of the circuit. Originally we had a 3-transistor solution, then a 1-transistor solution, and now we have a transistor-less push "on/off" solution drawing pico amps in it's 'off' state.
-Beau,
If your friend is willing to share, I would love to see how it works.
Best Regards,
Levi
However there are regulators with shutdown pins such as:
LD2981
And the quiescent current is less than 2 uA.
Duane J
Duane J
I will be ordering some parts anyway, so I will throw in some MOSFETS and a couple of LD2981's so I can try out the circuits that Duane has posted. Maybe some MCP1702's also, judging from the datasheet they look like they could be quite useful for those low power always on applications.
Levi
Beau's circuit uses two bipolar transistors connected in a way to called a "Pseudo Silicon Controlled Rectifier" or SCR, sometimes called a "Gate Turn Off transistor" or GTO. This arrangement has 2 stable states, On & OFF. When triggered On the transistor pair feeds back on themselves and remain On so long as a small holding current continues flowing. In Beau's example with the 10K base resisters the holding current will be about (0.6V / 10K) * 2 = 120uA. Actually it is a bit more because the transistors have finite gains.
Unlike real SCRs, these can be triggered Off at will by steeling current from the base of either transistor. In Beau's example the third transistor does this and is controlled by the Prop.
If you want to reduce the sensitivity to transient currents one may reduce the base resistor values. Don't make them to small as the Prop may not draw enough current to keep it On.
Or add small capacitors across the base resisters to absorb transient currents. Start with 0.1uF.
In my two circuits and a third based on bipolar transistors don't depend on a latching circuit. The power is controlled directly by the Props pin so no unusual operation should be encountered.
I should say there is a bit less voltage drop across the 2N3906 pass transistor than with the SCR version. All things considered, the MOSFET version would be my preference.
Duane J
SCRs have a parameter, Ih, the hold current. The SCR will hold in conduction for currents greater than Ih, but will turn off sharply when current drops below that. In the above circuit, the Prop as load draws a current greater than the holding current, and when it wants to turn off, it simply goes to sleep, that is, maybe a drop to RCslow with all outputs off. The SCR turns it completely off and it takes a press of the button to get it going again. This circuit requires voltage overhead, but would be fine for powering a prop+regulator from a 9V battery.
For typical sensitive gate SCRs, Ih is on the order of 3 to 10 mA, and the resistor from gate to cathode can adjust that over a narrow range. There is a variety of SCR (non-sensitive gate) that has higher hold currents, on the order of 30 mA. I used that circuit back in the day when I was using the Tandy M100 for data logging, with an external clock controlling the period activation.
In the off state, it should draw little or no current. Pressing the button raises the base voltage above 0.7V with enough current to turn the NPN on, driving its collector low, and turning on the pMOSFET, which feeds the 3.3V regulator. The output of the regulator, through the 100K resistor, is enough to hold the NPN in its "on" state, keeping the pMOSFET conducting after the button is released.
Now, here's where it gets interesting. With the switch open, and with the circuit powered up, the voltage on the Prop Pin node will be around 1.0V, which registers as a logic "low" to the Propeller. When the button is pressed, this voltage will raise to about 3.0V without affecting the power-up condition, and which the Propeller sees as a logic "high'. So the button can also be used as an input to the Propeller! Further still, should the Propeller decide to turn itself off, it has only to pull the pin low to turn off the NPN and power everything down (which it can safely do, even while the button is being pressed)..
Disclaimer: I have not built this circuit to test it ('couldn't find a pMOSFET to try it with). But I've simulated enough of it in Spice to obtain the DC voltages reported above.
-Phil
Tracy:
What is the likelihood of dropping below the holding current of the real SCR sometimes under normal operation?
The Pseudo SCR, transistor pair, has a fairly accurate and programmable holding current. I have tested this, maybe 20 years ago, down to a point where leakage current in the transistors dominate and won't turn off.
I really like the ability to run the Prop in a very low current mode to shut things down.
How low a current can the Prop go predictably?
Duane J
1 Fully charged battery not supplying in excess of the load circuit (typically the Prop)
2 Draining battery supplying sufficient voltage and current to continue operating until a standby/shutoff can gracefully be accomplished.
Rather contradictory goals. But not impossible. YMMV.
I put together the bipolar transistor version you posted, it seems to be working very well. It does require that the button be held down until the prop can drive the pin high. Requiring a bit of button hold time is probably beneficial in my current project as it would help prevent unintended operation. I look forward to having some P channel MOSFETS on hand so I can try out the other version you posted.
Thank you,
Levi
Now that is a low parts count! It looks like I will need to pick up a couple SCR's to try also.
I'm not terribly familiar with SCR's but as I understand it, they are basically "self latching" so long as the current drawn by the load stays above the specified holding current correct?
I'm currently powering a Prop and an Xbee so I should not have an issue with inadvertently drawing too little current. To shut down though, I would have to either put the Xbee into sleep before putting the Prop to sleep or use a pin to switch the Xbee power or ground via a BJT or MOSFET.
A very neat solution overall
Thanks,
Levi
I took the batteries out of my camera when the camera wouldn't run any more.
They showed 1.35 volts then.
They ran the QS for a nearly a month before they were too low to keep it going.
When I took them out they showed .95 .96 .97 and .98 volts respectively, or 3.86 total.
Dose that imply that there is a .5 volt drop across the regulator???
Or more?
For a non-sensitive gate SCR (Teccor S601E), the equivalent hold current is 20 or 30 mA. The gate current required to turn the SCR on follows suit, and would be a fraction of a milliamp for sensitive gate and several mA for non-sensitive gate, but you are interested more in the hold spec.
Duane, There is a nice thread started by Lawson on low voltage/current operation of the Prop. When powered at 3.0V with brownout disabled and running on RCslow, the Prop draws about 4 microamps.
When I have a Prop running on RCslow, watching a heartbeat pin from a real time clock, with an XBee in sleep mode from 3.3V with brownout enabled, including an MCP1703-3.3 regulator, I see around 20 microamps of quiescent current and am puzzled if it shows more than that. Even so, that is still an awful lot in some energy harvesting applications.
I like that your circuit allows the button to serve double duty. I was ultimately hoping to be able to do that but figured I would start with the basic on/off functionality first then work up to it. As soon as my p-type MOSFETs show up I will give it a go.
I have gone from trying to figure out how to cobble together something that does the job, to trying to decide which one of several solutions is best suited for what I am doing
I've had several light bulbs coming on just from looking at & analyzing the circuits everyone is posting up. I'm going to mark this thread as solved, but please feel free to post up more examples if anyone feels like it.
Thanks again to everyone!
-Levi
Requirements:
- One push button
- Low "off" current
Features:
- Push "on" push "off"
- Bonus if the switch can serve double duty and the Propeller can read it
PS) Neutron, I did get permission to post the schematics I mentioned earlier and I will post them later. My work PC has been tied up in LVS/DRC all week for the Propeller II so I haven't had a chance to get those schematics out to you. This next week should be a lighter load.
That's great... I'll be watching & following along on my breadboard.
Since we have disused the topic of SCRs and MOSFETs I should mention my patent that uses them in H-Bridges.
See:
US6617913
Self-latching H-bridge system and apparatus
Notice, the SCR/MOSFET pairs are easily driven by a low voltage driver. Possibly with the 3.3V from a Prop Pin.
OK, I haven't done this yet with a Prop yet it but works nicely using CMOS logic gates running on 5V.
I'm setting up a 4 wire bipolar stepper motor driver right now controlled by a Prop.
Be careful not to trigger both halves of the bridge simultaneously. In my. practical implementation of the circuit I check that there in low voltage on the drains of both MOSFETs before I attempt to drive either forward or reverse. This assures that both SCRs have been commutated off before a new movement is initiated
BTW, even though my patent is still valid no one is going to care if anyone uses it. Certainly not me.
Have fun.
Duane J
Here is my 3-transitor version that consumes about 10pico Amps in the OFF (standby) mode.
@Beau From the requirements in the original post, maybe your challenge should be updated to also have a connection from the Propeller so it can turn off the circuit too. That way it can turn off the circuit if there is a long period of inactivity or if it is connected to an ADC and detects that the battery power is getting too low.
Robert
I have a solution that allows for a 'suicide' switch that the Propeller can turn itself off, but I wanted to see what others could come up with first.
There is even a solution ( with the right choice of voltage regulator ) that doesn't require any external transistors at all and still meets the requirement of the Propeller being able to use the switch as a functional input to the Propeller.
I edited the title to reflect change in course. Perhaps it will draw in some takers. I've been looking forward to seeing some different solutions to this.
Best Regards,
-Levi
As far as maximum function for minimal parts, this is a common enough problem that IC manufacturers have had a go at it themselves. Take for example the Linear Tech LTC2955 or LTC2950 pushbutton controllers. Not only do they turn the power on and off when the button is pressed, but they also add time delays to debounce the button and time to allow the µP to finish up what it was doing before the power goes down. And the µP can cut its own power of course. There are active high outputs for driving the shutdown pin on a regulator as well as active low outputs for direct drive of a pass transistor. Also the '2955 integrates voltage detection, so that it warns of low voltage and then powers down, or, it powers up automatically when the voltage increases above a threshold. All functions a system designer might want, in a tiny (of course, tiny) chip plus a few passive components.
Requirements:
- Any number of push buttons
- Low "off" current
Features:
- Push "on" push "off", on any of the buttons, and the propeller, apon power up, will know which one was the culprit.
- Bonus if all of the switches can serve double duty and the Propeller can read each one
Thanks,
Marcus