Smart Home Controller – ESP32 + Relay + IR + ESPHome Integration
by Markus24152 in Circuits > Electronics
71 Views, 2 Favorites, 0 Comments
Smart Home Controller – ESP32 + Relay + IR + ESPHome Integration
This Smart Home Controller is a compact ESP32-based module that can switch any AC or DC load via relay — either through Wi-Fi (ESPHome + Alexa + Home Assistant) or via an IR remote.
It’s fully custom-designed on a PCB and includes:
- An ESP32-WROOM microcontroller
- Relay output
- IR receiver (programmable for any button on your remote)
- Wide input range (up to 48 V with onboard step-down converter)
- Extra GPIO pin for extensions or sensors
- Powered by ESPHome firmware for easy integration
Supplies
Relay module SRD-05VDC-SL-C
IR Receiver TSOP38238
Step Down LM2596S-3.3
Transistor BC817
Optocoupler PC817
Capacitors, resistors 0805
PCB from JLCPCB
📐 Circuit Design
The PCB connects the ESP32 with the relay driver circuit and IR receiver.
The GPIO for the relay is configured in ESPHome, while another GPIO is available for expansion (sensors, LEDs, etc.).
A buck converter regulates the wide input voltage down to 3V3.
💻 PCB Fabrication With JLCPCB
Ordering your custom PCB is simple and gives high-quality professional results. Here’s how I do it:
Click “Quote Now”, upload your Gerber zip.
Choose options:
- 2 Layers
- 1.6 mm thickness
- HASL / ENIG finish
- Green or any color you like
A special thanks goes to the nice girls and guys at JLCPCB for sponsoring PCBs manufacturing.
Without their contribution this project would have never seen the light, like many others projects of mine now.
🔧 Assembly
1️⃣ SMD Soldering
Start by soldering the small SMD components first (resistors, capacitors, transistor, etc.).
You can hand-solder with fine tip + flux or use a hot plate/reflow method.
2️⃣ Through-Hole Components
Next, solder:
- ESP32 header
- Relay
- Screw terminals
- IR receiver
3️⃣ Final Check
Ensure polarity of capacitors and diode are correct.
Power up via 5 V USB or external 12–48 V supply.
⚙️ Flashing the Firmware
📡 Testing
- Test relay switching via ESPHome dashboard.
- Train IR receiver with your remote button.
- Verify Wi-Fi connection and power consumption.