Skip to the content
4 layers42 × 65 mmRelayController, the printed circuit board in 3D

Relay Control Board using Pico W

Size
42 × 65 mm
Copper layers
4
Thickness
1.6 mm
Parts
16
Nets
56
Pads
143
Tracks, vias
94, 0
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
22 Mar 2026
Updated
23 Mar 2026

Overview

RelayController is an open-source printed circuit board by DrJonEA, from the DrJonEA/RPIPicoW-RelayControl repository on GitHub, published under the MIT licence. It is a 4-layer board of 42 × 65 mm with 16 parts on 56 nets, routed with 94 tracks and 0 vias.

It is built around the ULN2003. Its parts include 3 switches, 2 capacitors, 2 ICs, 2 connectors and 1 resistor. It belongs with the home automation and IoT boards and the RP2040 boards of this library.

Main components

1

README

README.md

DrJonEA: RPIPicoW-RelayControl

A Raspberry Pi Pico W based Relay control board. Using a ULN2003 as driver for a 5Volt Relay.

Example controlling the Relay via an onboard SPST switch. Plus remote control of MQTT/TLS.

This project is featured on my Youtube Channel DrJonEA.

Clone and Build

The example is built using the Pico SDK version 2.2.0 and a number of libraries which are included as submodules. Please clone the repository using the recurse submodules switch.

I've written a blog post on how to clone, build and debug my projects. It covers command line and VSCode build. I hope this help you get started.

Schematic, PCB Design and Components

The PCB folder contains the KiCAD project files for the PCB Design.

Components:

DesignatorFootprintQuantityDesignation
"Id""Designator""Footprint""Quantity"
1"C1""CP_Radial_D10.0mm_P5.00mm"1
2"I2C2,I2C1""PinHeader_1x04_P2.54mm_Vertical"2
3"J4,J3""PinHeader_1x04_P2.54mm_Vertical"2
4"O1""ScrewTerm_Oiyagai_01x02_5mm"1
5"A1""RaspberryPi_Pico_Common_Unspecified"1
6"C2""C_Disc_D4.7mm_W2.5mm_P5.00mm"1
7"K1""Relay_SPDT_SANYOU_SRD_Series_Form_C"1
8"ST1""ScrewTerm_Oiyagai_01x03_5mm"1
9"U1""CERDIP-16_W7.62mm_SideBrazed_LongPads_Socket"1
10"D1""D_DO-41_SOD81_P10.16mm_Horizontal"1
11"SW2""SW_PUSH_6mm"1
12"SW1""SW_Latch_7x7_DPDT"1
13"R4""R_Axial_DIN0309_L9.0mm_D3.2mm_P15.24mm_Horizontal"1
14"U2""WS2812B Strip"1

Examples Projects

exp/TestLeds

A test project to check the WS2812B LEDs and Switch on the board

exp/TestRelay

A test projec to check the Relay works. Uses the switch to toggle the relay state. Shows the state of the relay on the WS2812B LED

Main Project

This is a MQTT device connecting to a MQTT Broker (I use Flespi.io). It connects over TLS using WolfSSL to provide a TLS connection. The device will then take commands on the topic "TNG/{DEVICEID}/TPC/Relay/req". With a Payload as JSON saying {"on": True} or {"on": False}.

To build this examples the following environment variables are used to source credentials:

  • WIFI_SSID
  • WIFI_PASSWORD
  • MQTT_CLIENT
  • MQTT_USER
  • MQTT_PASSWD
  • MQTT_HOST
  • MQTT_PORT

I have a course showing how I build these types of MQTT Devices over on Udemy.

Python Control Example

Python scripts which can interact with the device are included in the py folder. They require the client id of the device the are controlling in this form:

python3 on.py {DEVICE_ID}

The scripts take credentials for the client from the followin environment variables:

  • MQTT_USER
  • MQTT_PASSWD
  • MQTT_HOST
  • MQTT_PORT

NOTE: To use MQTT the device and the client must have different Client IDs (or MQTT_USER).

Parts

16
QtyValueFootprintReferences
2Conn_01x04_PinConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalI2C1, I2C2
2Touch DisplayConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3, J4
11000uFCapacitor_THT:CP_Radial_D10.0mm_P5.00mmC1
110uFCapacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mmC2
11N4007Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1
1220RResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P15.24mm_HorizontalR4
1ElectJonLib:ScrewTerm_Oiyagai_01x02_5mmO1
1RaspberryPi_PicoModule:RaspberryPi_Pico_Common_UnspecifiedA1
1SANYOU_SRD_Form_CRelay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK1
1SW_DPDT_x2JonLib:SW_Latch_7x7_DPDTSW1
1SW_SPSTButton_Switch_THT:SW_PUSH_6mmSW2
1Screw_Terminal_01x03JonLib:ScrewTerm_Oiyagai_01x03_5mmST1
1ULN2003Package_DIP:CERDIP-16_W7.62mm_SideBrazed_LongPads_SocketU1
1~JonLib:WS2812B StripU2

Similar boards

  • 4 layers99.6 × 76.2 mmE TKT, the printed circuit board in 3D

    E TKT

    andreisperid/E-TKT

    open source embossed label maker

    110 parts481MIT
  • 2 layers31 × 64 mmPower driver, the printed circuit board in 3D

    Power driver

    jmfriedt/SDR-GB-SAR

    Opensource, openhardware implementation of a Software Defined Radio (SDR) Ground Based Synthetic-Aperture RADAR (GB-SAR)

    6 parts70
  • 2 layers160 × 100 mmMPCNC Nano Estlcam Shield, the printed circuit board in 3D

    MPCNC Nano Estlcam Shield

    tnn85/MPCNC-Nano-Estlcam-Shield

    Ein CNC Shield für die MPCNC in Verwendung mit Estlcam

    96 parts70
  • 2 layers42.5 × 43.2 mmElectronicFocuser, the printed circuit board in 3D

    ElectronicFocuser

    jlecomte/ascom-oag-focuser

    Open Source ASCOM-Compatible OAG Focuser For Astrophotography

    4 parts55MIT
  • 4 layers100 × 49.8 mmExpansion board, the printed circuit board in 3D

    Expansion board

    reubenstr/zuko

    A quadruped robot dog!

    75 parts51MIT
  • 2 layers75 × 60 mmDUTler V2, the printed circuit board in 3D

    DUTler V2

    TheYoctoJester/dutler

    A bench butler for your Device Under Test: turns a Raspberry Pi Pico into a USB-serial console bridge with power-relay and MOSFET strap/reset control for embedded-Linux bring-up and hardware-in-the-loop.

    54 parts23Apache-2.0
  • 4 layers76 × 82.5 mmNucleo64 CNC, the printed circuit board in 3D

    Nucleo64 CNC

    terjeio/CNC_Breakout_Nucleo64

    CNC breakout for STM324F411 and ST32F446 development boards

    120 parts22

Questions

How big is the RelayController PCB?

It measures 42 × 65 mm and has 4 copper layers, 1.6 mm thick.

What parts does the RelayController use?

16 parts, built around the ULN2003. 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 RelayController KiCad files?

From the DrJonEA/RPIPicoW-RelayControl repository on GitHub, at the commit this page was made from: the board is PCB/RelayController/RelayController.kicad_pcb and its schematic PCB/RelayController/RelayController.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the RelayController design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).