SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By TastyResistor
#165474
Hi All! Glad to be part of the community.

I had an idea for a latching power circuit, however I thought I'd come onto the forum to see whether anyone could tell me whether the concept works before I commit to parts. Or maybe someone has a better idea.

Requirements:
- Press a pushbutton. Latches power.
- Microcontroller turns on and stays on until it wishes to turn off.
- Unlatches power.

My idea is shown below. DISCLAIMER! I know that you need to use resistors with transistors. I didn't include them because its still theoretical at the moment.
Image

So what do you guys think?
Bonus marks! : Is it possible for the push button to also latch power to the SR flip flop by connecting Q and flipflop's +? This would help me save even more power!
What sort of transistor should I be using, considering it is possible that additionally attached loads could draw large amounts of current? (darlington pair, mosfet?)
By lyndon
#165494
Behavior of this circuit will depend on how well Q1 saturates since the Arduino will be floating at the Vce drop.

In any case, you don't need the latch: the Arduino can do that itself. I would try a PNP transistor/FET at the Arduino Vcc with a momentary switch from base to ground (through a limiting resistor) and tie a digital output to the switch.

Push switch, transistor turns on and Arduino also pulls base to ground. Release switch, Arduino is still pulling it to ground and stays powered up until it decides to turn itself off.

Should work, haven't tested it ;-)
By TastyResistor
#165509
Hi Lyndon, thanks for the reply!

is this what you mean?

wont this circuit cause the arduino to be always on (as there is nothing keeping Gate high)?

Image

with all the appropriate resistors ofcourse :P
By rrpilot
#165513
You would just need a pull-up resistor on the base of the transistor up to 5V.

You can also do this with a voltage regulator enable input in the same way.
By Renate
#165514
I wouldn't bother trying to switch power to the Arduino.
Yes, I've seen lots of people trying to do that.

The Atmel chips all have power down modes, use them.
Turn off your outputs, sleep, wait for an interrupt, turn your outputs on.

Is this for a battery powered circuit?
By TastyResistor
#165547
thanks for the replies guys!

Yes, this is for a battery powered circuit. However, as my goal is not just to switch the arduino but also to switch other devices, I think I'll go with rrpilots suggestion.

Unless you guys think it might be more worthwhile to switch other devices using transistors on arduino's outputs?