Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PluberryPi resource for shutdown and IR GPIOs

Setting up Shutdown and IR GPIOs

From PlusberryPi indiegogo uptade of Oct 24, 2015 at 10:02PM

There's also an Arch Linux AUR package

People are already getting their units, and ask about how to setup the GPIO connectors. Sorry for the "getting started" page not up and running yet, here are the instructions for now (the site will be up in the coming days).

Shutdown Pin

Basically, you can use any available input, but this example will use pin #24.

There is a connector with 3 wires (blue/black/green) coming from the left of the Plusberry board (it's labeled "UART").

Connect the BLUE wire to pin #24 according to the diagram -


When you press the power button (short press), the GPIO will go from high to low, signalling the RPi to shutdown.

Now, of course, you need to write a script to actually shutdown the RPi when getting the signal.

This is a sample script for OpenELEC, to put at /storage/.config/


# monitor GPIO pin 24 (wiringPi pin 1) for shutdown signal
echo "24" > /sys/class/gpio/export
# export GPIO pin 24 and set to input with pull-up
echo "in" > /sys/class/gpio/gpio24/direction

# wait for pin to go low
while [ true ]; do
  if [ "$(cat /sys/class/gpio/gpio24/value)" == '0' ]; then
    echo "Raspberry Pi Shutting Down!"
    halt &
    exit 0
  sleep 1

Now, add it to, so the script will run when booting the system -

  /storage/.config/ &

Setting up IR Remote

There are 3 wires (blue/black/green) coming from the IR sensor attached to the front of the box.

Connect these 3 wires according to the diagram -


Now, setup the different key according to this tutorial

You can see a more complete list of key names here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment