Connect with us

Soft power w/ ATMega, LDO, and multi-use button - circuit sanity-check?

Discussion in 'General Electronics Discussion' started by Chris Phoenix, May 25, 2015.

Scroll to continue with content
  1. Chris Phoenix

    Chris Phoenix

    1
    0
    May 24, 2015
    I want to build a soft-power switch that:
    1) Uses the CE input of an XC6221 (LDO power supply) to actually switch the power
    2) When the circuit is powered on, the ATMega88 can use the button as input
    3) The ATMega can turn itself off

    I've designed this circuit which looks like it should work, but I have several practical questions:

    1) This puts battery voltage into the DIO inputs of the ATMega when the power is off and the button is pushed. Is the 100K resistor, in series with the ATMega's internal protection diodes, enough to protect the chip from damage?
    2) If I use the D option on the XC6221, will the circuit be overly sensitive - "wave your hand near it" to turn it on?
    3) Is there a more elegant way to do this? (Using fewer than 4 passives).

    In this circuit, pin 23 is to detect the button's state during normal operation, and pin 24 is to keep the circuit turned on after the button is released. I don't need to turn it off while the button is pressed.

    Here's the circuit:
    PowerCircuit.jpg

    I've attached the LDO datasheet. The ATMega datasheet, at 3 MB, is too big to attach; it can be found here. http://www.atmel.com/images/doc2545.pdf

    Thanks!
     

    Attached Files:

  2. Harald Kapp

    Harald Kapp Moderator Moderator

    11,702
    2,717
    Nov 17, 2011
    Welcome to electronicspoint.
    1. Depending on battery voltage: 100kΩ translates into a current of I=Vbat/100kΩ The AVR datasheet does not specify the max. current into the protection diodes. I guess 100kΩ should be good for up to 10V battery voltage.
      As an additional protection you may add a Schottky diode from the input to Vcc (pins 4+6), anode to the input pin. This diode will become conducting before the internal diode of the chip is active and therefore add an additional level of protection.
    2. No, why would you expect that? On the contrary, it will ensure a clear power-off of the regulator is neither the button is pressed nor pin 24 of the AVR is high.
    3. Maybe, but not an obvious one.
    In addition I see a potential issue with the power-off sequence: As I understand the circuit,once powered on id held on by pin 24 of teh AVR being helh high. To power-off the circuit, the pushbutton is pressed again which is sensed via R2 and pin 23. The AVR will then pull down pin 24 to shut down the regulator IC3. But what if the user presses the button longer than it takes to shut down the circuit (which is likely)? Once powered off the regulator "sees" an on signal via D1 and the still active pushbutton and will turn on again.
    A way around this is to delay turning off pin 24 until the buttton has been released. But this in turn may irritate the user because there is no immediate feedback to pressing the button for off.
    How are you planning to deal with this dilemma?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-