Relay PCB for Raspberry PI

It has been a while since i have posted something here. The main reason is that i was learning openhab and raspberry pi and the work i was doing on my prototype for the heating of my house.

It all started with this thread were i started to make a heating for my house which will make it possible to control the temperature in every room independently.

As soon as i had a working prototype i wanted to tidy this up so i designed a PCB to control the different relays i was using for the control of the floor heating valves, the boiler (heating) and the pump.

I just wanted to show you what i made, i put it in operation today and everything tested oke so far.

The way it works is that you connect your Raspberry Pi to the PCB via a flat cable. The relays now can be controlled via GPIO22/23/24/25/27. You also can access GPIO2/3/4/14/15/17 via the pin header.
With the additional connector it is possible to connect a second relay board with also 5 relays and these relays can be controlled via GPIO7/8/9/10/11.

The relay board can be powered via usb or via the power jack (5 Volt). If JP1 is closed the Raspberry Pi is also powered via the flat cable so no additional power adapter is needed. Remark: If the power is shared in this way, you are not isolated. The board is equipped with opto-isolators so if you want to be optically isolated you have to remove jumper 1 and power the relay board and the Raspberry separately.

The board has the NC and NO connection from every relay but i only placed a 2 pin connector for the connection i use in my heating setup.

Finally i printed a “Housing” were the PI and the board can sit in and i can mount it easily.


That’s some great work Richard! If you’re looking for a way to control them from a different Raspberry Pi than the one you’re running check out MQTTany.

Thanks for the tip. MQTT is one of the things i will explore in the nearby future. I first want to optimize my current setup, am still on a learning curve for openhab and home automation.
I want to use MQTT for my Sonoff modules.

Some additional info:

The valves for the floor heating are controlled by the Honeywell MT-4. These require 230Vac and are controlled via the relays on the board. I have 3-zones floor heating and these are Livingroom (woonkamer), Halway (gang) and Kitchen (keuken).

One of the relays is to control the pump for the floor heating, this one is also 230Vac.

The 5th relay is to control the boiler (cv-ketel) and this will start to heat the water in the heating system.

I’m using Espurna firmware for my Sonoffs

I have to repeate my question from the other thread.
Is the swicthes potentialfree ? (it looks like it). I guess they´re used to control an external relay/something, which will feed the Valves? Cause I dont see how your board is able to feed 230volt to the Valves with just a switch.

The relays have a potential free contact and the Live wire (L1) is connected to this potential free contact and then to the valve. The neutral wire is connected to the valve directly. See schematic below.


1 Like

I am not familiar with Espurna but i will check it out. Thanks.

Ahh thats the part I didn´t understand :slight_smile:

If you have any other questions, just let me know.

How many boards can be connected together? (I have 13 zones heating system :slight_smile: ).

At the moment you can connect 2 boards with band cables which gives you 10 relays, but you can also use the GPIO’s on the header pin which gives you an additional 6 GPIO’s, so 16 in total. A nice way to implement would be to use these GPIO pins to drive a third board. This will give you then 15 relays with 3 boards and a nice way and tidy way to connect everything…

If you are familiar with Eagle software to make a PCB it is also possible to take my design and add a third band cable connector so you can connect the third board directly with a flat cable and not via the header pins.

Unfortunatly I´m not. If I were, I would probably have build it myself long time ago. I´m just a simple user with great interest in all kinds of automation/relays etc… :slight_smile:

The easiest way would be to make three boards and connect them as follows:

The red part is a band cable to the PI and gives the first 5 relay outputs (i have connected it like this). The blue part connects the first board to the second and gives relays 6-10, also with a standard flat cable.
With the green part you can connect the third board to give you relays 11-15. You can make a flat cable or use Dupont wires or so.

Kim, do you know how to solder (and to solder SMD components)?

Yes and No… I have tried soldering SMD components many years ago. Didnt went well every time :slight_smile:

As an alternative you can also buy these boards:

Yep I have seen them before.
It´s not that I have a personally request or need. I already got my system covered with 128 inputs and 128 output from a IHC system… But I do like every other kinds of alternatives as well. And I really enjoy reading about other people DYI projects for automation.

If you need a solution with many outputs you could design a board that uses an MCP23017 to control 16 relays. Up to 8 MCP230xx devices can be placed on the same I2C bus. I have already written a module for MQTTany that supports MCP230xx devices.

1 Like