0
\$\begingroup\$

We've a projet with an important autonomy concern. We use an homemade arduino (atmega328), and for the moment we're using interrupts on buttons to wake up the atmega.

so we have: sleep ->(button pressed) -> wake -> (user RFID identification) -> (RF Communications) -> sleep.

We've optimized the total consumption with advanced sleep, modules isolated from current with transistors and so on...

I was asking myself if we could use a voltage regulator with a shutdown pin, and link one button and one pin of the atmega with it.

We would have this cycle: shutdown -> (button pressed) -> shutdown pin HIGH -> atmega is powered-> atmega set shutdown pin HIGH during sketch configuration -> user RFID identification) -> (RF Communications) -> atmega set shutdown pin LOW -> shutdown

You get get the schematic here: schematic So to summarize: I need the button during my sketch, so when it's pressed and get the shdn pin high on the regulator, the first thing the arduino makes is maintaining this high with its pin 4. Furthermore, it restore the pull-up configuration of the button by reconnecting it to the ground through the npn transistor. When arduino is shutdown, button is linked to VIN as the npn make a NOT function with arduino state (HIGH or LOW).

Do you think it could work? If something is unclear don't hesitate to tell me :-)

Thank's a lot!

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Unfortunately I can not open your schematic, but I have an improvement that will definitely make this thing work.

Have a look at this:

schematic

simulate this circuit – Schematic created using CircuitLab

where:

  • reg_shdwn is the regulator shutdown pin
  • atm_wake_me is the pin you use to wake up the ATMega
  • atm_keep_on is the pin you would use to keep the regulator on

When SW1 is pressed all three pins go high, C1 is charged at \$V_{cc}\$ and the micro turns on. If the user releases the button before that the ATMega managed to pull atm_keep_on high the whole system does not shutdown though, since the capacitor will need some time to discharge through R1. You should size R1 and C1 to have a time constant \$\tau\$ that allows your micro the time it needs to pull the pin high.

The downside is that you dissipate some power through R1 when the system is on, but of course the resistor can be sized to minimize this power, while still being smaller than the input resistance of the arduino and the reg_shdwn pin.

Since of course \$\tau=RC\$ we can make an example calculation to aid you. I'd say that for R1 you should choose somethin in the \$100\$k\$\Omega\$ range, let's say \$R1=470\$k\$\Omega\$. \$\tau\$ can be some \$100\$us, i.e. 100 clock cycles at 1MHz. This leads to \$C\approx22\$nF, a perfectly reasonable value.

As a side note, a \$470\$k\$\Omega\$ resistor would dissipate about 23uW if \$V_{cc}=3.3\$V.

\$\endgroup\$
5
  • \$\begingroup\$ Nice! I like your solution! But some problem: VCC doesn't exist before regulator is on. I just have VIN from battery and it can be 7.4v, so it could make a current passing into the [email protected]. I've added the schematic image. \$\endgroup\$
    – hachpai
    Commented Aug 26, 2015 at 14:08
  • \$\begingroup\$ I see. Just put the R and C connected between the shutdown pin and ground. Please note that in your schematic you are feeding arduino pin 4 with V_bat when the key is pressed. \$\endgroup\$ Commented Aug 26, 2015 at 14:12
  • \$\begingroup\$ Oups! I've to put a diode to avoid that. Do you really thing that the pressing-time could be too small to init the atmega? I could set a led that notice the user of the power state of the atmega. I really appreciate your design anyway, but our board is really small and we are in homemade PCBs for the moment. Do you think that my solution could work? \$\endgroup\$
    – hachpai
    Commented Aug 26, 2015 at 14:55
  • \$\begingroup\$ You should at least add a debounce circuit. \$\endgroup\$ Commented Aug 26, 2015 at 15:15
  • \$\begingroup\$ Just, and your solution is a simple debounce with the advantage of assuring the bootstrap. \$\endgroup\$
    – hachpai
    Commented Aug 27, 2015 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.