

Rele esp12f
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
7ESP-12F
SMD,24x16mm-40℃~+85℃ -96dBm 15dBm 2.4GHz 3.3V 375mA 55mA PCB UART WIFI4 SMD,24x16mm WiFi Modules ROHSDOITWiFi ModulesHLK-PM01
DIP,34x24mm0.1W 100mVp-p 15mm 20mm 34mm 3W 3kV 5V 700mA 73% 85VAC~265VAC AC-DC Short Circuit Protection、Over Current Protection、Fault self-recovery ±0.2% 插件,34x20mm AC-DC Power Modules ROHSHI-LINKAC-DC Power ModulesAMS1117-3.3
SOT-223-40℃~+125℃ 0.003%Vout 1 1.1V@(800mA) 15V 1A 3.3V 5mA 72dB@(120Hz) Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSAdvanced Monolithic SystemsVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsTS-1187A-B-A-B
SMD-4P,5.1x5.1mm-30℃~+85℃ 1.5mm 1.6N 100,000 cycles 12V 5.1mm 5.1mm 50mA Gold No Round Button SPST Surface Mount,Vertical Without Bracket SMD-4P,5.1x5.1mm Tactile Switches ROHSXKB ConnectionTactile Switches07D221K
插件,P=5mm1.2kA 140V 14J 180V 198V~242V 230pF 250mW 360V Plugin,P=5mm Varistors ROHShongjiachengVaristors1N4148W
SOD-123150mA 1A 1V@50mA 1uA@75V 400mW 4ns 75V Independent SOD-123 Switching Diodes ROHSSTMicroelectronicsSwitching DiodesSS8050
SOT-323-55℃~+150℃ 1 NPN 1.5A 100MHz 100nA 200 25V 300mW 500mV 5V NPN SOT-23 Bipolar (BJT) ROHSJiangsu Changjing Electronics Technology (CJ)Bipolar (BJT)
README
README.mdSmartRele · rele-esp12f
Single-channel Wi-Fi relay module based on the ESP-12F (ESP8266) for 110–120 VAC mains.
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
- Specifications
- Architecture
- Connectors and pinout
- Repository layout
- Manufacturing and assembly
- Firmware
- First firmware flashing
- Enclosure
- Design verification
- Safety
- Documentation
- License
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
| Parameter | Value |
|---|---|
| Input voltage | 110–120 VAC, 50/60 Hz |
| Maximum load | 10 A resistive (trace limit; relay 16 A, terminal block 18 A) |
| Contact | SPST-NO, switches the line (L) |
| On-board supply | HLK-PM01, 5 V / 600 mA, isolated |
| Regulator | AMS1117-3.3 |
| Microcontroller | ESP8266 (ESP-12F module), Wi-Fi 802.11 b/g/n |
| Protection | F1 T500mA 250 V (supply branch) · RV1 07D221K |
| PCB | 66.5 × 49 × 1.6 mm, 2 layers, 35 µm copper |
| Assembly | Single-sided; 32 components, all factory-assembled |
| Mounting holes | 2 × 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
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)
| Pin | Signal | Function |
|---|---|---|
| 1 | N | Neutral |
| 2 | OUT | Switched output to the load |
| 3 | L | Line input |
J3 — Programming (2×3 header, 2.54 mm pitch)
IO0 TX GND(1)
RST RX 5VPin 1 (square pad) = GND; pin 2 = 5 V. Labeled on the silkscreen.
ESP-12F
| GPIO | Function |
|---|---|
| GPIO5 | Relay (SS8050, R6 1 kΩ, R7 10 kΩ to GND) and relay LED (D2) |
| GPIO4 | Wi-Fi LED (D3) |
| GPIO0 | Push button SW1 (flashing mode / application use), 10 kΩ to 3.3 V |
| GPIO2 | 10 kΩ to 3.3 V (boot strap) |
| GPIO15 | 10 kΩ to GND (boot strap) |
| EN, RST | 10 kΩ to 3.3 V + 100 nF to GND; RST also to SW2 |
Repository layout
.
├── 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
└── LICENSEThe custom 3D models are referenced through ${KIPRJMOD}/3dmodels/, so the project opens without any extra path configuration.
Manufacturing and assembly
- Upload
fabrication/gerbers_JLCPCB.zipto JLCPCB (2 layers, 1.6 mm). - Enable PCB Assembly (top side) and upload
BOM_JLCPCB.csvandCPL_JLCPCB.csv. - 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. | Part | LCSC | Notes |
|---|---|---|---|
| PS1 | Hi-Link HLK-PM01 | C209903 | Isolated 5 V supply |
| K1 | Omron G5RL-1A-E-HR DC5 | C113250 | SPST-NO 16 A; 5 V coil, 80 mA |
| F1 | Reomax MTS0500A, T500mA 250 V | C2762401 | Time-lag, due to the PS1 inrush current |
| RV1 | Varistor 07D221K | C49072913 | For 110–120 VAC |
| C1 | 470 µF 10 V | C112505 | |
| J1 | KANGNEX WJ500V-5.08-3P | C72334 | 250 V / 18 A |
| J3 | 2×3 header, 2.54 mm | C65114 | Only 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:
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_pcbkicad-cli pcb export drill --format excellon --excellon-units mm --excellon-separate-th --excellon-zeros-format decimal -o fabrication/gerbers/ rele-esp12f.kicad_pcbkicad-cli pcb render --side top -w 1592 -h 904 --background opaque --quality basic --zoom 0.9954 -o docs/pcb_top.png rele-esp12f.kicad_pcbkicad-cli pcb render --side bottom -w 1592 -h 904 --background opaque --quality basic --zoom 0.9954 -o docs/pcb_bottom.png rele-esp12f.kicad_pcbThese 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
- Disconnect the board from mains.
- 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.
- Hold SW1 (GPIO0) while pressing and releasing SW2 (RST) to enter flashing mode.
- Flash the firmware (
pio run -e esp12f -t uploadfromfirmware/). 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.
Design verification
Results with kicad-cli 10.0.5, with all zones refilled:
| Check | Errors | Warnings | Warning details |
|---|---|---|---|
| DRC | 0 | 29 | 23 footprints modified from the library (J1/RV1 drills and custom 3D models); 6 PS1/J1 silkscreen items next to the rounded corners |
| Schematic ↔ PCB parity | 0 | 34 | 32 LCSC/assembly fields not copied to footprints; 2 mounting holes without a symbol |
| ERC | 0 | 9 | Off-grid endpoints and symbols that differ from the library |
| Unconnected pads | 0 | — |
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
| Document | Contents |
|---|---|
| Datasheet and user guide | Specifications, operation, installation and design rationale |
| Schematic | Full schematic in PDF |
| Datasheets | Omron G5RL, AMS1117, ESP8266EX, ESP-WROOM-02 and the Espressif hardware design guidelines |
| Changelog | Hardware revisions and the rationale behind each change |
| Enclosure | Enclosure 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 10k | Resistor_SMD:R_0603_1608Metric | R1, R2, R3, R4, R5, R7 |
| 5 | 100nF | Capacitor_SMD:C_0603_1608Metric | C3, C5, C6, C7, C8 |
| 2 | 1k | Resistor_SMD:R_0603_1608Metric | R6, R8 |
| 2 | 22uF 10V | Capacitor_SMD:C_0805_2012Metric | C2, C4 |
| 2 | M2 | MountingHole:MountingHole_2.2mm_M2 | MH1, MH2 |
| 2 | TS-1187A | Button_Switch_SMD:SW_Push_1P1T_XKB_TS-1187A | SW1, SW2 |
| 1 | 07D221K | Varistor:RV_Disc_D7mm_W3.4mm_P5mm | RV1 |
| 1 | 10uF | Capacitor_SMD:C_0603_1608Metric | C9 |
| 1 | 1N4148W | Diode_SMD:D_SOD-123 | D1 |
| 1 | 220 | Resistor_SMD:R_0603_1608Metric | R9 |
| 1 | 470uF 10V | Capacitor_THT:CP_Radial_D6.3mm_P2.50mm | C1 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U1 |
| 1 | ESP-12F | RF_Module:ESP-12E | U2 |
| 1 | G5RL-1A-E-HR DC5 | Relay_THT:Relay_SPST_Omron_G2RL-1A-E | K1 |
| 1 | HLK-PM01 | Converter_ACDC:Converter_ACDC_Hi-Link_HLK-PMxx | PS1 |
| 1 | LED WiFi (blue) | LED_SMD:LED_0603_1608Metric | D3 |
| 1 | LED relay (red) | LED_SMD:LED_0603_1608Metric | D2 |
| 1 | N / L_OUT / L_IN | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal | J1 |
| 1 | PROG | Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_Vertical | J3 |
| 1 | SS8050 | Package_TO_SOT_SMD:SOT-23 | Q1 |
| 1 | T500mA 250V | Fuse:Fuse_Littelfuse_395Series | F1 |
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 mm

- 2 layers0.6 × 27.9 mm

- 2 layers163 × 59.5 mm

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 mm

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 mm

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 mm

- 2 layers80 × 48.8 mm

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 mm

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