Raspberry Pi - ATX Power Supply
Raspberry Pi (RPi) is miniature ARM based Linux computer. It has HDMI, TV and Audio outputs, Audio input, 2xUSB-A, 1xRJ45 and Extension Port with GPIO and communication ports for user applications. It is small, powerful, cheap ARM based board developed as learn-how-to-program tool for children. However, hardware itself is stripped to minimal configuration and some important functions must be done externally. Proper power management is one of them.
RPi Power Management problem
RPi is usually powered by wall power supply adapter with +5VDC/1A output. Once power cord is plugged in, RPi starts booting and after while Linux desktop appears. Once 'System Shutdown' signal from Linux is send, shutdown routine is activated and computer goes into stand-by mode after some time. In stand-by mode, little power is still consumed. Keyboard and/or mouse and monitor must be connected to the RPi to properly handle shutdown. To boot RPi again, power must be toggled OFF-ON manually. Therefore manual power switch must be installed or 'adapter plug/unplug' must be performed to boot system again. And this is small flaw in current RPi configuration.
Linux Boot/Shutdown sequence
Linux as almost all other operation systems does not like hot unplug of power supply. During this event loss of data or data corruption may occur. Thus is strongly recommended to perform proper Boot/Shutdown sequence via Linux 'System shutdown' command. This task is easy when monitor, keyboard and/or mouse are present. But, if RPi is used as embedded, single task computer, this operation become very difficult.
RPi ATX Power Supply
Problem can be easily solved by using miniature RPi ATX power supply snap-in board. This simple piece of hardware is equipped with microcontroller, solid state overcurrent protected switch, LED indicators and push button. Original Mini USB power cable is connected to ATX-PS board instead of RPi itself. When push button is pressed for time period longer than 2s, RPi powers-up and boots into Linux environment. If user decides to shutdown RPi, push button needs to be pressed for 2s again. LED indicator starts toggle and 'System Shutdown' signal is sent to Linux. After RPi goes to Stand-by mode, power supply is disconnected and RPi board is completely powered off.
This 'One button' solution has obvious benefits once RPi is used as embedded computer or even if user is lazy to issue Shutdown command via mouse or keyboard. There is also additional 2 pin connector for external +5VDC power supply connection. Why? Because I am not big fan of USB-Micro connectors and want to have option for connection of another power source as well.
There is extended version of PRi-ATX-PS called PRi-ATX-PSE. This board accepts input voltage range from +6VDC to +24VDC and generates +5VDC/1.5A for RPi and periphery supply. Extended input power range is very handy once RPi is powered from batteries or another power source. Cars or industrial installations are good example. Frozen RPi can be restarted by pressing bush button longer than 5s.
RPi ATX-PS installation
ATX-PS is snap-in board with 26way connector on one side and fixing hole 3.2mm on other side. One M3 bolt and 10mm spacer are holding board in place. There is possibility to add (solder) additional 26way connector with 1:1 connection in case user wants to preserve all extension GPIO pins for his own application. There is only one restriction in this setup. Pin GPIO4 – P7 is used for system shutdown and can not be used by other user applications.
Software ATX-PS installation
Simple script issuing ‘Shutdown –h now’ is monitoring ATX-PS board and once power off request from board is given, command will be executed. Short script uses native Linux commands and standard memory access. No Python interpreter or additional libraries like WiringPI, BCM2835 or others are needed.
USB Powered Hubs
There is no need for USB powered hub to supply power to your RPi. Wifi dongle, keyboard, optical mouse or any other standard RPi accessories can be powered directly from RPi now. Power from ATX-PS is routed to P1-2,4 as signal +5V0 and connected directly to USB connectors. But if you still need to use USB powered hub, then use RPi as a Host, without supplying external power to the RPi board.