1
\$\begingroup\$

I am designing an ATtiny project that needs to operate for a specified amount of time on request, then power itself down completely. Although ATtiny MCUs are remarkable in terms of sleep mode power usage, and can be underclocked, the project needs to operate from a 12 V battery and the main culprit of power usage would be the LT1117 regulator. Plus the LT1117 has a low current limit of 2.7 mA so any low-power mode on the MCU would be negated by the need of some resistor in parallel with the MCU.

One way to bring quiescent current as close to 0 A as possible would seem to use a double latching relay. On pressing a spring loaded switch, the pulse would set the relay and connect the 12 V battery + terminal to the LT1117 regulator, the MCU would power on, do its job and then pulse the reset coil, powering itself down.

The other way would be a high-side FET switch instead. Seems to work well in the simulation attached.

  • The S1 switch is the spring-loaded press button to power on the device, by discharging the added gate capacitor C3, the time constant of R3/C3 is long enough for the MCU to start and manage the gate itself. the button is pressed at t = 0.01 s
  • The B1 source is the result of the digital write on the MCU pin that will manage the FET gate and keep it low. That state change happens as soon as it gets enough voltage to start, plus a 64 ms delay.
  • The V3 source is used to model the power-off of the MCU at t = 1 s and used in the B1 source expression.

I would prefer to go for the FET option, besides the ATtiny I will have to supply 5 V for another relay, and that's all. Simulation gives me a quiescent current of around 2.5 µA from leakage. Is that realistic ? The most important feature for the project is that it reliably turns itself off, and to a lesser degree do not turn on spuriously.

Which method would you choose and why ?

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ No problem with your approach. I would be surprised if your leakage is that high, but you could look around for a lower-leakage FET. I think the simulation uses maximum leakage values. \$\endgroup\$ Jan 4 at 0:42

2 Answers 2

0
\$\begingroup\$

The other way would be a high-side FET switch instead.

Here's a soft power switch using low-side switching:

https://www.eevblog.com/forum/beginners/circuit-for-low-side-mcu-controlled-soft-power-switch/msg2814872/#msg2814872

enter image description here

There are other ideas in this thread:

https://www.eevblog.com/forum/beginners/turn-on-only-latch-turn-off-with-gpio-better-bom/

e.g.:

enter image description here

and:

enter image description here

Both of these designs allow you to use the switch as an input after power has been held on by another GPIO pin and the diodes are instrumental in implementing that features.

\$\endgroup\$
3
  • \$\begingroup\$ Do you mean by using the switch as an input, I can sense the switch being pressed down when the MCU is already running ? That is precisely what I am trying to do next, implement a reset of the timer delay whenever the switch is pressed to extend the power on time. as it is used in ligthing control. \$\endgroup\$
    – rodv92
    Jan 5 at 20:50
  • \$\begingroup\$ If I understand the last design, Pressing the switch would bring input_pullup pin to GND (which can be sensed) and power down the N-Channel, while keeping the P-Channel conducting through the left diode path to the switch, when the switch reverts, the pullup resistor keeps the input_pullup at high level which makes the N-channel conduct, keeping the gate of the P-channel grounded so it conducts, so there is no loss of power. if the timer expires, maybe I could reconfigure the pin to output and bring it low, which would make the N-channel stop conducting, bring the P-channel to V+ and cut power \$\endgroup\$
    – rodv92
    Jan 5 at 21:12
  • \$\begingroup\$ When the button is pressed it will turn on the P-MOSFET and thus allow power to the MCU. Pressing the button might also turn off the N-MOSFET, but the P-MOSFET gate will still be held low and so will provide power to the MCU. \$\endgroup\$
    – ErikR
    Jan 12 at 20:44
1
\$\begingroup\$

I have made designs similar to the schematic you drew, and they worked fine.

As a side note, you probably don't need D3 and D4 and can remove them from the design.

As for leakage, it's likely going to have an exponential dependence on temperature. Look at the worst-case values in the part datasheet rather than relying on simulation for that one.

\$\endgroup\$

Your Answer

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

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