Skip to the content
2 layers85.1 × 63.5 mmRelayBoardX3, the printed circuit board in 3D

3x relay board used for garage door control and ventilator motors

Size
85.1 × 63.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
54
Nets
38
Pads
133
Tracks, vias
256, 0
Pours
4
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
28 Jun 2024
Updated
24 Mar 2025

Overview

RelayBoardX3 is an open-source printed circuit board by hansrune, from the hansrune/RelayBoardX3 repository on GitHub. It is a 2-layer board of 85.1 × 63.5 mm with 54 parts on 38 nets, routed with 256 tracks and 0 vias.

It is built around the L7805 and 2N2222A. Its parts include 16 connectors, 14 resistors, 8 diodes, 3 capacitors and 3 transistors. It belongs with the home automation and IoT boards and the ESP32 boards of this library.

Main components

2

README

README.md

Relay board X3

Work in progress / still a prototype...

A DYI 3x relay board based on ESP32c3. This is a multi purpose board used for:

  • Garage doors - controlling dual garage doors and control use of external switches
  • Ventilator / 1-phase small motor 1-2-3 speed control.

This board is tested with ESPhome and ESPEasy firmware (build instructions below), and is easily used with home automation systems that support MQTT auto discovery, the native Home Assistant API, and the many controllers that ESPEasy supports

Introduction

Some of the main features and benefits

  • 3x galvanic isolated relays
  • Car precense sensors
    • Ultrasound sensor option
  • I2C support
    • An I2C pin header with power supply is available to use with I2C sensors
    • ... or you can use the same GPIO pins for any other purpose of your choise
  • WiFi based
    • This is almost a must have for most home automation systems
    • OTA support
    • Configuration backup, restore and bulk updates.
  • Firmware of your choise
    • ESPEasy with Domoticz over http. Device creation uses virtual sensors
    • ESPEasy with Domotics and Home Assistant via MQTT. Device creation uses a MQTT configuration text file.
    • ESPHome to Home Assistant via MQTT and auto discovery
    • ESPHome to Domoticz via MQTT and auto discovery
    • ... and as the hardware supports using both Arduino and ESP-IF development kits, almost any other firmware can be created.
  • Seed Studio XIAO ESP32C3
    • This device is shielded and comes with an external IPX antenna connector
    • FCC and CE regulations approved

Indicators

Each of the four valve outputs has a LED indicator at the back of the PCB

  • LED D11 will indicate low level input from the flow meter
  • LED D1
    • no change indicates out of power, device death/freeze or other
    • a duty cycle 1:1 will indicate a reset is ongoing

Implementation and design

The schematic diagram is available here. The KiCad EDA project is in the same folder

GPIO pin usage

PINCapabiltyFunction
GPIO2Acticve low outputLED D8 - not used
GPIO3Input with pull-upJ7 pin 2
GPIO4Input with pull-upJ7 pin 1
GPIO5Active high outputRelay 1
GPIO6Active high outputRelay 2
GPIO7I2C pulled upSDL
GPIO8I2C pulled upSDA
GPIO9Active low outLED D8 - status
GPIO10Active high outputRelay 3
GPIO20RX / 1-wireSerial or 1-wire sensor or ultrasound
GPIO21TX / 1-wireSerial or 1-wire sensor or ultrasound

Hardware - getting started

This project uses my KiCad-lib-ESP32 repository as a git submodule. To check this out, use the following:

bash
git clone --recurse-submodules https://github.com/hansrune/RelayBoardX4.git 

Materials used

This project uses the Seed Studio XIAO ESP32C3 RISC-V module. This tiny device has proven to be more reliable than most ESP8266 modules used in earlier versions. This module also comes with an IPX connector for connecting an external antenna, and is delivered with a simple external antenna for good range. This device is also EMI shielded and certified.

Any available 12V DC power supply delivering 500mA or more should do for the control board. You will need to add the total power draw for the relays

There are many options and possible pinouts for DC-DC converters for the 12V to 5V conversion. A linear regulator (L7805) will need a heatsink, so a DC-DC converter is recommended.

The MOSFETs need a low Vgs trigger voltage, i.e. well under 3V on full load. I have used Si2302/N025P for the N-channel, SOT-23 package.

Resistors are 0805 size. Screw terminals are 3.5mm, which is a tight fit when ferrules are being used.

For more information, use this KiCad BOM

Hardware assembly

Soldering a prototype by hand is possible if you have a steady hand and a small solder iron tip. A microscope is recommended to inspect the solder joints properly.

Recommend to do the SMD parts first, then other components.

Hardware tests

You should test at least the following before adding the ESP32 module:

  • Attach a battery and check that the valve can be operated both NO and NC
  • Add power and check that 5V conversion is OK
  • Apply 5V to GPIO 5, 6, and 10 in turn to check that the output works with the relay LED indicators

Firmwares

ESPHome

ESPHome firmware can be set up from this ESPHome configuration repository using the test_relayx3_garage.yaml or test_relayx3_motor.yaml file as a template

Follow the README for instructions on what you will likely want to change.

By default, MQTT auto discovery is being used. This should work out of the box with Home Assistant, Domoticz and other that support Home Assistant MQTT Auto Discovery

Garage doors control

In Home Assistant, the garage door controls can look like this:

... and the closed state end stop sensors:

Motor control

In Home Assistant, the device has this simple selector:

ESPEasy

ESPEasy can be used with a number of different controllers / home automation systms. A custom firmware build description is available here

ESPEasy requires many settings. For configuration settings and rule files, you can upload the below sets of files. Please make sure to change name, unit number, controller IP addresses, NTP, syslog host and latitude/longitude. This configuration uses both a MQTT controller and a Domoticz controller. Change to what you need.

  • For the garage control, use the files under this page
  • For the motor/ventilator control, use the files under [this page](./ESPEasy/motor/config.dat

Wiring

Dual garage door wiring

This dual garage door setup uses a pulse driven elevator, and has end stop switches for the closed position. There is no end stops for the open position, meaning that the open state simply reflects not closed.

A RX-Multi receiver is used in parallel with the relay board. This is operated by remote control units from a car.

We have outdoor push buttons to operate the garage doors. These are disabled via relay #1 when our home alarm state is away or night. The power on state is that these buttons are enabled.

Motor control wiring

This setup is a simple 1-2-3 speed motor control for a ventilator. Can work in parallel with a 1-2-3 switch, where you will get the highest speed selected via contoller or switch.

Licensing

This project is licensed under the GNU General Public License v3.0 for the software, CERN-OHL-W for the hardware, and CC BY-SA for the documentation and ideas.

Parts

54
QtyValueFootprintReferences
9Screw_Terminal_01x02TerminalBlock_Phoenix:TerminalBlock_Phoenix_PT-1,5-2-5.0-H_1x02_P5.00mm_HorizontalJ4, J7, J9, J10, J11, J12, J13, J14, J15
4MountingHole_PadMountingHole:MountingHole_3.2mm_M3_ISO14580_PadH5, H6, H7, H8
310kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR4, R17, R18
31N4007Diode_THT:D_DO-34_SOD68_P12.70mm_HorizontalD4, D5, D6
31kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR7, R8, R9
32N2222APackage_TO_SOT_THT:TO-92Q1, Q2, Q3
3330Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR10, R11, R12
3Conn_01x01_MaleConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ3, J8, J16
3LEDLED_THT:LED_D5.0mm_ClearD1, D2, D3
3SANYOU_SRD_Form_CLOCAL1:Relay_SPDT_SANYOU_SRD_CutOutK1, K2, K3
210uFCapacitor_THT:CP_Radial_Tantal_D6.0mm_P5.00mmC1, C3
2220kResistor_THT:R_Axial_DIN0411_L9.9mm_D3.6mm_P12.70mm_HorizontalR13, R14
2270Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR1, R2
2Conn_01x04_MaleConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ1, J17
2LEDLED_THT:LED_D3.0mm_ClearD7, D8
1100nFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mmC2
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR3
1Barrel_JackLOCAL1:BarrelJack1J2
1Conn_01x03_MaleConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ5
1L7805Package_TO_SOT_THT:TO-220-3_VerticalU2
1SeedStudio XIAO ESP32 C3 THTLOCAL1:XIAO_ESP32C3_THTU3
1SolderJumper_3_OpenJumper:SolderJumper-3_P1.3mm_Open_Pad1.0x1.5mm_NumberLabelsJP1

Similar boards

  • 2 layers156.5 × 67.5 mmNixieScanDisplay, the printed circuit board in 3D

    NixieScanDisplay

    profdc9/NixieClock

    A Nixie clock that uses IN-14 tubes and very generic components that can be easily sourced.

    106 parts10
  • 2 layers55.6 × 43.2 mmBallValveController, the printed circuit board in 3D

    BallValveController

    hansrune/BallValveController

    Ball valve controller for irrigation, water automations and leak prevention. Supports CR05 feedback wiring. Based on ESP32c3. ESPEasy and ESPHome based firmware build instructions included

    46 parts4
  • 2 layers100 × 100 mmBoomslang, the printed circuit board in 3D

    Boomslang

    profdc9/Boomslang

    A microcontroller-based model rocket launcher igniter.

    113 parts1MIT
  • 2 layers125.2 × 86.4 mmEmbedded System Project, the printed circuit board in 3D

    Embedded System Project

    jastikai/Embedded-System-Project

    Repository for Embedded System Project course of University of Oulu, Spring 2024.

    57 parts
  • 2 layers112.8 × 83.1 mmInverter, the printed circuit board in 3D

    Inverter

    sovanaram/Power-Electronics

    Create and experiment power conversions

    53 parts
  • 2 layers165 × 133 mmFuerza, the printed circuit board in 3D

    Fuerza

    yislle/PCBs-By-ME

    Proyectos electrónicos

    131 parts
  • 2 layers101.5 × 83 mmSd2snes, the printed circuit board in 3D

    Sd2snes

    mrehkopf/sd2snes

    SD card based multi-purpose cartridge for the SNES

    154 parts722GPL-2.0
  • 2 layers279.4 × 203.2 mmZ180GDC, the printed circuit board in 3D

    Z180GDC

    lynchaj/rhyophyre

    Single Board Computer featuring Zilog Z180 processor and NEC µPD7220 Graphics Display Controller

    249 parts12

Questions

How big is the RelayBoardX3 PCB?

It measures 85.1 × 63.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the RelayBoardX3 use?

54 parts, built around the L7805 and 2N2222A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the RelayBoardX3 KiCad files?

From the hansrune/RelayBoardX3 repository on GitHub, at the commit this page was made from: the board is KiCad/RelayBoardX3.kicad_pcb and its schematic KiCad/RelayBoardX3.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the RelayBoardX3 design in my own project?

Its repository states no licence, so its author keeps all rights: ask hansrune before reusing the design.