Turning a Simple Home Switchboard Into a Smart Touch Controller Using ESP32-S3 (LovyanGFX)
by rohanbarnwal in Circuits > Arduino
52 Views, 0 Favorites, 0 Comments
Turning a Simple Home Switchboard Into a Smart Touch Controller Using ESP32-S3 (LovyanGFX)
Home automation projects usually look impressive in videos, but when you try building one yourself, things quickly become messy — loose wires, random modules on the desk, and half-finished enclosures.
In this tutorial, we build a clean, touch-based controller using the ESP32-S3 Box 3 that can control four lights locally, without any app or cloud dependency. This project is beginner-friendly, works offline, and is perfect as a practical home automation demo or hackathon prototype.
Supplies
For this build, you’ll need:
- ESP32-S3 Box 3 (with built-in touchscreen)
- 4-channel relay module
- Jumper wires
- 5V power supply
The ESP32 handles the UI and touch input, while the relay module switches the actual loads (lights).
The Idea
Most homes still rely on traditional mechanical switchboards. They work fine, but they don’t provide visual feedback or flexibility for future automation.
Instead of replacing every switch with expensive smart switches, this project replaces the control logic behind the switchboard with a single touchscreen panel.
The goal is simple: big buttons, clear ON/OFF feedback, instant response, and no internet dependency.
Wiring Overview
Each light is controlled by one relay channel, and each relay channel is driven by one GPIO pin on the ESP32-S3:
- GPIO 10 → Light 1
- GPIO 14 → Light 2
- GPIO 13 → Light 3
- GPIO 21 → Light 4
Power the relay module using 5V and GND.
Note: Many relay boards are active-low, so ON/OFF logic may appear inverted.
Building the Touch UI With LovyanGFX
LovyanGFX is used to handle the display and touch input.
The UI is kept intentionally minimal:
- Four large buttons
- Green = ON
- Grey = OFF
This makes the system easy to use for anyone, even without technical knowledge.
Code Overview (High-Level)
The code has three main responsibilities:
- Initialize the display using LovyanGFX
- Draw four touch buttons on the screen
- Toggle GPIO pins when a button is touched
Each button maps to one GPIO pin. When a button is pressed, the ESP32 toggles the corresponding relay.
Testing & Working Demo
After uploading the code and powering the system:
- Tap a button on the screen
- The relay switches
- The light turns ON or OFF instantly
Because everything runs locally on the ESP32, the system works even when Wi-Fi is unavailable.
Taking the Project to the Next Level – What JUSTWAY Offers
A prototype with loose wires and a bare PCB is fine for testing. But when you want to present your project at a tech fair, demo day, or pitch session, presentation matters.
This is where professional fabrication and enclosure services become useful. Instead of exposed electronics, you can package your project in a proper casing and make it look like a real product.
JUSTWAY offers multiple manufacturing options that support different stages of hardware development:
- Rapid Prototyping – fast turnaround, DFM feedback, online quoting
- CNC Machining – precise aluminum and steel parts for strong enclosures
- Sheet Metal Fabrication – laser-cut and bent metal frames and casings
- Injection Molding – prototype molds and production tooling
- Urethane Casting – low-volume, production-quality parts
- 3D Printing – transparent resin for aesthetic enclosures, nylon for durable functional parts
These options don’t change how your circuit works — they change how your project is presented and perceived.
Watch the Full Build Video
I’ve also documented the complete build process in a step-by-step video, including wiring, UI design, and live testing.
If you prefer learning by watching, this will help you follow along and build the same project easily.
Final Thoughts
This ESP32-S3 touchscreen controller shows how you can move from basic GPIO control to a clean, usable interface without adding cloud complexity.
From here, you can extend the project with timers, a web dashboard, voice control, or energy monitoring. Even in its current form, it demonstrates how UI design and physical presentation can take a DIY project closer to a real product.