
Smarthomeiot
haripradhap14/ESP32-4CH-Relay-Controller-
4-channel IoT relay controller using ESP32-WROOM-32E for home automation.

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.
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.
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.
| Section | Parts |
|---|---|
| AC inputs | 4× Phoenix MKDS-1.5 3-pos terminals (L, N, PE per channel) |
| Protection | 4× T4A 5×20mm fuses (one per channel) + 1× S07K275 MOV across L1/N1 |
| Power supply | HLK-PM01 (230VAC → 5VDC) + AMS1117-3.3 (5V → 3.3V LDO) |
| Switching | 4× SANYOU SRD-05VDC SPDT relays (10A) driven by ULN2003A Darlington array |
| MCU | ESP32-WROOM-32E module (WiFi + Bluetooth) |
| AC outputs | 4× Phoenix MKDS-1.5 2-pos terminals (L_switched, N_passthrough per channel) |
| Current sense | 4× ACS712-05B (SOIC-8, ±5A range, internal isolation) |
| Voltage sense | 4× external ZMPT101B modules via 1× ADS1115 (I²C ADC at 0x48) |
| User interface | 4× 6mm tactile buttons + 4× green status LEDs + 1× red power LED + 4-pin I²C LCD header |
| Programming | 6-pin UART header (GND, +3V3, TXD0, RXD0, EN, IO0) |
Full bill of materials in bom.csv — 43 grouped rows, 76 component instances.
| Ref | Qty | Part | Package | Description |
|---|---|---|---|---|
| U1 | 1 | ESP32-WROOM-32E | Module 18×25.5mm | Espressif WiFi+BT MCU, 240MHz dual-core, 4MB flash, integrated PCB antenna |
| U2 | 1 | ULN2003A | DIP-16 | Texas Instruments 7-channel Darlington array (500mA per channel, up to 50V), drives relay coils |
| U3 | 1 | AMS1117-3.3 | SOT-223-3 | Advanced Monolithic Systems 3.3V LDO regulator, 1A capacity, drops 5V→3.3V for ESP32 |
| PS1 | 1 | HLK-PM01 | THT 34.2×20.2mm | Hi-Link AC-DC isolated SMPS module, 230VAC→5VDC @ 600mA, 2.1 kV isolation, 3W |
| U4-U7 | 4 | ACS712ELCTR-05B | SOIC-8 | Allegro Hall-effect current sensor, ±5A range, 185 mV/A sensitivity, 2.1 kVrms isolation between IP± and signal pins |
| U8 | 1 | ADS1115IDGSR | TSSOP-10 | Texas 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-K4 | 4 | SRD-05VDC-SL-C | THT | Sanyou SPDT relay, 5V coil ~70mA, contacts rated 10A @ 250VAC / 30VDC |
| Ref | Qty | Value | Package | Use |
|---|---|---|---|---|
| R1-R4 | 4 | 1 kΩ | 0805 SMD | Status LED current limit (D1-D4) |
| R9 | 1 | 1 kΩ | 0805 SMD | Power LED current limit (D5) |
| R5-R8 | 4 | 10 kΩ | 0805 SMD | Manual button pull-ups to +3V3 (SW1-SW4) |
| R11 | 1 | 10 kΩ | 0805 SMD | ESP32 EN pin pull-up to +3V3 |
| R12 | 1 | 10 kΩ | 0805 SMD | ESP32 BOOT (GPIO0) pull-up to +3V3 |
| R13 | 1 | 4.7 kΩ | 0805 SMD | I²C SDA pull-up to +3V3 |
| R14 | 1 | 4.7 kΩ | 0805 SMD | I²C SCL pull-up to +3V3 |
| R15-R18 | 4 | 10 kΩ | 0805 SMD | ACS712 output divider (top) — scales 0-5V to 0-3.21V for ESP32 ADC |
| R19-R22 | 4 | 18 kΩ | 0805 SMD | ACS712 output divider (bottom) |
| C1 | 1 | 100 µF / 16V | Radial THT 6.3mm | HLK-PM01 +5V output bulk capacitor (absorbs ESP32 WiFi transient bursts) |
| C2 | 1 | 10 µF | 0805 SMD | AMS1117 input cap |
| C3 | 1 | 22 µF | 0805 SMD | AMS1117 output cap (recommended ≥22µF tantalum/ceramic for AMS1117 stability) |
| C4 | 1 | 10 µF | 0805 SMD | ESP32 +3V3 bulk |
| C5 | 1 | 100 nF | 0805 SMD | ESP32 3V3 decoupling (place within 3mm of module pin 2) |
| C6 | 1 | 1 µF | 0805 SMD | EN pin RC delay (forms ~10ms power-up delay with R11=10k) |
| C7 | 1 | 100 nF | 0805 SMD | ULN2003A VCC decoupling |
| C8-C11 | 4 | 100 nF | 0805 SMD | ACS712 VCC decoupling (one per ACS712) |
| C16 | 1 | 100 nF | 0805 SMD | ADS1115 VDD decoupling |
| D1-D4 | 4 | LED 3mm green | THT | Per-channel relay status indicator |
| D5 | 1 | LED 3mm red | THT | Power-on indicator (always on while +5V present) |
| F1-F4 | 4 | T4A 5×20 mm | THT Schurter 0031.8201 holder | Slow-blow mains fuse, one per AC input channel |
| RV1 | 1 | S07K275 | Disc D9mm | EPCOS metal oxide varistor, 275 VAC clamping, surge protection across L1/N1 |
| Ref | Qty | Type | Use |
|---|---|---|---|
| SW1-SW4 | 4 | 6mm tactile THT | Manual override buttons (one per channel) — momentary press toggles the relay |
| SW5 | 1 | 6mm tactile THT | BOOT button — hold during reset to enter ESP32 download mode |
| SW6 | 1 | 6mm tactile THT | RESET button — pulls ESP32 EN low |
| Ref | Qty | Type | Use |
|---|---|---|---|
| J1A, J1B, J1C, J1D | 4 | Phoenix MKDS-1.5 3-pos screw terminal, 5.08mm pitch | AC input per channel: L (Live), N (Neutral), PE (Protective Earth) |
| J2A, J2B, J2C, J2D | 4 | Phoenix MKDS-1.5 2-pos screw terminal, 5.08mm pitch | AC switched output per channel: L_out, N_passthrough |
| J3 | 1 | 1×6 pin header, 2.54mm pitch | UART programming: GND, +3V3, TXD0, RXD0, EN, IO0 |
| J4 | 1 | 1×4 pin header, 2.54mm pitch | External 16×2 LCD via PCF8574 I²C backpack: GND, +5V, SDA, SCL |
| J5, J6, J7, J8 | 4 | 1×3 pin header, 2.54mm pitch | External ZMPT101B voltage sensor per channel: GND, +3V3, VOUT |
| Module | Quantity | Purpose | Connection |
|---|---|---|---|
| 16×2 LCD with PCF8574 I²C backpack | 1 | Display | 4-wire to J4 (I²C address typically 0x27 or 0x3F) |
| ZMPT101B AC voltage transformer module | 4 | Per-channel voltage measurement | AC 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) | 1 | Firmware upload | 4–6 wire to J3 (only used during flashing) |
| Part | Files | Source |
|---|---|---|
| HLK-PM01 symbol | lib/hlk_pm01.kicad_sym | Custom — drawn from datasheet |
| HLK-PM01 footprint | hlk_pm01.pretty/HLK-PM01.kicad_mod | Custom — 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.
| Size | 200 × 100 mm, 2-layer FR4, 1.6 mm |
| Net classes | Default (0.25mm), Power (0.5mm), AC_HV (2.5mm, 4mm clearance, red) |
| HV/LV separation | Physical slot at x=110..118 mm with 4 mm minimum clearance enforced via custom DRU |
| Mounting | 4× 3.2 mm holes at corners |
| GPIO | Function | Notes |
|---|---|---|
| GPIO16-19 | Relay control K1-K4 | Drives ULN2003A inputs 1-4 |
| GPIO21, 22, 23, 25 | Manual buttons SW1-SW4 | Active-low, 10k pull-up to 3V3 |
| GPIO26, 27, 32, 33 | Status LEDs D1-D4 | Active-high, 1k current limit |
| GPIO13 | I²C SDA | Shared bus: LCD (0x27) + ADS1115 (0x48) |
| GPIO14 | I²C SCL | Same shared bus |
| GPIO34, 35, 36, 39 | Current sense A0-A3 | ADC1 input from ACS712 voltage dividers |
| GPIO0 | BOOT button | SW5 + 10k pull-up |
| EN | RESET button | SW6 + 10k pull-up + 1uF RC delay |
| TXD0 (GPIO1) | UART TX | Programming header J3 pin 3 |
| RXD0 (GPIO3) | UART RX | Programming header J3 pin 4 |
ADS1115 reads voltage sensors V_SENSE_1..4 on its 4 single-ended inputs.
.
├── 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)"C:\Program Files\KiCad\9.0\bin\python.exe" generate_sch.py"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"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"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 mmZip everything in fabrication/ and upload to JLCPCB, PCBWay, or OSHPark.
Wire a USB-to-serial adapter (CP2102, CH340, FT232) to J3:
| J3 pin | Adapter |
|---|---|
| 1 — GND | GND |
| 2 — +3V3 | leave disconnected (board self-powered from mains via PS1) |
| 3 — TXD0 | RX |
| 4 — RXD0 | TX |
| 5 — EN | DTR (optional, for auto-reset) |
| 6 — IO0 | RTS (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.
Each ZMPT101B voltage sensor module is wired externally:
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.
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.
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.
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.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 10 | 10k | Resistor_SMD:R_0805_2012Metric | R5, R6, R7, R8, R11, R12, R15, R16, R17, R18 |
| 7 | 100nF | Capacitor_SMD:C_0805_2012Metric | C5, C7, C8, C9, C10, C11, C16 |
| 6 | TACT_6mm | Button_Switch_THT:SW_PUSH_6mm | SW1, SW2, SW3, SW4, SW5, SW6 |
| 5 | 1k | Resistor_SMD:R_0805_2012Metric | R1, R2, R3, R4, R9 |
| 4 | 18k | Resistor_SMD:R_0805_2012Metric | R19, R20, R21, R22 |
| 4 | ACS712-05B | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U4, U5, U6, U7 |
| 4 | LED_Green | LED_THT:LED_D3.0mm | D1, D2, D3, D4 |
| 4 | SRD-05VDC-SL-C | Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_C | K1, K2, K3, K4 |
| 4 | T4A | Fuse:Fuseholder_Cylinder-5x20mm_Schurter_0031_8201_Horizontal_Open | F1, F2, F3, F4 |
| 2 | 10uF | Capacitor_SMD:C_0805_2012Metric | C2, C4 |
| 2 | 4.7k | Resistor_SMD:R_0805_2012Metric | R13, R14 |
| 1 | 100uF/16V | Capacitor_THT:CP_Radial_D6.3mm_P2.50mm | C1 |
| 1 | 1uF | Capacitor_SMD:C_0805_2012Metric | C6 |
| 1 | 22uF | Capacitor_SMD:C_0805_2012Metric | C3 |
| 1 | AC_IN_1 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal | J1A |
| 1 | AC_IN_2 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal | J1B |
| 1 | AC_IN_3 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal | J1C |
| 1 | AC_IN_4 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-3-5.08_1x03_P5.08mm_Horizontal | J1D |
| 1 | ADS1115 | Package_SO:TSSOP-10_3x3mm_P0.5mm | U8 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U3 |
| 1 | ESP32-WROOM-32E | RF_Module:ESP32-WROOM-32 | U1 |
| 1 | HLK-PM01 | hlk_pm01:HLK-PM01 | PS1 |
| 1 | LCD I2C | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J4 |
| 1 | LED_Red | LED_THT:LED_D3.0mm | D5 |
| 1 | LOAD_1 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J2A |
| 1 | LOAD_2 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J2B |
| 1 | LOAD_3 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J2C |
| 1 | LOAD_4 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J2D |
| 1 | PROG | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J3 |
| 1 | S07K275 | Varistor:RV_Disc_D9mm_W5.2mm_P5mm | RV1 |
| 1 | ULN2003A | Package_DIP:DIP-16_W7.62mm | U2 |
| 1 | V_SENSE_1 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J5 |
| 1 | V_SENSE_2 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J6 |
| 1 | V_SENSE_3 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J7 |
| 1 | V_SENSE_4 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J8 |

haripradhap14/ESP32-4CH-Relay-Controller-
4-channel IoT relay controller using ESP32-WROOM-32E for home automation.


MAATHES-THILAK-K/4CH_RELAY_TIMER
ESP32C3 Mini Based 4CH Relay With Timer Control


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…

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

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.

ISLKey/islkey
ISLKey access-control platform — ESP32 firmware, Electron flasher, Flutter app, KiCad schematic (ISL Technologies)
It measures 200 × 100 mm and has 2 copper layers, 1.6 mm thick.
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.
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.
Its repository states no licence, so its author keeps all rights: ask vishal007-hacker before reusing the design.