Latching Off-On pushbutton for portable electronics PCBs

MisterBill2

Joined Jan 23, 2018
27,563
AliExpress and ebay are not the only or best places to buy components. Besides the big distributors like Digikey, Mouser, RS and other major suppliers, here's a summary of suppliers I've found reliable..
THANK YOU, J.C!!

I tried to recall the list of reliable suppliers for another thread, and here you come up with it. I appreciate that!! In this case, the 'unintended secondary effects" are helpful.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
Hi guys,

I made the below circuit to latch power using push button. The load is a ESP32-S3 MCU, the entire circuit is designed to work in the below manner

Push the button -> The LDO turns on -> ESP32 Turns on -> Immediately a transistor is turned on pulling the MOSFET low keeping the circuit on forever

I have used this button with LED inside it from LCSC as the tactile pushbutton. https://www.lcsc.com/product-detail/Tactile-Switches_Korean-Hroparts-Elec-K6-1212A-04_C128978.html

Here's the problem:

When I press the button, everything is getting powered correctly i.e.,
1. LED inside the button is glowing
2. LDO is getting proper input and output
3. I am seeing 3.3V at the power pins of ESP32.

BUT, the code inside the ESP32 is not running :(

Alternatively I did another thing, I soldered a jumper wire to the base of the MOSFET seperately and connected it to ground manually. Then everything is working fine, the ESP32 is powering on, the transistor is latching the power correctly the entire system is stable.


What am I doing wrong with this circuit?

1734625252050.png
 

crutschow

Joined Mar 14, 2008
38,526
What am I doing wrong with this circuit?
Not clear.
Seems odd that the ESP32 is getting power and not operating.

What is the purpose of D3?

What is the PWR_IN voltage?

Measure the voltage at the MOSFET gate when the button is pressed.
Ir may be marginal.
 
Last edited:

Thread Starter

kowshik1729

Joined May 10, 2020
99
Measure the voltage at the MOSFET gate when the button is pressed.
Here's the values -

When button not pressed - 4.65V (Expected because of the 91k ohms pull-up)
when pressed - 80mV (pulling it to ground)

Might be better to have the button directly connect the gate to ground then through the LED.
Can you please explain this more? I have done it the same way right? I am using R19 resistor (which I changed to 1k to reduce brightness of LED) to control the LED right? What did you mean by when you told using a seperate resistor please?

Thanks
 

crutschow

Joined Mar 14, 2008
38,526
Here's the values -

When button not pressed - 4.65V (Expected because of the 91k ohms pull-up)
when pressed - 80mV (pulling it to ground)


Can you please explain this more? I have done it the same way right? I am using R19 resistor (which I changed to 1k to reduce brightness of LED) to control the LED right? What did you mean by when you told using a seperate resistor please?
Looks like the voltages are okay, so don't know what your problem is.
If the button is pulling the gate to 80mV then I don't see why connecting the gate directly to ground should make a difference.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
If the button is pulling the gate to 80mV then I don't see why connecting the gate directly to ground should make a difference.
Yes me too, I don't understand why. I had one hunch, the DISP_BUTTON is connected to one of the GPIO pins of the ESP32 as shown below, So do you see any issue of current draw from the MCU?

1734651734677.png

In my code it looks like I have programmed an internal pull-up and configured this pin as input pin. So would it work if I disable this internal pull-up?
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
The pull-up is needed to detect a signal high due to D4.
Yes that's right. I have actually got it working but at the risk of losing the GPIO functionality of the button. I simply removed the Diode D4 here at the GPIO pin of ESP32 disconnecting it completely from the power circuit. Now the esp32 is powering on and the code runs.

I believe it's definitely the current draw issue which is causing the problem, but not sure how to fix it keeping the functionality of button and the power latch circuitry.
 

Thread Starter

kowshik1729

Joined May 10, 2020
99
Do have a delay in the code that gives time to release the button or code that waits until the release of?
Hmm didn't quite get that, I have a task that keeps looking for the gpio level of the button, so there's enough time to wait for the button to be released. Can you elaborate more please?
 

sghioto

Joined Dec 31, 2017
8,634
As the button is pressed to disable latch Q2 the power remains ON because U10 remains on as long as the button is pressed.
Is that what's happening?
 
Top