Slice Of Relay Documentation

This board was designed for the first generation of Raspberry Pi and the company who produced and sold has disappeared.


This board has the optional headers installed so you can stack or extend the GPIO bus.

This information and whatever files and schematics we have here are merely an attempt to save the information from disappearing. I hope it helps someone some day.

I located the old document on the wayback machine and I was very happy as I could not find this document anywhere and I had lost my copy. I dusted off the Slice of Relay board recently as part of the effort to document everything I had been doing.

I realized that much of the earlier Raspberry Pi accessories had disappeared including the companies that had produced them. The documentation for much of these add-on boards has disappeared as well.

I have taken the original document and copied the schematic into a separate schematic in both PDF and jpg form.

Here is a graphic image (jpg) of the schematic in as high as resolution as possible. Click on the image to expand and then right-click to save.


Here is the schematic-only in pdf format.


Here is the entire document with some programming examples and instructions.



GitHub Repo for Quick GUI example for turning the Relay's on and off Here is a copy of this repo

Wiring Pi - GPIO Interface library for the Raspberry Pi See
Here is a copy of the repo:

Here is a copy of this repo:

Example Python Code (for RPi.GPIO)

import RPi.GPIO as GPIO
import time

GPIO.setup(18, GPIO.OUT, initial=GPIO.HIGH)
GPIO.setup(22, GPIO.OUT, initial=GPIO.HIGH)
print "Start : %s" % time.ctime()
time.sleep( 5 )
print "End : %s" % time.ctime()

Example Shell Commands

# GPIO 24 and GPIO 25
echo "24" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio24/direction
echo "1" > /sys/class/gpio/gpio24/value # relay A on
echo "25" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio25/direction
echo "1" > /sys/class/gpio/gpio25/value # relay B on
sleep 10 # delay 10 seconds
echo "0" > /sys/class/gpio/gpio24/value # relay A off
echo "0" > /sys/class/gpio/gpio25/value # relay B off

As you can see using the relay board is easy!

Example Relay Control System


This python script is more advanced and was used for a breadboard test I was running with reading dip switches to both control and configure a nonexistent "machine" that needed a load switched on for a configurable period with the relay off time also configurable. It loops reading GPIO 23 until it is high. This means the dip switch A #1 was set to on on the PCB. The relay will continue to cycle 5-seconds off and 5-seconds on. Those values are of course easily changed in the script to meet your particular requirements. This script is easily expanded to include both relays (Slice of Relay!) and perhaps even sequence them as needed. In this example the dip switch could be some other sensor or momentary switch or magnetic door sensor, etc, Real Hackers create hardware and software, they have to write their own code, ahem.

# free code 
import RPi.GPIO as GPIO
import time
# Testing Loop
# GPIO 23 has a dip switch with 3.3v being switched on (logic 1) which enables the relay
# to cycle. 

while True:

        print "Begin : %s" % time.ctime()
        mode = GPIO.getmode()
        print "Mode is %s" % mode
        GPIO.setup(16, GPIO.IN)
        # Relay A
        GPIO.setup(18, GPIO.OUT, initial=GPIO.LOW)
        # Relay B
        GPIO.setup(22, GPIO.OUT, initial=GPIO.LOW)

                while True:

                        if GPIO.input(16):
                                print"GPIO 23 is high"
                                GPIO.output(18, GPIO.HIGH)

                                print "Activating Relay A 5-seconds"
                                print "Check: %s" % time.ctime()
                                print "GPIO 23 is low"
                GPIO.output(18, GPIO.LOW)
                print "End : %s" % time.ctime()