Arduino soft switch

Thread Starter

stoopkid

Joined Mar 3, 2011
146
I am running an ATmega328p at 8MHz and a 3V cr3032. I'd really like to use one of my tactile switches to power it on and off and also still be able to use it for functions in my programming. I wanted to verify if this circuit will allow me to do that, or if it could be simplified. I ran into the issue of still using the switch during the program and remedied that with the two diodes. If that could be simplified it would be nice because I am working with limited board space. I have a couple of fv=550mV diodes. The resistor values are general placeholders.

Thanks for any information.

edit: I'm beginning to think that only the right diode is necessary. Is that the case?
 

Attachments

Last edited:

Thread Starter

stoopkid

Joined Mar 3, 2011
146
Sleep mode for this mcu still draws about a quarter of a mA which means I'll go through a battery every month. I'd rather the current draw be smaller.
 

Thread Starter

stoopkid

Joined Mar 3, 2011
146
Yes, I've seen that and tried it for a different project but had some trouble. Also I don't think I'll have enough space for that many more components. The thing is, I figure since I've got an mcu already in the circuit, I should be able to simplify things a lot more with it. Plus I'll end up wanting to be able to switch the circuit off with the mcu anyway. Instead of charging up a cap, I can just set an mcu pin high. I'm sortof fiddling around with it and I've got it started. I've got it turning on and staying on from the one tactile button so far.
 

GopherT

Joined Nov 23, 2012
8,009
You could use the bipolar switch described at the beginning of the video from above, then use the Microcontroller to trigger the OFF in that drawing by connecting to a pin set as an input. When you want to turn off, set the pin to an output and bring it LOW (to ground). Your device should turn off.
 

vrainom

Joined Sep 8, 2011
126
I think the op's circuit will work, except I would prefer to switch the high side, and it needs a resistor from the second diode to the transistor base. I suppose the turn off signal would be based on the length of the pulse?
 
Top