Power on -off circuit : Long press to Turn on instead Short Press

Thread Starter

hmzblgn

Joined Sep 15, 2025
6
Hello all,


I would like to use the following circuit to power on a Raspberry Pi and handle power-off from the software side.


The circuit currently provides multiple functions:


  • Short press → turns the system ON
  • Long press → forces shutdown
  • Pulling P7 to GND → shutdown from the Raspberry Pi side

However, I need the following behavior:


  • (1)Long press to power ON
  • (2)No shutdown by long press (disable this feature)
  • (3)Shutdown from the Raspberry Pi side should remain the same (pulling P7 to GND)

I assume I need to modify the left side of the IRF7319 circuit, but I couldn’t figure out how to implement the long-press ON functionality while removing long press shutdown (2) and keeping Shutdown from Raspberry by pulling P7 to GND (3).



Any advice would be appreciated.

1757970453318.png
 

panic mode

Joined Oct 10, 2011
4,864
swap places of 100k and 1uF at the left side...
that should eliminate short press and at the same time, long press will used to turn it on (capacitor need to charge to activate mosfets).
initially capacitor will be discharged as before. but it will keep the MOSFETs off. that is until button was on for long enough to charge the capacitor.
after that everything is the same...

1757981698127.png
 
Last edited:

sghioto

Joined Dec 31, 2017
8,633
  • (1)Long press to power ON
  • (2)No shutdown by long press (disable this feature)
  • (3)Shutdown from the Raspberry Pi side should remain the same (pulling P7 to GND)
Alternate suggestion using a 555 for the delay circuit.
Long press duration determined by the C1-R1 time constant
1757990301114.png
 
Last edited:

panic mode

Joined Oct 10, 2011
4,864
Of course, use the software to provide the delay. Duh!
exactly... software is used anyway to control the GPIO, and depending on PI version and overhead (use GUI or not), boot times can differ... if my memory serves the usual range is 0.5-2sec. so adding delay in software can do the trick and make hardware simpler.
 

Thread Starter

hmzblgn

Joined Sep 15, 2025
6
swap places of 100k and 1uF at the left side...
that should eliminate short press and at the same time, long press will used to turn it on (capacitor need to charge to activate mosfets).
initially capacitor will be discharged as before. but it will keep the MOSFETs off. that is until button was on for long enough to charge the capacitor.
after that everything is the same...

View attachment 355926
Thank you ! Really appreciated!
I tried that, I used 1 Mohm instead of. 100k and 47 UF instead of 1UF. Then i get 2-4 sec of delay. Is that normal (so big resistor and big capacitor, in teory it should be possible with smaller res and capacitor.
And another issue, If you press shor short 10 time it charges the capacitor and starts that way to (not a very big issue but would be better without this)
 

Thread Starter

hmzblgn

Joined Sep 15, 2025
6
Alternate suggestion using a 555 for the delay circuit.
Long press duration determined by the C1-R1 time constant
View attachment 355931
Very good idea, let me think.
ps: I dont want to change right side of the mosfet because it works really good! It gives couple of sec of time till the shutdown and then cuts the current of raspberry. So I shutdown and when the GPIO is negative system still have couple of sec to safely close the rest.
 

sghioto

Joined Dec 31, 2017
8,633
Really? My read of the problem is to delay powering on the uC after a button press, so how can an unpowered uC produce a software timer to enable its own power?
ak
By delaying the latch output from GPIO 4.
The program does not advance until GPIO 4 goes High.
 

AnalogKid

Joined Aug 1, 2013
12,043
Question to the TS:

Is the goal of the circuit to delay power to the uC, or to delay operation of the uC when it has power?

A corollary question: Are other circuits/things besides the RPi being powered through this switching circuit?

ak
 
Top