Skip to content
Dan-in-CA edited this page Jun 11, 2017 · 21 revisions

A simple DIY relay interface

If you don't mind a little soldering you can build this simple but reliable circuit to connect 5V relay boards to your Raspberry Pi. This works with SIP without any software modifications. The interface uses only 4 GPIO pins (plus one for power and one for ground) allowing you to connect other devices to your Pi.

There are only a few inexpensive conponents needed:

  • 74HC595 Shift Registers
  • a few pin headers
  • some jumper wires
  • a 0.1 microfarad capacitor (optional)
  • a bread board, perf board or other support
  • a 10k Ohm resistor if you will be using active low (low level trigger) relay boards

You can get them from most electronics parts suppliers. For example Adafruit sells a 3 pack of 74HC595 chips for $2.75.

The diagram below shows a breadboard layout that supports up to 24 stations.

shift register layout

Each 74HC595 shift register allows you to connect 8 relays. You can chain as many shift registers together as needed.

Note: This shift register interface can work with either active high (high level trigger) or active low (low level trigger) relay boards. If you are using an active-low relay board such as those from SainSmart you will need to check the Active_Low Relay box under Station Handling on SIP's Options page. This enables the proper output mode for active low boards.

If you need to increase the number of stations that SIP displays you can do so by increasing the number of Extension boards also under Station Handling. 0 for 8 stations (the default), 1 for 16 station 2 for 24 stations etc.

Be sure that all relay boards attached to this interface are of the same trigger type.

If you will be using a large number of stations, especially if more that a couple of relays will be on at the same time, you should consider adding a separate power supply to run the relays.

Clone this wiki locally