Skip to the content
2 layers200 × 100 mmSmart home, the printed circuit board in 3D

ESP32-based smart home controller for switching 4 independent 230V AC loads, with per-channel current and voltage sensing, manual override buttons, status LEDs, and an I²C LCD display.

Size
200 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
76
Nets
59
Pads
302
Tracks, vias
368, 28
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
26 Jun 2026
Updated
26 Jun 2026

Overview

Smart home is an open-source printed circuit board by vishal007-hacker, from the vishal007-hacker/smart-home repository on GitHub. It is a 2-layer board of 200 × 100 mm with 76 parts on 59 nets, routed with 368 tracks and 28 vias.

It is built around the ESP32-WROOM-32E, HLK-PM01 and ADS1115, with the AMS1117-3.3, ULN2003A and SRD-05VDC-SL-C among its other parts. Its parts include 21 resistors, 14 connectors, 12 capacitors, 10 switches and 8 ICs. It belongs with the home automation and IoT boards and the ESP32 boards of this library.

Main components

7

README

README.md

Smart Home 4-Channel AC Relay Controller

WisRight Technologies Private Limited

ESP32-based smart home controller for switching 4 independent 230V AC loads, with per-channel current and voltage sensing, manual override buttons, status LEDs, and an I²C LCD display.

The project is a complete KiCad 9 design — schematic, PCB layout, BOM, custom symbol/footprint for the HLK-PM01 AC-DC module, custom DRC rules for mains clearance, and Python generator scripts that build everything from a single bom.csv.

Features

  • 4 independent AC channels, each with its own L/N/PE input terminal, fuse, relay, and L/N output terminal
  • Mains isolation — HLK-PM01 isolated AC-DC module (230VAC → 5VDC, 600mA, 2.1 kV isolation)
  • Per-channel current sensing — ACS712-05B Hall-effect IC (±5A, isolated)
  • Per-channel voltage sensing — external ZMPT101B modules via I²C ADS1115 (16-bit, 4 channels)
  • Manual override — 4 tactile buttons for local on/off control per channel
  • Status indication — 4 green LEDs (one per channel) + 1 red power LED
  • I²C LCD support — 4-pin header for an external 16×2 PCF8574 backpack LCD
  • UART programming header — standard 6-pin pinout for any USB-to-serial adapter
  • Custom DRC rules — 4mm HV-to-LV clearance, 3mm HV-to-HV, 2mm HV trace minimum, edge clearance
  • HV/LV isolation slot — physical cut in the PCB between mains and logic sections

Hardware overview

SectionParts
AC inputs4× Phoenix MKDS-1.5 3-pos terminals (L, N, PE per channel)
Protection4× T4A 5×20mm fuses (one per channel) + 1× S07K275 MOV across L1/N1
Power supplyHLK-PM01 (230VAC → 5VDC) + AMS1117-3.3 (5V → 3.3V LDO)
Switching4× SANYOU SRD-05VDC SPDT relays (10A) driven by ULN2003A Darlington array
MCUESP32-WROOM-32E module (WiFi + Bluetooth)
AC outputs4× Phoenix MKDS-1.5 2-pos terminals (L_switched, N_passthrough per channel)
Current sense4× ACS712-05B (SOIC-8, ±5A range, internal isolation)
Voltage sense4× external ZMPT101B modules via 1× ADS1115 (I²C ADC at 0x48)
User interface4× 6mm tactile buttons + 4× green status LEDs + 1× red power LED + 4-pin I²C LCD header
Programming6-pin UART header (GND, +3V3, TXD0, RXD0, EN, IO0)

Full bill of materials in bom.csv — 43 grouped rows, 76 component instances.

Detailed components list

Active devices

RefQtyPartPackageDescription
U11ESP32-WROOM-32EModule 18×25.5mmEspressif WiFi+BT MCU, 240MHz dual-core, 4MB flash, integrated PCB antenna
U21ULN2003ADIP-16Texas Instruments 7-channel Darlington array (500mA per channel, up to 50V), drives relay coils
U31AMS1117-3.3SOT-223-3Advanced Monolithic Systems 3.3V LDO regulator, 1A capacity, drops 5V→3.3V for ESP32
PS11HLK-PM01THT 34.2×20.2mmHi-Link AC-DC isolated SMPS module, 230VAC→5VDC @ 600mA, 2.1 kV isolation, 3W
U4-U74ACS712ELCTR-05BSOIC-8Allegro Hall-effect current sensor, ±5A range, 185 mV/A sensitivity, 2.1 kVrms isolation between IP± and signal pins
U81ADS1115IDGSRTSSOP-10Texas Instruments 16-bit Σ-Δ ADC, 4 single-ended channels, I²C interface, 860 SPS, PGA ±0.256V to ±6.144V (default address 0x48 with ADDR=GND)
K1-K44SRD-05VDC-SL-CTHTSanyou SPDT relay, 5V coil ~70mA, contacts rated 10A @ 250VAC / 30VDC

Discrete components

RefQtyValuePackageUse
R1-R441 kΩ0805 SMDStatus LED current limit (D1-D4)
R911 kΩ0805 SMDPower LED current limit (D5)
R5-R8410 kΩ0805 SMDManual button pull-ups to +3V3 (SW1-SW4)
R11110 kΩ0805 SMDESP32 EN pin pull-up to +3V3
R12110 kΩ0805 SMDESP32 BOOT (GPIO0) pull-up to +3V3
R1314.7 kΩ0805 SMDI²C SDA pull-up to +3V3
R1414.7 kΩ0805 SMDI²C SCL pull-up to +3V3
R15-R18410 kΩ0805 SMDACS712 output divider (top) — scales 0-5V to 0-3.21V for ESP32 ADC
R19-R22418 kΩ0805 SMDACS712 output divider (bottom)
C11100 µF / 16VRadial THT 6.3mmHLK-PM01 +5V output bulk capacitor (absorbs ESP32 WiFi transient bursts)
C2110 µF0805 SMDAMS1117 input cap
C3122 µF0805 SMDAMS1117 output cap (recommended ≥22µF tantalum/ceramic for AMS1117 stability)
C4110 µF0805 SMDESP32 +3V3 bulk
C51100 nF0805 SMDESP32 3V3 decoupling (place within 3mm of module pin 2)
C611 µF0805 SMDEN pin RC delay (forms ~10ms power-up delay with R11=10k)
C71100 nF0805 SMDULN2003A VCC decoupling
C8-C114100 nF0805 SMDACS712 VCC decoupling (one per ACS712)
C161100 nF0805 SMDADS1115 VDD decoupling
D1-D44LED 3mm greenTHTPer-channel relay status indicator
D51LED 3mm redTHTPower-on indicator (always on while +5V present)
F1-F44T4A 5×20 mmTHT Schurter 0031.8201 holderSlow-blow mains fuse, one per AC input channel
RV11S07K275Disc D9mmEPCOS metal oxide varistor, 275 VAC clamping, surge protection across L1/N1

Switches

RefQtyTypeUse
SW1-SW446mm tactile THTManual override buttons (one per channel) — momentary press toggles the relay
SW516mm tactile THTBOOT button — hold during reset to enter ESP32 download mode
SW616mm tactile THTRESET button — pulls ESP32 EN low

Connectors

RefQtyTypeUse
J1A, J1B, J1C, J1D4Phoenix MKDS-1.5 3-pos screw terminal, 5.08mm pitchAC input per channel: L (Live), N (Neutral), PE (Protective Earth)
J2A, J2B, J2C, J2D4Phoenix MKDS-1.5 2-pos screw terminal, 5.08mm pitchAC switched output per channel: L_out, N_passthrough
J311×6 pin header, 2.54mm pitchUART programming: GND, +3V3, TXD0, RXD0, EN, IO0
J411×4 pin header, 2.54mm pitchExternal 16×2 LCD via PCF8574 I²C backpack: GND, +5V, SDA, SCL
J5, J6, J7, J841×3 pin header, 2.54mm pitchExternal ZMPT101B voltage sensor per channel: GND, +3V3, VOUT

External modules (not on PCB — user-supplied)

ModuleQuantityPurposeConnection
16×2 LCD with PCF8574 I²C backpack1Display4-wire to J4 (I²C address typically 0x27 or 0x3F)
ZMPT101B AC voltage transformer module4Per-channel voltage measurementAC side wires to J1A/B/C/D L+N; DC side 3-wire to J5/J6/J7/J8
USB-to-Serial adapter (CP2102, CH340, FT232)1Firmware upload4–6 wire to J3 (only used during flashing)

Custom library parts (included in repo)

PartFilesSource
HLK-PM01 symbollib/hlk_pm01.kicad_symCustom — drawn from datasheet
HLK-PM01 footprinthlk_pm01.pretty/HLK-PM01.kicad_modCustom — drawn from datasheet (34.2 × 20.2 × 15 mm body, 4-pin THT)

All other symbols and footprints are pulled from KiCad 9's standard libraries.

Board

Size200 × 100 mm, 2-layer FR4, 1.6 mm
Net classesDefault (0.25mm), Power (0.5mm), AC_HV (2.5mm, 4mm clearance, red)
HV/LV separationPhysical slot at x=110..118 mm with 4 mm minimum clearance enforced via custom DRU
Mounting4× 3.2 mm holes at corners

ESP32 GPIO map

GPIOFunctionNotes
GPIO16-19Relay control K1-K4Drives ULN2003A inputs 1-4
GPIO21, 22, 23, 25Manual buttons SW1-SW4Active-low, 10k pull-up to 3V3
GPIO26, 27, 32, 33Status LEDs D1-D4Active-high, 1k current limit
GPIO13I²C SDAShared bus: LCD (0x27) + ADS1115 (0x48)
GPIO14I²C SCLSame shared bus
GPIO34, 35, 36, 39Current sense A0-A3ADC1 input from ACS712 voltage dividers
GPIO0BOOT buttonSW5 + 10k pull-up
ENRESET buttonSW6 + 10k pull-up + 1uF RC delay
TXD0 (GPIO1)UART TXProgramming header J3 pin 3
RXD0 (GPIO3)UART RXProgramming header J3 pin 4

ADS1115 reads voltage sensors V_SENSE_1..4 on its 4 single-ended inputs.

Repository layout

text
.
├── README.md                       # This file
├── bom.csv                         # Bill of materials (source of truth)
├── smart_home.kicad_pro            # KiCad project file
├── smart_home.kicad_sch            # Schematic
├── smart_home.kicad_pcb            # PCB layout (routed)
├── smart_home.kicad_dru            # Custom DRC rules (HV clearance)
├── fp-lib-table / sym-lib-table    # Registers the local hlk_pm01 lib
├── lib/
│   └── hlk_pm01.kicad_sym          # Custom symbol for HLK-PM01
├── hlk_pm01.pretty/
│   └── HLK-PM01.kicad_mod          # Custom footprint for HLK-PM01
├── generate_sch.py                 # Builds smart_home.kicad_sch from bom.csv
├── generate_pcb.py                 # Builds initial smart_home.kicad_pcb
├── add_acs712.py                   # Adds current-sense ICs to PCB (preserves traces)
├── add_voltage_sense.py            # Adds ADS1115 + voltage-sense headers
└── fabrication/                    # Gerbers + drill + pick-and-place (regenerable)

Building the design

Regenerate schematic

text
"C:\Program Files\KiCad\9.0\bin\python.exe" generate_sch.py

Regenerate PCB (initial placement only — overwrites routing)

text
"C:\Program Files\KiCad\9.0\bin\python.exe" generate_pcb.py
"C:\Program Files\KiCad\9.0\bin\python.exe" add_acs712.py
"C:\Program Files\KiCad\9.0\bin\python.exe" add_voltage_sense.py

Run DRC / ERC

text
"C:\Program Files\KiCad\9.0\bin\kicad-cli.exe" sch erc smart_home.kicad_sch --output erc.json
"C:\Program Files\KiCad\9.0\bin\kicad-cli.exe" pcb drc smart_home.kicad_pcb --format json --output drc.json

Export fabrication files

text
"C:\Program Files\KiCad\9.0\bin\kicad-cli.exe" pcb export gerbers smart_home.kicad_pcb -o fabrication/ --no-protel-ext
"C:\Program Files\KiCad\9.0\bin\kicad-cli.exe" pcb export drill smart_home.kicad_pcb -o fabrication/ --format excellon --excellon-units mm --generate-map --map-format gerberx2
"C:\Program Files\KiCad\9.0\bin\kicad-cli.exe" pcb export pos smart_home.kicad_pcb -o fabrication/smart_home-pos.csv --format csv --units mm

Zip everything in fabrication/ and upload to JLCPCB, PCBWay, or OSHPark.

Flashing firmware

Wire a USB-to-serial adapter (CP2102, CH340, FT232) to J3:

J3 pinAdapter
1 — GNDGND
2 — +3V3leave disconnected (board self-powered from mains via PS1)
3 — TXD0RX
4 — RXD0TX
5 — ENDTR (optional, for auto-reset)
6 — IO0RTS (optional, for auto-boot)

Safety: Disconnect mains before plugging in the USB adapter. Then power the board from mains for upload — PS1 supplies 5V/3.3V and is galvanically isolated from mains.

Manual reset sequence: hold SW5 (BOOT) → press+release SW6 (RESET) → release SW5 → click Upload in your IDE.

Compatible with Arduino-ESP32, ESP-IDF, MicroPython, PlatformIO.

External wiring per channel

Each ZMPT101B voltage sensor module is wired externally:

text
AC side (off-PCB):
    J1A pin 1 (L1) ──┐
                     ├── ZMPT101B "AC IN"
    J1A pin 2 (N1) ──┘

DC side (3-wire to PCB):
    ZMPT101B GND ── J5 pin 1
    ZMPT101B VCC ── J5 pin 2 (+3V3)
    ZMPT101B OUT ── J5 pin 3 (→ ADS1115 A0)

Repeat for channels 2, 3, 4 via J6, J7, J8 (→ ADS1115 A1, A2, A3).

Calibrate the trimmer pot on each ZMPT101B so its output stays in 0–3.3V range.

Safety

  • The HV side (input terminals, fuses, relays, MOV, PS1 AC input) carries lethal mains voltage. Always disconnect mains before working on the board.
  • The HV/LV isolation slot in the PCB and the 4 mm HV-to-LV clearance rule provide creepage isolation per IEC 60664-1 for pollution degree 2, working voltage 250V.
  • Each input has its own T4A slow-blow fuse (F1–F4). Replace only with the same rating.
  • HLK-PM01 provides galvanic isolation between mains and the 5V rail (2.1 kV rated).
  • ACS712-05B provides 2.1 kVrms isolation between the load current path and the MCU side.
  • Use a properly rated enclosure with strain-relief for mains wiring. Do not power up outside an enclosure.

This is a hobby project. The author assumes no liability for damage, injury, or fire resulting from its use. Build and operate at your own risk and in compliance with local electrical codes.

License

MIT License.

Copyright © 2026 WisRight Technologies Private Limited.

Permission is hereby granted, free of charge, to any person obtaining a copy of this hardware design and associated documentation files, to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the design, subject to the standard MIT terms — provided as-is, without warranty of any kind, especially regarding electrical safety. See LICENSE for the full text.

Maintainer

Designed and maintained by WisRight Technologies Private Limited.

For commercial inquiries, custom variants (different relay ratings, board sizes, sensor configurations, or firmware integration), please open an issue on this repository.

Parts

76
QtyValueFootprintReferences
1010kResistor_SMD:R_0805_2012MetricR5, R6, R7, R8, R11, R12, R15, R16, R17, R18
7100nFCapacitor_SMD:C_0805_2012MetricC5, C7, C8, C9, C10, C11, C16
6TACT_6mmButton_Switch_THT:SW_PUSH_6mmSW1, SW2, SW3, SW4, SW5, SW6
51kResistor_SMD:R_0805_2012MetricR1, R2, R3, R4, R9
418kResistor_SMD:R_0805_2012MetricR19, R20, R21, R22
4ACS712-05BPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU4, U5, U6, U7
4LED_GreenLED_THT:LED_D3.0mmD1, D2, D3, D4
4SRD-05VDC-SL-CRelay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK1, K2, K3, K4
4T4AFuse:Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_OpenF1, F2, F3, F4
210uFCapacitor_SMD:C_0805_2012MetricC2, C4
24.7kResistor_SMD:R_0805_2012MetricR13, R14
1100uF/16VCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC1
11uFCapacitor_SMD:C_0805_2012MetricC6
122uFCapacitor_SMD:C_0805_2012MetricC3
1AC_IN_1TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ1A
1AC_IN_2TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ1B
1AC_IN_3TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ1C
1AC_IN_4TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_HorizontalJ1D
1ADS1115Package_SO:TSSOP-10_3x3mm_P0.5mmU8
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U3
1ESP32-WROOM-32ERF_Module:ESP32-WROOM-32U1
1HLK-PM01hlk_pm01:HLK-PM01PS1
1LCD I2CConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ4
1LED_RedLED_THT:LED_D3.0mmD5
1LOAD_1TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ2A
1LOAD_2TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ2B
1LOAD_3TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ2C
1LOAD_4TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ2D
1PROGConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ3
1S07K275Varistor:RV_Disc_D9mm_W5.2mm_P5mmRV1
1ULN2003APackage_DIP:DIP-16_W7.62mmU2
1V_SENSE_1Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ5
1V_SENSE_2Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6
1V_SENSE_3Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ7
1V_SENSE_4Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ8

Similar boards

  • 2 layers270.6 × 182.2 mmSmarthomeiot, the printed circuit board in 3D

    Smarthomeiot

    haripradhap14/ESP32-4CH-Relay-Controller-

    4-channel IoT relay controller using ESP32-WROOM-32E for home automation.

    31 parts1
  • 2 layers132 × 130 mmTesting6, the printed circuit board in 3D

    Testing6

    vairabarath/smart-home-controller-

    ESP32 Smart Home Controller - KiCad test projects

    43 parts
  • 2 layers94.5 × 70.1 mmTIME BASED RELAY, the printed circuit board in 3D

    TIME BASED RELAY

    MAATHES-THILAK-K/4CH_RELAY_TIMER

    ESP32C3 Mini Based 4CH Relay With Timer Control

    50 parts1Apache-2.0
  • 2 layers121 × 54 mmSmart plug, the printed circuit board in 3D

    Smart plug

    tauhidansari07/ESP32-Smart-Relay

    21 parts
  • 2 layers114 × 105 mmSmell monitor v1 1, the printed circuit board in 3D

    Smell monitor v1 1

    OpenSmell/smell-monitor

    The enclosure is the simple one a builder can hold in their head: an open tray, a board on four standoffs, modules plugged into eight headers, a flat lid with four M3 screws, a filter pad that drops into the front, and…

    64 parts
  • 2 layers260 × 440 mmMultical, the printed circuit board in 3D

    Multical

    Samuelmathe/TFC-Multicanal-Goma

    TFC ULPGL Goma - Systeme IoT multicanal de sous-comptage energetique (ESP32, KiCad, Flutter)

    67 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 layers148.3 × 127.5 mmISLKey, the printed circuit board in 3D

    ISLKey

    ISLKey/islkey

    ISLKey access-control platform — ESP32 firmware, Electron flasher, Flutter app, KiCad schematic (ISL Technologies)

    47 parts

Questions

How big is the Smart home PCB?

It measures 200 × 100 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Smart home use?

76 parts, built around the ESP32-WROOM-32E, HLK-PM01, ADS1115 and AMS1117-3.3. 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 Smart home KiCad files?

From the vishal007-hacker/smart-home repository on GitHub, at the commit this page was made from: the board is smart_home.kicad_pcb and its schematic smart_home.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smart home design in my own project?

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