Modified version of EEVblog #262 - World's Simplest Soft Latching Power Switch Circuit
https://youtu.be/Foc9R0dC2iI
The goal is that the user should be able to switch on/gracefully shut off the Raspberry Pi using a single momentary pushbutton. Push once to switch the power on, push again to signal to the Rpi to shutdown. The lamp symbolises the power to the Rpi. The LED means a signal to Rpi ( connected to a GPIO pin ), that the shutdown process should be started. After the shutdown process finished, the Rpi set an other GPIO pin to high, and cut off the power ( this output pin is symbolised with the logic source. )