Build your own smart home automation system using a NodeMCU ESP8266 and the Blynk IoT platform. This project lets you control home appliances like fans or lights using your smartphone — from anywhere.
- Features
- Required Components
- Circuit Diagram & Connections
- Setting Up Blynk Cloud
- Installing Arduino IDE & Uploading Code
- Connecting Device to Blynk App
- Troubleshooting
- Demo
- License
- Author
- Contributing
✅ Control up to 4 devices via smartphone
✅ Remembers relay state after reboot (via cloud sync)
✅ Uses Blynk cloud & app (free)
✅ Modular and OTA-ready firmware structure
✅ Easy for beginners to set up and understand
Component | Quantity | Description |
---|---|---|
NodeMCU ESP8266 | 1 | Wi-Fi enabled microcontroller |
4-Channel Relay Module | 1 | For controlling appliances |
Jumper Wires | As needed | For connecting modules |
Power Supply (5V, 2A) | 1 | To power the NodeMCU and relay board |
AC Appliances | 1–4 | Fan, Light, etc. |
Relay Pin | Connect To (NodeMCU) |
---|---|
VCC | VIN (5V) |
GND | G |
IN1 | D1 |
IN2 | D2 |
IN3 | D3 |
IN4 | D4 |
💡 Optional: Add an LED to D0 and 3.3V to indicate Wi-Fi connection status.
-
Go to https://blynk.cloud
-
Log in or sign up
-
Create a new template and configure:
- Virtual pins:
V0
= State Memory,V1–V4
= Control pins
- Virtual pins:
-
Copy these details into your Arduino sketch:
#define BLYNK_TEMPLATE_ID "Your_Template_ID"
#define BLYNK_TEMPLATE_NAME "Your_Template_Name"
#define BLYNK_FIRMWARE_VERSION "1.0.0"
-
Go to File → Preferences
-
Add this to “Additional Board Manager URLs”:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
-
Go to Tools → Board → Boards Manager
-
Search for
esp8266
and install it
- Open the
.ino
file from this repo - Replace your Template ID, Wi-Fi SSID, and password
- Select Board: NodeMCU 1.0 (ESP-12E Module)
- Hit Upload
-
Install Blynk IoT App → Google Play → App Store
-
Log in and tap + to add a device
-
Select “Discover Nearby”
-
Choose your NodeMCU device
-
Enter Wi-Fi credentials
-
Configure the device dashboard:
- Add buttons for V1–V4
- Add switch for V0 to enable state memory
Problem | Solution |
---|---|
Device not detected | Ensure NodeMCU is in pairing mode and powered on |
Relay not triggering | Check wiring and pin mapping |
Frequent reboots | Use a stable 5V 2A power supply |
Upload errors | Verify USB cable, COM port, and correct board selected |
Blynk app not responding | Double-check virtual pin assignment and template sync |
We welcome contributions of any kind:
- 🐛 Report bugs → Submit an issue
- 🌟 Star the repo → Give it a star
- 🛠️ Submit improvements → Open a pull request
- 📈 View repo activity → Repo insights
This project is licensed under the MIT License. See the LICENSE file for details.
Developed by Apurbo Islam For more cool projects: On GitHub
🚀 Let’s build the future of connected homes, one relay at a time!