An ESP32-based relay control system that provides two independent methods for manually controlling electrical appliances:
- 🌐 Local Wi-Fi Web Interface
- 👏 Clap Detection
The ESP32 operates in Access Point (AP) mode, allowing users to connect directly from a smartphone without requiring an internet connection or external router.
The project is designed using a 4-channel relay module with appliances connected through the Normally Closed (NC) contacts. Three relays are currently used, while the fourth relay is reserved for future expansion.
The firmware is completely non-blocking and uses millis() for timing, allowing clap detection and the web server to operate simultaneously without affecting each other.
- ESP32 Access Point Mode
- No Internet Required
- Built-in Web Server
- Responsive Mobile-Friendly Web Interface
- Independent Control of Three Relays
- Clap Detection Using LM393 Sound Sensor
- Single Clap → Turn ON All Appliances
- Double Clap (Within 2 Seconds) → Turn OFF All Appliances
- 200 ms Clap Debounce
- Last Command Wins Logic
- Non-Blocking Firmware
- Future Expansion Support (Relay 4 Reserved)
- ESP32 DevKit (USB Type-C)
- 4-Channel 5V Relay Module
- LM393 Sound Sensor Module
- 5V 2A Power Adapter
| GPIO | Function |
|---|---|
| GPIO16 | Relay 1 |
| GPIO17 | Relay 2 |
| GPIO5 | Relay 3 |
| GPIO18 | Relay 4 (Reserved) |
| GPIO15 | Sound Sensor |
Connect to the ESP32 Wi-Fi hotspot and open: http://192.168.4.1
Control each appliance independently through the browser.
- 1 Clap → Turn ON All Appliances
- 2 Claps (within 2 seconds) → Turn OFF All Appliances
The Arduino sketch for this project is available at:
ESP32_AccessPoint_Relay_Control.ino
- Install ESP32 board support in Arduino IDE.
- Open
ESP32_AccessPoint_Relay_Control.ino. - Select your ESP32 board and port.
- Upload the sketch.
- Connect to Wi-Fi SSID
ESP32-Relay-Control(password12345678) and openhttp://192.168.4.1.