Adults onlyESP32Level 3/3
DIY Wi-Fi Touch Switch With ESP32
A glass touch panel that switches your light, fan, lamp and socket by touch or from your phone, and keeps working with no internet.
Sign in to save
Adults only
The relays switch mains electricity, which can kill.
Not for children. Build at your own risk.
MAINS VOLTAGE, ADULTS ONLY. Build this only if you are trained in mains wiring. Switch off the supply first, use a proper enclosure and fuse, and keep neutral going straight to the loads.
Strictly follow the description given with this video.
Video
How it works
- Four copper pads behind the glass sense a finger; the ESP32 reads them on its built-in touch pins.
- Each touch flips one channel of a 4-channel relay, which switches the live wire to that load.
- The ESP32 also serves a small web page, so the phone and the panel stay in sync.
- Touch works even if Wi-Fi is down. The fan output is on/off only, with no speed control.
Parts you need
Wiring
PowerGroundSignal
| # | From | Connect to |
|---|---|---|
| 1 Signal | Touch pads 1–4 | ESP32 GPIO4, 15, 13, 14 |
| 2 Signal | Relay IN1–IN4 | ESP32 GPIO26, 27, 25, 33 |
| 3 Power | 5 V module output | ESP32 VIN and relay VCC |
| 4 Power | Mains live (fused) | Relay COM terminals |
| 5 Power | Relay NO terminals | Light, fan, lamp, socket |
| 6 Power | Mains neutral | Straight to the loads |
| 7 Ground | All low-voltage grounds | Common GND |
3D print files
This project has no 3D-printed parts.