Intelligent Power Switch for Raspberry Pi
Posted on behalf of Peter Boxler
A Raspberry Pi does not have an On/Off switch and there is no easy way to shutdown the Pi while keeping the file system 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 single 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.
This project description presents an elegant solution for the problem of switching the Pi on and off. The goal was to have a small PCBoard whose functionality can be described as follows:
- one push button only for power on and power off
- form factor as a Raspberry Pi hat for ease of use
- only one communication line to and from the Pi – in other words, only one GIPO pin used on the Pi
- awarness of the Pi‘s status (running or not running)
- square signal output capability with variable/de ned frequency to be used as a timer interrupt for the Pi
- later versions usable on a breadboard.
The application paper on the iSwitchPi, the intelligent Power Switch for Raspberry Pi, is a detailed 13 page document that was previously published on the internet and to which you can find the link here!