Hello all,
I want to make a small very low (battery) power device that powers on at the touch of a button, does it's stuff, then automatically powers off after say 5-10 seconds.
That is to say completely powers off with no separate monitoring kinda circuit.
I've tried a couple things, such as with a relay but that ended up needing a separate power supply constantly running and also took up a lot of room physically.
Another attempt was with a capacitor and transistor which seemed to work alright, but I couldn't get a strong/constant enough power from it to run the arduino consistently (my electronics abilities let me down with this kinda thing).
Any ingenious ideas? Seems like a dead simple thing that everyone would want to do. I've even considered some kind of mechanically delayed latching switch, but they don't exist
Thanks in advance!
Wouldn't that still need a constant power supply though?
I think you're at the right track with the transistor. Something like this should work.
The Arduino_on line has to be pulled low by the Arduino to stay on (like, first thing in the sketch). Make it high to turn off the Arduino. C is to give the Arduino time to boot. The BC557 can only drive 100mA so don't connect something heavy to the Arduino (one or two LED's). Do you need more, let the Arduino switch them with a transistor of there own (Google "Arduino transistor" of "Arduino mosfet").
entozoon:
I've even considered some kind of mechanically delayed latching switch, but they don't exist
Search 'Delay off relay'?
@dannable I tried something similar to this:
but worried that, over time it'd slowly draw power?
@septillion That looks fantastic, I'll give it a go and report back. wonder how much capacitance to use, I've got a couple 10uf and 100uf knocking around somewhere to try.
septillion:
I think you're at the right track with the transistor. Something like this should work.
The Arduino_on line has to be pulled low by the Arduino to stay on (like, first thing in the sketch). Make it high to turn off the Arduino. C is to give the Arduino time to boot. The BC557 can only drive 100mA so don't connect something heavy to the Arduino (one or two LED's). Do you need more, let the Arduino switch them with a transistor of there own (Google "Arduino transistor" of "Arduino mosfet").
Thinking about that circuit, won't it be constantly drawing power in order to keep the capacitor charged up? (or does it not work like that?)
A small one will be okay. 10uF is already quite big.
No, a capacitor doesn't work like that. Once it's charged it stays charged. Compare it to tires, it you connect a tire to 3 bar (or 43 PSI for weird people :p) tank the tire becomes inflated to 3 bar. It the tire is at 3 bar no air will move between the tank and the tire even if you keep it connected. It's simply full.
Okay, the capacitor has a small leak but that's very small.
To be sure the Arduino turns itself off after setting the output high, keep it in a loop. Something like
digitalWrite(ArduinoOn, HIGH);
while(1){
}
Because if the code goes on and makes the pin low again somehow it does not turn off. So make the pin HIGH and keep waiting for the power down
Fascinating, thank you so much for that explanation.
Makes me chuffed that I posted asking for help rather than struggling away for days on end :o
I've ordered transistors/relays and an assorted bunch of capacitors to try both methods and report back.