If you are looking for a convenient way to power on or off your Raspberry Pi mini PC you may be interested in a new intelligent power switch and control board HAT called iSwitchPi, which has been created specifically for the Raspberry Pi.
Created by Peter Boxler the source code and EagleCAD files are available via GitHub, and he has also created a thorough PDF manual which is available in both English and German from the official site below.
A Raspberry Pi does not have an On/Off switch and there is no easy way to shutdown the Pi while keeping the filesystem intact. This Intelligent Power Switch brings a clever solution to this problem: Power-On the Pi by pressing a pushbutton and also properly power-off the Pi with another press on the same button.The intelligence is provided by a program running in an AVR MCU ATtiny44. This C-program implements a Finite State Machine in the MCU.
A small Python script is running in the Pi itself. Just one GPIO-Pin is used for two-way communication between the Pi and the iSwitchPi board. The iSwitchPi board additionally provides a square wave output with variable frequeny that can be used to trigger interrupts on the Pi.
For more information on the new iSwitchPi jump over to the Peter Boxler website for details by following the link below.