IOT Based Home Automation by Using ESP8266 (NodeMcu) with Blynk

After successful Completion of this project, you would be able to control your home appliances such as Tv, Fan, Bulb, Motor, Refrigerator, and door lock e.t.c. with the help of your smartphone from anywhere in the world. Esp8266 a wifi Module plays a vital role in this IOT Based Home Automation Project.

An Esp8266 Module will Receive commands from your smartphone wirelessly through the internet. To Encode those commands in a smartphone and send it to ESP8266, for doing this job we need an application to perform this task. There are numerous Applications Available but we are going to choose the best one and that is “Blynk” this application is Available for both platforms such as iOs OR Android. You can create Creative Projects with the Help of Blynk APP. I would Strongly Recommend this Article to beginners : 

Learning How to Use Esp8266 in Combination with Blynk App | IoT

This Project requires a streamless internet connectivity as we already know that IOT is totally dependent on Internet Connectivity. Everything is clearly defined in the video Tutorial and one thing more don’t hesitate to ask any question related to this Project.  We are always available to answer your Questions. 

Components Required:

  1.  Esp8266 (NodeMcu) — Click Here To Buy This Module Online from Our Official Store 
  2. 4-Channel Relay Module — Click Here To Buy This Module Online from Our Official Store 
  3. DC-DC Adjustable Step-Down Module Power Supply —Click Here To Buy This Module Online from Our Official Store 
  4. Jumper Wire —Click Here To Buy now from Our Official Online Store 
  5. Soldering Iron — Click Here To Buy now from Our Official Online Store 
  6. Smartphone ( iOS OR Android)
  7. Blynk App —- Click here To Download This App from Google Play Store 

Schematic Diagram:

Connection Pinout :

  • Connect ESP8266 (NodeMcu) GPIO D0 Pin To IN1 Of Relay 1 in Board 
  • Connect ESP8266 (NodeMcu) GPIO D1 Pin To IN2 Of Relay 2 in Board 
  • Connect ESP8266 (NodeMcu) GPIO D2 Pin To IN3 Of Relay 3 in Board 
  • Connect ESP8266 (NodeMcu) GPIO D3 Pin To IN4 Of Relay 4 in Board 
  • Connect Power Source to ESP8266 and Realy Board

Source Code:

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "7c9d873ab07c49cd8de99675f1dbff2d";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "pcnet-386";
char pass[] = "3rdbencher3c";

  int relay1 = 16; //GPIO16 D0 pin 
  int relay2 = 5;  //GPIO5 D1 pin 
  int relay3 = 4;  //GPIO4 D2 pin 
  int relay4 = 0;  //GPIO0 D3 pin 

void setup()
{
  // Debug console
  Serial.begin(115200);

  pinMode(relay1,OUTPUT);
  pinMode(relay2,OUTPUT);
  pinMode(relay3,OUTPUT);
  pinMode(relay4,OUTPUT);

  digitalWrite(relay1, HIGH);
  digitalWrite(relay2, HIGH);
  digitalWrite(relay3, HIGH);
  digitalWrite(relay4, HIGH);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}

void loop()
{
  Blynk.run();
}

Video Tutorial :

Link to be paste inside Arduino IDE ( File–> Preference—> Additional Board Manager URL ) —> http://arduino.esp8266.com/versions/2.4.1/package_esp8266com_index.json

For More Projects visit: https://www.electronicslovers.com/category/arduino

Related posts

Arduino Opta PLC Pros & Cons

Breakthrough of Ardino-Pro Opta: Micro-PLC with industrial IoT proficiency

Top Arduino sensors – the ultimate list 2021

5 comments

francisco October 21, 2018 - 2:21 am

hola junto con saludarte podrias compartir el proyecto en formato pdf en español me interesa mucho

Pierric DOUBLET April 8, 2019 - 6:50 pm

Ca marche pas:
exit status 1
ESP8266WiFi.h : No such file or directory ?????

MOHITP April 18, 2019 - 5:12 pm

How to add COM for NodeMCU ?

Naim Shaikh July 10, 2019 - 8:59 pm

Hi Abid, Assalamu alaikum.
You have used D0 pin to drive the electrical appliance. Actually D0 becomes High at boot which means appliance will get ON at boot. Please explain.

LEVENT February 22, 2020 - 2:33 pm

well worked..thanks

Add Comment