Custom ESP32 Dual-Channel IoT Relay Board
Friday, August 28, 2026
1. Circuit Design and Architecture

The core of this system is the ESP32-WROOM-32E module, providing robust Wi-Fi and Bluetooth capabilities for seamless IoT connectivity. As shown in the KiCad schematic, the board features a CH340C USB-to-UART bridge paired with an auto-programming circuit, eliminating the need to manually hold down boot buttons during firmware uploads.
Power regulation is handled efficiently by an AMS1117-3.3 low-dropout regulator to safely step down the 5V USB-C input. To ensure the microcontroller is protected from high-voltage spikes, the relay circuitry utilizes PC817 optocouplers and SS8050 power transistors, providing complete galvanic isolation between the logic level and the high-power AC side.
2. PCB Layout and Component Routing

Moving from the schematic to the physical board, this custom two-layer printed circuit board was routed to keep the footprint compact while adhering to safe clearance rules for the high-voltage AC tracks near the screw terminals.
By utilizing 0805 SMD components, the board remains space-efficient and modern. The silkscreen includes a clean, professional aesthetic with clear terminal block labeling (NO, COM, NC) to make external wiring straightforward and safe.
3. Custom Hardware Enclosure

A bare PCB is rarely the final step for a practical home automation device. Using Autodesk Fusion 360, a custom parametric enclosure was modeled to securely house the board.
This exploded CAD view demonstrates the tailored two-piece design: a bottom case with precise cutouts for the USB-C port and relay terminal blocks, alongside a fitted lid. This ensures all high-voltage components are safely enclosed while maintaining a sleek, minimal form factor ready for 3D printing in PLA+ or PETG.
This custom module bridges the gap between digital logic and high-power AC control, forming a perfect hardware foundation for localized IoT systems.
Resources :- https://drive.google.com/drive/folders/1w8zX1Ob00dMTbBJzCs3eRJE5c7nFEel-?usp=sharing
