YK electrical
Published

Home Automation

We will see how to control an electric remotely. We will learn how to accomplish this target as this will be controlled over Internet.

IntermediateFull instructions provided2 hours154
Home Automation

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Grove - 2-Channel SPDT Relay
Seeed Studio Grove - 2-Channel SPDT Relay
×3
Resistor 10k ohm
Resistor 10k ohm
×3
Resistor 1k ohm
Resistor 1k ohm
×3
General Purpose Transistor PNP
General Purpose Transistor PNP
×3
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×3
Terminal Block Interface, Terminal Block
Terminal Block Interface, Terminal Block
×3
Linear Regulator (7805)
Linear Regulator (7805)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

CIRCUIT DIAGRAM

Code

cODE

Arduino
Now in programming, first we need to include the libraries 
#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[ ] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.

char ssid[ ] = "YourNetworkName";
char pass[ ] = "YourPassword";

WidgetLED led1(V1);
BlynkTimer timer;

// V1 LED Widget is blinking
void blinkLedWidget()  // function for switching off and on LED
{
  if (led1.getValue()) {
    led1.off();
    Serial.println("LED on V1: off");
  } else {
    led1.on();
    Serial.println("LED on V1: on");
  }
}

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, blinkLedWidget);
}

//In the loop function include Blynk.run() command.
void loop()
{
  Blynk.run();
  timer.run();
}

Credits

YK electrical
6 projects • 1 follower

Comments