Project:IOT based smart home using ESP8266 with Blynk

 After successfully completing this project, you will be able to control your home appliances like TV, fan, lamp, motor, refrigerator, door lock, etc. With the help of your smartphone from anywhere in the world. Esp8266 wifi module plays a vital role in IoT based home automation project.

 
the project planner


Project 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();
}



 

Post a Comment

Previous Post Next Post