PowerBlock – The Safe Power Button for the Raspberry Pi

PowerBlock
The PowerBlock is a Safe Power Button add-on board for the Raspberry Pi. It allows you to conveniently turn on, as well as, turn off the power to the Raspberry Pi with a toggle or momentary button.

Instead of just cutting the supply voltage with the risk of data loss the PowerBlock ensures a safe shutdown without the risk of any data losses that could occur otherwise.

Furthermore, an LED that you can optionally attach to the Powerblock indicates the power status at all times.

 Demo Video

 Features and Technical Specifications

  • Supports toggle and momentary switches
  • Automatic detection of switch type
  • Smooth power status indication via optional external LED
  • Micro USB connector for power supply
  • 2×6 pin header for mounting on the Pi
  • USB-A break out pins for optional USB-A power out connector
  • Software daemon for clean shutdowns
  • Optional pin outs for arbitrary 5V power supply
  • Optional DC Barrel Jack
  • No soldering required
  • Input Voltage: 5V
  • Output Voltage: 5V
  • Continuous Current @ 25°C: maximum 3.7 A
  • MOSFET Static On-Resistance: 0.065 Ω

Any toggle or momentary button can be connected to the PowerBlock. The type of switch is automatically detected. The power status of the Raspberry Pi can be indicated via an optional status LED.

You can order the PowerBlock here:

What our customers say

Works great! I have no clue with linux, managed it with your 1 line install.
I’d recommend to everyone.

Will Laughlan ,

Very neat little add on that “does exactly what it says on the tin”. Well made and sits nicely, was very easy to implement and get working.

Would recommend this product and was a smooth and easy transaction.

Charles,

I bought the PowerBlock for part of my project i was building a Super Nintendo Pi. The product arrived swiftly, was easy to setup and works great, just what i needed. Would recommend.

Chris,

 Further Details

The PowerBlock provides a Raspberry Pi power switch functionality. Why is it useful? The Raspberry Pi comes without a power switch. As soon as you plug the micro USB cable into the RPi, it turns on. If you want to shutdown the Raspberry Pi, you need to call a shutdown command to bring the system into a state in which you can safely remove the USB cable again. If you just pull out the micro USB cable the file system of the RPi might become corrupted and you risk loosing data.

Here, the PowerBlock comes into play. It is stacked onto the GPIO header of the Raspberry Pi and provides a USB connector itself, a connector for a power button to control the power supply of the Raspberry Pi, and a connector for an optional LED to indicate whether the Raspberry Pi is off, booting, running, or shutting down. A micro controller on the PowerBlock board manages the power supply  and monitors the button state as well as the state of the Raspberry Pi. The driver ensures that a safe shutdown is initiated when you switch to “off”.  This also means that you do not need to plug and unplug the USB cable from the Raspberry anymore if you want to completely and safely turn it off.

 Hardware Interface of the PowerBlock

Here are a top and bottom view of the PowerBlock PCB:

Mechanically Compatible with Raspberry Pi Models A, B, and Zero

The dimensions exactly match the mounting holes of the Raspberry Pi and can be mounted to the Raspberry Pi models A, B, and Zero.

Mechanically Compatible with Raspberry Pi Models A, B, and Zero

2x6 pin female header as connector to the Raspberry Pi

This header makes use of pins 1 to 12 of the GPIO header. The PCB is kept as small as possible so that you can easily access all other pins that are not used by the PowerBlock.

2x6 pin female header as connector to the Raspberry Pi

PowerBlock Connector for RPi

Micro USB Connector for the power supply

The PowerBlock has a USB Micro connector.

Micro USB Connector for the power supply

PowerBlock micro USB connector

Pin Out for a toggle or a momentary Switch

To control the power state of the Raspberry Pi the PowerBlock provides an interface for attaching a toggle or a momentary switch. The on-board microcontroller monitors the state of that switch as well as the one of the Raspberry.

Pin Out for a toggle or a momentary Switch

PowerBlock Pin Outs for Power Switch and Status LED

Pin Out for Status LED

The PowerBlock indicates the power state of the Raspberry Pi an optional 5V status LED. It can be attached to the two dedicated pins. These possible states can be “off”, “booting”, “on”, and “shutdown”. The different states are indicated with easy-to-distinguish static and pulsing patterns.

Pin Out for Status LED

PowerBlock Pin Outs for Power Switch and Status LED

Signal breakouts for input voltage, output voltage, and control signals

There are individual pin outs for the 5V input and output voltages, as well as for the control signals S1 (pin 12), and S2 (pin 11).

Signal breakouts for input voltage, output voltage, and control signals

PowerBlock Signal Break Outs

In-Service Programmer (ISP) pin-out for ATtiny

The PowerBlock makes use of an ATtiny85 microcontroller. You can access the microcontroller with the ISP header to reprogram it with whatever functionality you like.

In-Service Programmer (ISP) pin-out for ATtiny

PowerBlock in-service programmer interface

 Getting Started with the PowerBlock – Hardware and Software Setup

PowerBlock with Attached Power Switch
To turn the Raspberry Pi on and off with the PowerBlock you need to attach a toggle switch to the two button pins on the PowerBlock. How does the PowerBlock work then? Technically speaking, the microcontroller on the PowerBlock looks, if the two pins of the switch are connected or not. If they are connected, a GPIO pin of the microcontroller on the PowerBlock is pulled to GND and interpreted accordingly.

  • It is important that you use a toggle switch and not a momentary button with the PowerBlock. Otherwise the Raspberry Pi will be turned off again right after booting.
  • If you do not want to use the power switch functionality you can disable this in the configuration file /etc/PowerBlockconfig.cfg by setting “powerswitch”: false.
  • The power switch circuitry of the PowerBlock leads to a tiny voltage drop and we made the experience that a good quality power supply and a good quality USB cable are mandatory for a working setup. If unsure, we can recommend the official Raspberry Pi Power Supply.
PowerBlock with Attached Status LED
The PowerBlock has pin outs for an optional status LED that indicates the power state of the Raspberry Pi. You can directly attach an LED to the pins that are marked with “LED”. You need to pay attention to the polarity of the LED: The LED pins are marked with “+” and “-” for that.

The LED will blink in four different patterns that depend on the power state of the Raspberry Pi:

  1. Off: The LED is simply off.
  2. Booting: The LED slowly fades in and out.
  3. On: The LED constantly stays on.
  4. Shutting down: The LED fades in and out twice as fast as during boot up.
PowerBlock with attached micro USB cable
You need to connect your micro USB cable only to the PowerBlock – and not to the Raspberry Pi directly. Alternatively to the micro USB connector you could also use the 5V and GND input pins for power supply.

For the software installation please follow the instructions from the driver website.

 Related Posts

  • Emteria

PowerBlock: A Safe Power Button for Emteria.OS

If you are looking for a power button solution for your Emteria.OS project that makes use of a Raspberry Pi then look no further: The PowerBlock now supports Emteria.OS. Emteria.OS describes itself [...]

  • PowerBlock RPi 4 compatible

Our Boards Compatibility with the Raspberry Pi 4

The Raspberry Pi 4 was recently released. This post is about our boards and their compatibility with the Raspberry Pi 4. Are our extension boards like the PowerBlock or the ControlBlock compatible with it? The [...]

PowerBlock now with Support for Windows 10 IoT Core

Windows 10 IoT Core is Microsofts offer for developing embedded devices while staying within the whole Microsoft ecosystem. Besides various other hardware platforms you can find the Raspberry Pi as one of those boards that [...]