I've read multiple solutions about how to build a self-controlled power off circuit (e.g. here and here). I've MOSFET at my disposal so that'll work out.
However, I could not find out how to minimize power consumption. If I'm not mistaken all solutions waste current through the pull-up or pull-down resistor for the MOSFET. With 10k resistor and 3.3V that would be 330 µA. That's eleven times what my ATMega328P boards consume while sleep all the time, i.e. 30 µA including quiescent current of the voltage regulator.
Is it possible to use additional MOSFET or other basic components to eliminate the current consumption of the pull-up? I thought about an additional MOSFET to disconnect the pull-up when the µC is on but not sure how to do it.
Btw. I want to learn and to tinker a bit myself, hence, the Pololu board and the like are not what I'm searching for.
Thanks & best
srnet:
Significant current only flows in the pull up resistor when you turn the MOSFET on by grounding the gate.
Absolutely, and that's what I'm asking for
When all is powered and the µC is sleeping with 30µA, respectively, the pull-up is wasting power to ground because the pMOSFET is held active. When the µC is active and wasting 10 mA for 2 seconds, the 330 µA don't matter but when sleeping ...
terraduino:
Absolutely, and that's what I'm asking for
When all is powered and the µC is sleeping with 30µA, respectively, the pull-up is wasting power to ground because the pMOSFET is held active. When the µC is active and wasting 10 mA for 2 seconds, the 330 µA don't matter but when sleeping ...
Here are two circuits I could implement. I prefer the left but not sure if the NPN is needed.
Note that I do not have realized a self-controlled switch yet.
terraduino:
Please, let me know what this schematics provides that was missing in the previous one.
How it's connected to the microprocessor, which may or may not be important. Without seeing the complete schematic can't see what's important and what not, and that's why it's best to post complete schematics. You're not connecting to an EN pin but to a digital IO pin, that's a difference at least.
Main difference between the circuits is that the left one is active low and the right one is active high.
Now to get your circuit to switch on it's important to know how fast you can get your pin in the required state (high or low) after boot. You have to keep the button pressed long enough for that.
Neither circuit should leak significant current when switched off, as there's simply no path for current to run. Leaking may take place through the NPN transistor or via the digital pin, but should not be more than a few nanoamps.
Thanks for the explanation. Didn't know that "EN" is a standard term for something. Just wanted to note that this is the digital pin to enable the circuit.
Btw. we are misunderstanding each other. It is not about current wasted when off. It's about the current that is wasted when the pMOSFET conducts, i.e. the µC is powered (and sleeping).
And I'm sorry for the wrong pMOSFET. I allways get confused by the symbols although I know the drain/source/gate purpose
There are plenty of chips with an EN pin, generally the purpose is to enable the chip.
If you want to lower the current loss, use a larger resistor. All it does is keeping the gate at the high voltage, 100k or even 1M should work fine, higher values may even work. The main thing is the MOSFET gets slower to switch on/off (you're talking about microseconds at most) as the resistor forms an RC network with the gate capacitance. At very high resistor values you may get issues with thermal noise.
1M and 3.3V gives you a leakage current of 3.3 uA.
Thanks again, I thought resistors to big won't work at all. Something about to weak to pull etc. Will have to re-read about this issue.
Appreciating your input. Slower reaction does not matter to me. Less than 5 uA is good enough although its up to 25% of the current of my most economical µC use (20uA) while sleeping. approx 5uA because I'm switching a battery pack with higher voltage to avoid quiescent current of the voltage regulator.
srnet:
Anyway, one of those circuits will work (switch off the processor) the other will not, so try both and see what happens.
This is true with both MOSFETs connected the right way. AFAIK 2 transistors are needed for such circuit. (Maybe an "exotic" depletion FET would work alone but they are rare for same reason unknown to me.)