IoT Home Automation with ESP32 + Blynk
Connect an ESP32 to a 4-channel relay module, program it with Blynk credentials, and control four AC appliances (lights, fan, TV) from anywhere in the world using the free Blynk mobile app. A staple final-year IoT project.
Materials
- ESP32 DevKit V1
- 4-channel relay module (5 V)
- Jumper wires
- 5 V / 2 A power supply
- AC appliances + wiring (adult supervision required)
Tools
- Arduino IDE with ESP32 board package
- Blynk mobile app
- Wi-Fi network
Step-by-step guide
- 1
Set up Blynk
Install Blynk app, create a template with 4 datastreams (V0–V3, Integer, 0–1), add 4 button widgets.
- 2
Wire the relay
VCC → 5V (ESP32 VIN when powered by USB), GND → GND, IN1–IN4 → GPIO 26, 27, 32, 33.
- 3
Install libraries
Add 'Blynk' library via Library Manager. Add ESP32 board package via Preferences.
- 4
Flash the sketch
Fill in BLYNK_TEMPLATE_ID, BLYNK_AUTH_TOKEN, Wi-Fi SSID and password. Upload.
- 5
Test
Open the Blynk app. Tap each button — the corresponding relay clicks. Wire your appliances only after bench-testing.
FAQs
Is it safe to switch AC mains?
Only with proper insulation, a fused live line, and adult supervision. Beginners should stick to 12 V DC lamps for practice.
Can I use ESP8266 / NodeMCU instead?
Yes — the code changes to use ESP8266WiFi.h. Fewer GPIOs, but for 4 relays it's fine.
Everything you need in one box
This project is fully covered by the Advanced Development Kit.
View kit
