Skip to the content
PCBKitNew board
2 layers66.5 × 49 mmRele esp12f, the printed circuit board in 3D

Single-channel Wi-Fi relay module based on the ESP-12F (ESP8266) for 110–120 VAC and loads up to 10 A. Open hardware in KiCad 10, ready for full assembly at JLCPCB.

Size
66.5 × 49 mm
Copper layers
2
Thickness
1.6 mm
Parts
34
Nets
31
Pads
104
Tracks, vias
123, 36
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
30 Sep 2026
Updated
4 Oct 2026

Overview

Rele esp12f is an open-source printed circuit board by techmiguel, from the techmiguel/smartRele repository on GitHub, published under the CERN-OHL-W-2.0 licence. It is a 2-layer board of 66.5 × 49 mm with 34 parts on 31 nets, routed with 123 tracks and 36 vias.

It is built around the ESP-12F, HLK-PM01 and AMS1117-3.3, with the TS-1187A-B-A-B, 07D221K and 1N4148W among its other parts. Its parts include 9 capacitors, 9 resistors, 3 diodes, 3 switches and 2 ICs. It belongs with the home automation and IoT boards and the ESP8266 boards of this library.

Main components

7

README

README.md

SmartRele · rele-esp12f

Single-channel Wi-Fi relay module based on the ESP-12F (ESP8266) for 110–120 VAC mains.

KiCad MCU Mains Load Assembly DRC License

PCB render, top side PCB render, bottom side

A 2-layer, 66.5 × 49 mm board that switches a mains load of up to 10 A from an ESP-12F. It is powered directly from the mains through an isolated HLK-PM01 supply and integrates input protection (time-lag fuse and varistor), a 16 A Omron G5RL power relay, status indicators and a programming header. All components sit on the top side, and the board is ready to be ordered fully assembled from JLCPCB (SMD and THT), with no hand soldering.

[!WARNING] This design operates at mains voltage. Assembly, testing and installation must be carried out by qualified people. Read the Safety section before connecting the board.


Table of contents

Features

  • ESP-12F with the antenna at the board edge and a copper-free area underneath.
  • Omron G5RL-1A-E-HR relay (SPST-NO, 16 A / 250 VAC) with 8 mm coil-to-contact separation (reinforced insulation per the manufacturer).
  • Strict mains / low-voltage zoning enforced by custom design rules: 4 mm between mains and low voltage, 2 mm between mains nets. Measured minimum clearance: 4.35 mm.
  • Duplicated power path on both sides (2 × 2.5 mm, 35 µm), sized for 10 A with a ~12 °C temperature rise (IPC-2221).
  • Input protection: T500mA time-lag fuse (protects the supply) and 07D221K varistor.
  • Robust start-up: RC delay on EN and RST, 10 µF + 100 nF decoupling next to the module, and the relay held open during reset.
  • Indicators for relay (red) and Wi-Fi (blue); user/boot (GPIO0) and reset push buttons.
  • Programming through a 2×3 header powered at 5 V; OTA updates afterwards.
  • Complete manufacturing package: Gerbers, drill files, BOM and CPL ready for JLCPCB, with 3D models for every part.
  • 3D-printable enclosure, parametric and checked against the 3D model of the assembled board.

Specifications

ParameterValue
Input voltage110–120 VAC, 50/60 Hz
Maximum load10 A resistive (trace limit; relay 16 A, terminal block 18 A)
ContactSPST-NO, switches the line (L)
On-board supplyHLK-PM01, 5 V / 600 mA, isolated
RegulatorAMS1117-3.3
MicrocontrollerESP8266 (ESP-12F module), Wi-Fi 802.11 b/g/n
ProtectionF1 T500mA 250 V (supply branch) · RV1 07D221K
PCB66.5 × 49 × 1.6 mm, 2 layers, 35 µm copper
AssemblySingle-sided; 32 components, all factory-assembled
Mounting holes2 × M2 (MH1, MH2), in the low-voltage zone

The full datasheet, with test conditions and the source of each value, is in docs/rele-esp12f_datasheet_user_guide.pdf.

Architecture

text
 Power      J1:L ──────────► K1 contact (COM → NO) ──────────► J1:OUT ──► load

 Supply     J1:L ── F1 ── L_F ──► PS1 HLK-PM01 ──► +5 V ── U1 AMS1117 ──► +3.3 V ──► U2 ESP-12F
                          RV1 between L_F and N

 Control    +5 V ── K1 coil (D1 flyback diode) ── Q1 SS8050 ── GND
                                                   ▲
                                        GPIO5 (U2) ── R6 1 kΩ
  • Mains zone (bottom left): J1, F1, RV1, K1 and the PS1 input.
  • Low-voltage zone (right): U1 and its capacitors, relay driver, LEDs, push buttons, J3 and mounting holes. GND planes on both sides, restricted to this zone.
  • Top strip: PS1 on the left and the ESP-12F with its antenna on the right edge.

The full schematic is in docs/schematic.pdf.

Connectors and pinout

J1 — Mains terminal block (3 poles, 5.08 mm pitch)

PinSignalFunction
1NNeutral
2OUTSwitched output to the load
3LLine input

J3 — Programming (2×3 header, 2.54 mm pitch)

text
 IO0   TX   GND(1)
 RST   RX   5V

Pin 1 (square pad) = GND; pin 2 = 5 V. Labeled on the silkscreen.

ESP-12F

GPIOFunction
GPIO5Relay (SS8050, R6 1 kΩ, R7 10 kΩ to GND) and relay LED (D2)
GPIO4Wi-Fi LED (D3)
GPIO0Push button SW1 (flashing mode / application use), 10 kΩ to 3.3 V
GPIO210 kΩ to 3.3 V (boot strap)
GPIO1510 kΩ to GND (boot strap)
EN, RST10 kΩ to 3.3 V + 100 nF to GND; RST also to SW2

Repository layout

text
.
├── rele-esp12f.kicad_pro      KiCad 10 project
├── rele-esp12f.kicad_sch      Schematic
├── rele-esp12f.kicad_pcb      PCB layout
├── rele-esp12f.kicad_dru      Custom design rules (mains isolation)
├── 3dmodels/                  STEP models missing from the KiCad library (K1, F1, SW1/SW2)
├── fabrication/               Production package for JLCPCB
│   ├── gerbers/               Gerbers and drill files (Excellon)
│   ├── gerbers_JLCPCB.zip     Gerbers + drill files + CPL, ready to upload
│   ├── BOM_JLCPCB.csv         Bill of materials with LCSC part numbers
│   └── CPL_JLCPCB.csv         Component placement list
├── docs/
│   ├── schematic.pdf
│   ├── rele-esp12f_datasheet_user_guide.pdf
│   ├── pcb_top.png · pcb_bottom.png
│   └── datasheets/            Datasheets of the key components
├── firmware/                  ESP8266 firmware (PlatformIO, Arduino core)
├── enclosure/                 3D-printable enclosure (FreeCAD, STEP, STL)
├── scripts/                   PDF datasheet generator
├── CHANGELOG.md
└── LICENSE

The custom 3D models are referenced through ${KIPRJMOD}/3dmodels/, so the project opens without any extra path configuration.

Manufacturing and assembly

  1. Upload fabrication/gerbers_JLCPCB.zip to JLCPCB (2 layers, 1.6 mm).
  2. Enable PCB Assembly (top side) and upload BOM_JLCPCB.csv and CPL_JLCPCB.csv.
  3. Before paying, check in the JLCPCB viewer that:
    • U2 and K1 sit on their pads;
    • the J1 wire entry faces the board edge;
    • J3 pin 1 lands on the square pad (GND);
    • every BOM line has a part selected.

THT parts are wave-soldered. The CPL uses the pad center (JLCPCB convention), not the body center; for U2 and K1 they differ. The drill holes of J1 (Ø1.5 mm) and RV1 (Ø1.0 mm) are matched to the actual parts.

Power and THT components

Ref.PartLCSCNotes
PS1Hi-Link HLK-PM01C209903Isolated 5 V supply
K1Omron G5RL-1A-E-HR DC5C113250SPST-NO 16 A; 5 V coil, 80 mA
F1Reomax MTS0500A, T500mA 250 VC2762401Time-lag, due to the PS1 inrush current
RV1Varistor 07D221KC49072913For 110–120 VAC
C1470 µF 10 VC112505
J1KANGNEX WJ500V-5.08-3PC72334250 V / 18 A
J32×3 header, 2.54 mmC65114Only used for the first flashing

The full list is in the BOM.

Regenerating the production files

With kicad-cli (KiCad 10), from the repository root:

bash
kicad-cli pcb export gerbers --layers F.Cu,B.Cu,F.SilkS,B.SilkS,F.Mask,B.Mask,F.Paste,Edge.Cuts -o fabrication/gerbers/ rele-esp12f.kicad_pcb
bash
kicad-cli pcb export drill --format excellon --excellon-units mm --excellon-separate-th --excellon-zeros-format decimal -o fabrication/gerbers/ rele-esp12f.kicad_pcb
bash
kicad-cli pcb render --side top -w 1592 -h 904 --background opaque --quality basic --zoom 0.9954 -o docs/pcb_top.png rele-esp12f.kicad_pcb
bash
kicad-cli pcb render --side bottom -w 1592 -h 904 --background opaque --quality basic --zoom 0.9954 -o docs/pcb_bottom.png rele-esp12f.kicad_pcb

These explicit options are needed because the plot settings stored in the board produce .gbr extensions and an unnecessary B.Paste layer. The ZIP contains the 11 files in fabrication/gerbers/ plus CPL_JLCPCB.csv.

Firmware

The firmware/ folder holds the board's own firmware (PlatformIO, Arduino core for ESP8266). In this version the relay is controlled over Wi-Fi only, from a built-in web page or a JSON REST API:

  • manual on / off;
  • state-change timer (turn on, off or toggle after 1 s – 7 days);
  • cyclic ON/OFF routine (on for one period, off for another, repeated);
  • up to 16 weekly schedules synchronised over NTP, with a configurable time zone.

On first boot it opens the SmartRele-XXXXXX setup access point; holding SW1 for 8 s erases the Wi-Fi settings. Setup, behaviour, API and security notes are in firmware/README.md.

First firmware flashing

  1. Disconnect the board from mains.
  2. Connect a USB-serial adapter with 3.3 V logic to J3: TX↔RX, RX↔TX, GND, and its 5 V (VBUS) output to the 5V pin.
  3. Hold SW1 (GPIO0) while pressing and releasing SW2 (RST) to enter flashing mode.
  4. Flash the firmware (pio run -e esp12f -t upload from firmware/). Later updates are done over the air (OTA).

J3 is powered at 5 V rather than 3.3 V for two reasons. The internal output-to-input diode of the AMS1117 would make the adapter also feed the 5 V rail. In addition, the 3.3 V pin of a typical adapter cannot supply the current peaks the ESP8266 draws while calibrating its radio.

Third-party firmware also works: the datasheet includes example configurations for Tasmota and ESPHome.

Enclosure

The enclosure/ folder contains a two-part enclosure (base and screwed lid) for 3D printing in PETG or ASA/ABS. It is generated by a parametric FreeCAD script, and its interference with the 3D model of the assembled board is zero. Design, printing and assembly details are in enclosure/README.md.

Closed enclosure Open enclosure with the board

Design verification

Results with kicad-cli 10.0.5, with all zones refilled:

CheckErrorsWarningsWarning details
DRC02923 footprints modified from the library (J1/RV1 drills and custom 3D models); 6 PS1/J1 silkscreen items next to the rounded corners
Schematic ↔ PCB parity03432 LCSC/assembly fields not copied to footprints; 2 mounting holes without a symbol
ERC09Off-grid endpoints and symbols that differ from the library
Unconnected pads0—

None of the warnings affects manufacturing. Measured clearances: mains copper ↔ low voltage ≥ 4.35 mm on both sides; mains copper ↔ board edge ≥ 2.0 mm.

Safety

  • 110–120 VAC mains. The 07D221K varistor is rated for that voltage. For 230 VAC it must be replaced (e.g. with a 07D471K). F1 is suitable for both voltages.
  • The load current does not flow through F1, which only protects the supply. Install a circuit breaker or fuse of ≤ 10 A upstream, dedicated to this output. An on-board fuse would not have enough breaking capacity for a mains short circuit.
  • Never connect J3 while the board is connected to mains.
  • Mount the board in an insulating enclosure: mains copper is 2 mm from the board edge.
  • Use only MH1 and MH2 (low-voltage zone) for metal hardware: M2 screws with a head or washer of Ø ≤ 5 mm.
  • The printed enclosure provides mechanical and contact protection, but it is not certified. For a permanent installation, print it in a flame-retardant material or place it inside an approved electrical junction box.

Documentation

DocumentContents
Datasheet and user guideSpecifications, operation, installation and design rationale
SchematicFull schematic in PDF
DatasheetsOmron G5RL, AMS1117, ESP8266EX, ESP-WROOM-02 and the Espressif hardware design guidelines
ChangelogHardware revisions and the rationale behind each change
EnclosureEnclosure design, printing and assembly

The datasheet is regenerated with python scripts/generate_datasheet.py (requires ReportLab, PyMuPDF, Pillow and kicad-cli).

License

Hardware released under the CERN Open Hardware Licence v2 – Weakly Reciprocal (CERN-OHL-W-2.0).

Inspired by aman983/ESP-01S_Relay_Module. This is a new design and contains no files from the original.


© 2026 @techmigue

Parts

34
QtyValueFootprintReferences
610kResistor_SMD:R_0603_1608MetricR1, R2, R3, R4, R5, R7
5100nFCapacitor_SMD:C_0603_1608MetricC3, C5, C6, C7, C8
21kResistor_SMD:R_0603_1608MetricR6, R8
222uF 10VCapacitor_SMD:C_0805_2012MetricC2, C4
2M2MountingHole:MountingHole_2.2mm_M2MH1, MH2
2TS-1187AButton_Switch_SMD:SW_Push_1P1T_XKB_TS-1187ASW1, SW2
107D221KVaristor:RV_Disc_D7mm_W3.4mm_P5mmRV1
110uFCapacitor_SMD:C_0603_1608MetricC9
11N4148WDiode_SMD:D_SOD-123D1
1220Resistor_SMD:R_0603_1608MetricR9
1470uF 10VCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC1
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1ESP-12FRF_Module:ESP-12EU2
1G5RL-1A-E-HR DC5Relay_THT:Relay_SPST_Omron_G2RL-1A-EK1
1HLK-PM01Converter_ACDC:Converter_ACDC_Hi-Link_HLK-PMxxPS1
1LED WiFi (blue)LED_SMD:LED_0603_1608MetricD3
1LED relay (red)LED_SMD:LED_0603_1608MetricD2
1N / L_OUT / L_INTerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ1
1PROGConnector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalJ3
1SS8050Package_TO_SOT_SMD:SOT-23Q1
1T500mA 250VFuse:Fuse_Littelfuse_395SeriesF1

Questions

How big is the Rele esp12f PCB?

It measures 66.5 × 49 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Rele esp12f use?

34 parts, built around the ESP-12F, HLK-PM01, AMS1117-3.3 and TS-1187A-B-A-B. 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 Rele esp12f KiCad files?

From the techmiguel/smartRele repository on GitHub, at the commit this page was made from: the board is rele-esp12f.kicad_pcb and its schematic rele-esp12f.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rele esp12f design in my own project?

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

Similar boards

  • 2 layers78.7 × 58.4 mm40Hz, the printed circuit board in 3D

    40Hz

    oponyx/40HzGen

    Advanced ESP based 40Hz Gamma brain stimulator

    34 parts4MIT
  • 2 layers0.6 × 27.9 mmFAN Light, the printed circuit board in 3D

    FAN Light

    poljant/FanLightKiCAD

    PCB FanLight

    25 partsMIT
  • 2 layers163 × 59.5 mmSTM32 Smart Energy Meter, the printed circuit board in 3D

    STM32 Smart Energy Meter

    venkatesh3549/STM32-Based-Smart-Energy-Meter-PCB-Design

    ustom 2-layer PCB design for an STM32-based Smart Energy Meter with voltage/current monitoring and Wi-Fi communication, developed using KiCad."

    25 parts
  • 2 layers130.5 × 108 mmESP32 4CH Home Automation, the printed circuit board in 3D

    ESP32 4CH Home Automation

    VinayGopi-PK/ESP32-4-Channel-WiFi-Home-Automation

    ESP32-based 4-channel Wi-Fi Home Automation Controller designed in KiCad. Includes schematic, PCB layout, Gerber files, BOM and 3D visualization.

    77 parts
  • 2 layers95 × 55 mmSmarthome v0.1, the printed circuit board in 3D

    Smarthome v0.1

    whysixmift/smarthome_v0.1

    I wanted to control lights and appliances in my room over Wi-Fi without having loose relay modules, breadboards, and 220V AC wires floating around my desk.

    63 parts
  • 2 layers100 × 100 mmProject One, the printed circuit board in 3D

    Project One

    rajbhardivesh/RF-Hunter-PCB

    206 parts
  • 2 layers80 × 48.8 mmESP8266-Sentinel Kinetic Wired Remote, the printed circuit board in 3D

    ESP8266-Sentinel Kinetic Wired Remote

    alextrical/ESP8266-Sentinel-Kinetic-Wired-Remote

    ESP8266 based Re-implementation of the Vent-Axia Sentinel Kinetic Wired Remote Controller

    48 parts4CERN-OHL-S-2.0
  • 4 layers408.7 × 50 mmPartial Drawer Controller v1, the printed circuit board in 3D

    Partial Drawer Controller v1

    Robast-GmbH/PCB_Designs

    This repository contains all the necessary files and instructions for the PCBs that are designed using KiCad. Here is an overview of the main components: - .github: Contains Github-specific configurations, including…

    619 parts1MIT