Arduino soft switch

Discussion in 'General Electronics Chat' started by stoopkid, Feb 16, 2013.

  1. stoopkid

    Thread Starter Member

    Mar 3, 2011
    136
    1
    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?
     
    Last edited: Feb 17, 2013
  2. MrChips

    Moderator

    Oct 2, 2009
    12,432
    3,360
    I think it is not going to work.
    A simpler solution would be to put the mcu into sleep mode.
     
  3. stoopkid

    Thread Starter Member

    Mar 3, 2011
    136
    1
    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.
     
  4. bug13

    Well-Known Member

    Feb 13, 2012
    1,208
    38
  5. stoopkid

    Thread Starter Member

    Mar 3, 2011
    136
    1
    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.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,432
    3,360
    Switch to a micro power mcu.
     
  7. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,006
    3,763
    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.
     
    bug13 likes this.
  8. vrainom

    Member

    Sep 8, 2011
    109
    19
    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?
     
Loading...