User avatar
Posts: 50
Joined: Sun Dec 28, 2014 12:57 pm
Location: Vienna - Austria
Contact: Website

Re: HOW-TO Start/Stop/Powerdown Pi with 1 Button

Sun Oct 16, 2016 4:56 pm

Works like a charm!
Thank you very much for sharing.
Check out for many beginner-friendly tutorials!

Posts: 1
Joined: Tue Jan 09, 2018 1:18 pm

Re: HOW-TO Start/Stop/Powerdown Pi with 1 Button

Tue Jan 09, 2018 1:35 pm

Hi Paul,

I've been reading this great thread and am excited to implement this. Can you please help me discover what I can do to use this circuit for the same purpose with using this as a substitute for the LM regulator.

The EN has no impact when not connected. I've run a Pi 3B with OctoPi image for a couple days and this converter handles the current draw with no noticeable strain on the device so I am very encouraged. However, it seems the configuration requires EN to connect to GND to shut this off.

What can I change to make this work? It's soldered across the 5V jumper and is using 12V in from a RAMPS board.

TIA and this is a great thread!


Posts: 558
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: HOW-TO Start/Stop/Powerdown Pi with 1 Button

Tue Jan 09, 2018 7:11 pm

Hi Alan,

The link you provide does not seem to go where you intend it to go. It gives me no clue to what you're using.
In any case, it could very well be that your EN pin has the logic inverted. With my example, the EN is tied to ground in the standard configuration. In that xase, the output is enabled. If you pry it loose from ground and tie it to a "high" signal, it will disable the output. There are devices that work that way, but with inverted levels. A high disables, and a low enables.

You should be able to verify this with your "device". Just give it a try. Be aware that a "high" may not be a logical TTL high, so you may have to use a higher voltage. Check the datasheet of your device to make sure.

Good luck!


Posts: 1
Joined: Tue Feb 27, 2018 3:57 pm
Location: Germany

Re: HOW-TO Start/Stop/Powerdown Pi with 1 Button

Tue Feb 27, 2018 4:05 pm

Hello Paul,

this is a very good solution especially because it uses 2 GPIo's of my choice.
One problem I have:
How to deal with changing input voltage and the calculation of R8.

The background:
I'm planning a testing platform for arduino, the Pi of course and some other devices.
Therefore I need different voltage supply AND I want to have two choices for the power input.
One 12V wall-wart (with no problems regarding to your circuit) and one with a voltage
going from about 14 to 30V.When working with it I decide which I need. So far so good.
(At the moment I'm still waiting for the Buck converters.)

Calculating the R8 with 12 V its 1.5kOhm but with 30V it becomes 5,3k. when I decide to use a 2,5k
resistance as a good average I will get the regarding currents of 11mA (30V) and 3,5mA (12V).
Would this be OK for the GPIO? If not, what is the maximum current the zener should get?


When I use: ... 012151.htm
I get the following, what shows that the max. diode power (often 500mW) should be known as well as
the load current of the GPIO when active.
I tried to calculate it but I get very different results:
P_tot=500mW / U_z=3,3V / U_ges=12V ==> I_z-max=0,15A, I_z-min=0,015A (theor.), I_ges=0,02A (with estim. load 0,005A)
R_v=435Ohm <==> differs from 1740 Ohm.
By the way, with a 100mW diode its getting more close to your values.

Can you say what the load current is? But the higher it is the lower R8 has to be. Confusing for me.
And more confusing that your circuit works obviously. ;-)

Many greetings and thanks!

Posts: 558
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: HOW-TO Start/Stop/Powerdown Pi with 1 Button

Wed Feb 28, 2018 8:43 am

Hi Uwe,

I'm glad you like it.

Actually, the best and safe solution for you would be to use a 78L05 voltage regulator, which is a voltage regulator in a TO-92 package. You can give this just about any voltage between 2V above the output value all the way up to 40V. I'm mentioning 2V above the output because these regulators come in different versions. With your 12V DC wall-wart, I would select a 10, 8 or 5V version.

I hope this tip helps.


Posts: 1
Joined: Tue Sep 18, 2018 11:38 am

Too Sensitiive!

Tue Sep 18, 2018 11:43 am

R3 should be more like 20K. If you use 10K, the voltage level at the pin used to detect a falling edge hovers right around 1.2V. So the baseline level is in the GPIO input pin's transition region, which is not stable. Using 10K, I found that the circuit was not tolerant to static, resistance value variation, input voltage/load variation. All of those things caused the Pi to think the button had been pressed. Instead of 10K for R3, using 20K parks the baseline level around 1.5V, which is safely above threshold. A touch of the button is easily detected, but false detections are greatly reduced.

Return to “Beginners”