Smart Home Automation
Project Overview
The Smart Home Automation system uses an ESP32 microcontroller to control up to 8 household appliances — lights, fans, and sockets — via a web dashboard and voice commands. Connected to the home Wi-Fi network and running an MQTT broker, it enables real-time control from any device on the local network without requiring a cloud subscription or internet connection.
Key Features & Implementation
- 8-Channel Relay Control: Eight optocoupler-isolated relay modules safely switch 230V AC loads, controlled individually through dedicated MQTT topics published by the ESP32.
- Local Web Dashboard: The ESP32 hosts a responsive web app served over its IP address, showing live appliance states with toggle switches that update in real time using WebSocket communication.
- Google Assistant Integration: Via IFTTT webhooks, voice commands like "Hey Google, turn off the fan" trigger HTTP requests that publish MQTT messages to the ESP32 within 2 seconds.
Challenges Solved
Preventing relay chatter during ESP32 Wi-Fi reconnection events — which caused brief power glitches — required implementing a state-persistence mechanism that saves relay states to flash memory and restores them correctly on every boot and reconnection cycle.