Simple Button Circuit to Power ON & Safely OFF Raspberry PI @Kevindarrah
Simple Button Circuit to Power ON & Safely OFF Raspberry PI  @Kevindarrah
Uploaded July 2018 | Updated September 2026, 2 weeks ago
Pretty cool one here I came up with. Starting with this simple latch circuit I talked about a while back: youtu.be/SntdiUYmp4s

NOTE! Put a 1k resistor right at the base of those two NPN transistors. You never want to have two transistor bases tied together like that.

I wanted to use this to power up my raspberry Pi project, which is pretty easy, but I also wanted to use this to power down as well. Since you can't just kill power suddenly to the Pi, I enabled GPIO21 to go HIGH after a safe shutdown:


sudo nano /boot/config.txt
Adding in this line at the end:
dtoverlay=gpio-poweroff,gpiopin=21

Then from the processing sketch be able to monitor that same pushbutton and determine when to execute the shutdown command. That code zipped up here:
kevindarrah.com/download/laserTargetApp_7_8_18.zip

And the pinout for the GPIO Header: https://pinout.xyz

Oh and make sure to check out the last video on exactly how I got the Pi setup the way you see it in this video: youtu.be/4vdnGZWjBTk

Check out my Tindie store (trigBoard is available) tindie.com/stores/kdcircuits

Thanks to all the Patrons for dropping a few bucks in the tip jar to help make these videos happen!
patreon.com/kdarrah

Twitter: twitter.com/KDcircuits

For inquiries or design services:
kdcircuits.com
Simple Button Circuit to Power ON & Safely OFF Raspberry PIWhats my Patreon all about?  WARNING - Not a Tutorial Video!CDC changed the format for the COVID 19 data - from JSON to CSVMicro AI Image Viewer!  Download from DALLE with ESP32 on the vPlayer!Cheap and Easy WiFi (IoT) Tutorial Part 1 - ESP8266 Setup/IntroEasy way to Solder Surface Mount Parts! - How I do itRecovering the BLE Boards Bootloader & Production Test WalkthroughLow Power Arduino! Power Supply Considerations p12uA Ultra low Power Motion Sensor that Plays mp3 Files and Sends Notifications - ESP32 (trigBoard)Level Shifting Tutorial 5V-3.3V Quick and Dirty MethodsText String Tutorial in C Code!  Tutorial using Arduino, copy/move/parsing/etc...Introducing the Ultimate In Low Power WiFi - trigBoard v8!
Kevin Darrah |

Simple Button Circuit to Power ON & Safely OFF Raspberry PI

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER