Home » ControlBlock – Power Switch and Original Controllers

ControlBlock – Power Switch and Original Controllers

ControlBlock – Power Switch, and Original Controllers for the Raspberry Pi™

Overview

The ControlBlock is an extension board for the Raspberry Pi™ versions 1/2/3 and models A/B+. The two key features of the ControlBlock are

  • a power switch functionality to safely shutdown the Raspberry Pi and
  • general purpose input/output (GPIO) pins for connecting original game controllers for arcade machines and various game consoles.

The power switch functionality allows to turn on and off the power to the Raspberry Pi with a toggle switch without the risk of data loss. You can also connect a status LED for indicating the power status of the Raspberry Pi.

The ControlBlock makes it very easy to connect arcade controllers or console controllers, for example, for (S)NES, Atari, Genesis/Megadrive, or Sega Master System consoles. Up to two players are supported by a single ControlBlock. Stacked upon each other, up to four players are supported. The open-source driver for the ControlBlock can be configured to your liking.

The whole thing comes fully assembled with open-source drivers that are easy to install. If you are interested in getting the ControlBlock for your project, it can be ordered here.

“Truly, it took this project to the next level. I can’t recommend it highly enough.” LINUX Journal

Feature Details

Power Switch

The power switch functionality allows you to turn on and off the power to the Raspberry Pi with a toggle switch (A toggle switch is not part of the ControlBlock). The ControlBlock comes with a USB Micro socket. You can optionally solder a USB-B socket to the ControlBlock, if you need a larger connector for your project (A USB-B socket is not included in the package). Any toggle switch can be connected to the ControlBlock, which allows you the biggest flexibility for your project.

The power status of the Raspberry Pi can be indicated via an LED that can be connected to male pin headers.

Game Controllers

The GPIO pins can be accessed from the Raspberry Pi via the SPI interface. The ControlBlock makes it very easy to connect arcade controllers for up to two players. The open-source driver for the ControlBlock can be configured for various controller types. These controller types are supported:

  • arcade controllers as gamepads
  • arcade controllers as MAME keyboard
  • SNES and NES controllers (including reset button) as gamepads
  • Atari controllers as gamepads
  • Sega Master System controllers as gamepads
  • Genesis/Megadrive controllers as gamepads

Detailed setup instructions can be found below and on the driver site.

Hardware Interface

Here is a top-view of the ControlBlock PCB:
Top view of the ControlBlock

Details about the hardware interfaces of the ControlBlock are given below:

2x13 stackable pin header as connector to the Raspberry Pi

2x13 stackable pin header as connector to the Raspberry Pi

The ControlBlock PCB is attached to the Raspberry with a 2×13 stackable pin header. This header is used for connecting the voltage and ground pins as well as the SPI-relevant pins between the RPi and the ControlBlock. The PCB is prepared for breaking out all other pins of that header so that you can easily access all other pins that are not used by the ControlBlock.

Micro USB or B-Type Power Supply

Micro USB or B-Type Power Supply

Just as the Raspberry Pi the ControlBlock provides a USB micro connector for the power supply. That means you can use your existing USB Micro cable. As an alternative you can optionally solder a USB-B socket to the ControlBlock that can be used as input for power supply.

Pin Outs for 5V Power Supply

Pin Outs for 5V Power Supply

If you do not want to use USB connector, GND and the 5V supply voltage can also be accessed via two pins so that you could use batteries or whatever you like for power supply.

Pin Outs for a Power Toggle Switch

Pin Outs for a Power Toggle Switch

To control the power state of the Raspberry Pi the ControlBlock provides an interface for attaching a toggle switch. The on-board microcontroller monitors the state of that switch as well as the one of the Raspberry. It safely shuts down the Raspberry without any risk of data loss.

Pin Outs for Status LED

Pin Outs for Status LED

The current power state can be indicated with a 5V status LED that can be attached to the two pins that are provided by the ControlBlock. These states can be “off”, “booting”, “on”, and “shutdown”. The different state are indicated with easy-to-distinguish static and pulsing patterns.

Additional 2x16 GPIO Pin, Game Controllers

Additional 2x16 GPIO Pin, Game Controllers

Two GPIO expanders on the ControlBlock provide 32 additional GPIO pins for arbitrary usage. With revision 2.X of the Raspberry Pi, these pins can be accessed via the SPI interface of the Raspberry Pi (With revision 1.X of the ControlBlock, these pins can be accessed via the I2C interface with the I2C addresses 0x20 and 0x27). You can use the provided ControlBlock driver to easily connect various original game controllers. For this, the top silkscreen of the ControlBlock PCB is marked with pin outs for players 1 and 2.

In-Service Programmer (ISP) Pin Outs

In-Service Programmer (ISP) Pin Outs

The power switch logic is implemented with the help of an Atmel ATtiny85 micro controller. You have the possibility to access the microcontroller with the ISP header. In this way you could reprogram the microcontroller with whatever functionality you like.

GPIO Pins Used by the ControlBlock

GPIO Pins Used by the ControlBlock

The ControlBlock uses these GPIO pins of the 40-pin header of the Raspberry Pi: 3.3V (pin 1), 5V (pin 2), GPIO 17 (pin 11), GPIO 18 (pin 12), MOSI (pin 19), MISO (pin 21), SCLK (pin 23), CE0 (pin 24).

Getting Started – Hardware Setup

Attaching a Power Supply

Attaching a Power Supply

Attaching the power micro USB power supply to the ControlBlockIf you want to use the power switch function of the ControlBlock you need to connect your (micro USB) connector only to the ControlBlock – and not to the Raspberry Pi directly. Alternatively to the micro USB connector you could also use the USB-B pin outs for soldering a USB-B connector to the ControlBlock. Also, you could use the 5V and GND input pins for power supply.

Attaching a Power Toggle Switch

Attaching a Power Toggle Switch

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

  • It is important that you use a toggle switch and not a momentary button with the ControlBlock. 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/controlblockconfig.cfg by setting “powerswitch”: false.
  • The power switch circuitry of the ControlBlock 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.

Attaching a Power Status LED

Attaching a Power Status LED

ControlBlock with status LED and power switch
ControlBlock with status LED and power switch

The ControlBlock 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.

Connecting Game Controllers

Connecting Game Controllers

Bottom view of the wooden demo arcade controllers console with the ControlBlock.The cables of the arcade buttons, joysticks, as well as of the (S)NES or all other gamepads are connected to the ControlBlock via the screw terminal blocks. You need a slotted screwdriver with a maximum width of 2.5 mm for that.

Detailed instructions for the individual controller types are given here.

Getting Started – Software Installation

You need to install the ControlBlock driver to enable the power switch and game controllers functions. You find detailed instructions for the driver installation here.

Links

Videos

Power Switch Functionality

Arcade Controllers

The the following demonstration video shows arcade controllers for two players that are mounted on a simple wooden console. The hardware setup including the wiring looks like this:

Bottom view of the wooden demo arcade controllers console with the ControlBlock.

This video shows the controllers in action:

SNES Controllers

Posts about the ControlBlock

Quick Installation Script for the ControlBlock - We realized that the installation of the ControlBlock driver could be simplified. Therefore, we created an installation script that does ... Read More
ControlBlock Update Update for the ControlBlock Driver with Many New Features - We just released an update for the driver of the ControlBlock! What does this mean for you? More functionalities! More ... Read More
Python module for MCP23S17 for use with the Raspberry Pi - Some time ago I revised the hardware design of the ControlBlock and added test points for all major signals. The ... Read More
Supply Status of the ControlBlock - This info post is interesting for you, if you were looking at the ControlBlock and wondering when it will be ... Read More
ControlBlock: Power Switch, Game Controllers, and I/O for the Raspberry Pi - First: What is a simple solution for turning the Raspberry Pi on and off with a power switch in a smarter ... Read More
%d bloggers like this:
Skip to toolbar