K Gray
Published

Home Automation Smart Plugin with ESP8266 & Blynk

This tutorial is about making a Smart Plug with ESP8266 & Blynk for anything you want to turn on or off automatically.

BeginnerFull instructions provided30 minutes254
Home Automation Smart Plugin with ESP8266 & Blynk

Things used in this project

Hardware components

Wemos D1 Mini
Espressif Wemos D1 Mini
×1
Grove - SPDT Relay(30A)
Seeed Grove - SPDT Relay(30A)
×1
USB Wall Charger
×1
Wall Outlet Box
×1
Wall Outlet
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Hand tools and fabrication machines

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

Story

Read more

Schematics

ESP Smart Plug

Code

ESP Smart Plug Code

C/C++
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "your_auth";
char ssid[] = "your_ssid";
char pass[] = "your_pass";

#define relay 2 //GPIO2, D4

int state;

BLYNK_WRITE(V0){
  state = param.asInt();
}

void setup() {
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  pinMode(relay, OUTPUT);
}

void loop() {
  digitalWrite(relay, state);
  Blynk.run();
}

Credits

K Gray

K Gray

2 projects • 0 followers
I started IOT, Arduino, and home automation 1 year ago and am solely self taught.

Comments

Add projectSign up / Login