There are lots of examples of latching circuits that use a single momentary push-button to turn on/off a circuit by combining two or more transistors. Some examples are:

  1. Simple soft power latching circuit for a microcontroller
  2. https://randomnerdtutorials.com/latching-power-switch-circuit-auto-power-off-circuit-esp32-esp8266-arduino/
  3. https://www.youtube.com/watch?v=0IjJH3ksqfs

Since it is common for LiPo-powered devices use an LDO to generate a constant 3.3 V, my question is: can you use the "ENABLE" pin on the LDO to generate that latch from the microcontroller? The general idea would be something like:

  1. Push button pulls AP2112 LDO EN high
  2. LDO powers microcontroller
  3. Microcontroller uses LATCH pin to keep LDO EN pin high (this is the latch)
  4. Microcontroller can shut-down the whole system when desired by setting LATCH LOW


simulate this circuit – Schematic created using CircuitLab

Do you spot any problems/disadvantages with this approach? It is a very common application and I am surprised I haven't found anything similar on the internet.


1 Answer 1


One reason you may not have seen circuits like this is that most designers would use a dc-dc converter rather than a linear regulator, in order to get the most energy from the battery.

In any event, I do see some problems. First, there is no mechanism for the microcontroller to pull the EN pin low and shut down the LDO. The way you have arranged the diodes it is only possible to drive the EN pin high. You might be able to use a resistor in place of D2, but that would have to be chosen carefully using information that you haven't provided.

When the microcontroller is driving the LATCH output high, to 3.3V, the voltage at the LDO's EN pin won't be higher than about 2.6V (if you keep D2). No way to know if that is a high enough voltage without a link to the LDO datasheet.

When the pushbutton is pressed you will be applying the full battery voltage to the microcontroller's SENSE pin, admittedly through a 10k resistor. Be careful not to damage the microcontroller. Did you intend to make a voltage divider with R1 and R2? R1 doesn't seem to have any purpose.

  • \$\begingroup\$ Dc-dc converter you mean a buck-boost converter? I was trying to avoid it due to complexity reasons. In any case, those also present an EN pin that can be used in the same manner. Setting the micro ENABLE pin to LOW will not set the voltage at LDO EN to 0 and thus, turn it off? I checked and above 1.5V is considererd HIGH in the LDO EN, so 2.6V should be enough. I don't expect any problem on the input pin for the micro (very low current with the 10k R). R1 is there as a pull-down resistor, to ensure a LOW reading when the push-button is open. I'm new in electronics, thanks a ton! \$\endgroup\$
    – rea104
    Commented Jun 16, 2019 at 8:30
  • \$\begingroup\$ R1 can not pull EN low because D1 prevents current flow in the necessary direction. If you want R1 to pull EN low then you must move it to the other side of D1, connecting R1 directly to the EN pin. \$\endgroup\$ Commented Jun 16, 2019 at 14:45
  • \$\begingroup\$ It pulls the SENSE pin LOW. For the EN pin, the LDO has an internal pull-down resistor of 3M. \$\endgroup\$
    – rea104
    Commented Jun 16, 2019 at 15:16
  • \$\begingroup\$ Ah. It would have been considerate to those of us reading the question to provide that information up front, in the form of a link to the datasheet. Now the question is, how much current leaks through the diodes and what voltage does it produce across a 3 megohm resistor? \$\endgroup\$ Commented Jun 16, 2019 at 16:18
  • \$\begingroup\$ Apologies for that! Found out after this interaction with you. I edit the question to include that information in case is useful for someone else. Thanks a lot for your comments! \$\endgroup\$
    – rea104
    Commented Jun 16, 2019 at 16:40

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.