Skip to main content

Home Automation using NodeMCU ESP8266



Automation is the process of automatically performing everyday functions around the home to save you time, energy, money and at the same time offering improved security.

 The automation is performed by a central controller. This can be either a standalone unit or a piece of software on a PC. Both options have their advantages. The controller can carry out several functions.

This post is about a simple Mini Home Automation project which can be done easily in 10 mins.  

Our  main objective is to focus over IOT (Internet of Things ) as it the most reliable as well as simpler source to connect two or more devices.Also on how to use basic chips such as ESP 8266 WI-FI Module , WEMOS D1 R2 and a glimpse of connections (pin - pin) and learning more about relay board and its working.

So lets get started. 

Step 1 : Circuit Components 
1. Esp8266 WIFI (Nodemcu) / WEMOS D1 R2
2. 5v supply
3. Charger and Charger Wire
4. Jumper wires
5. Smart phone with BLYNK app installed and google assistant
6. Bulb with socket and plug connections

Bored to read ? Watch the 10 mins video Instead.





Step 2 : Configuring the Blynk App 

➤Install the blynk app from the playstore and run it .
➤Click on new project 
➤Select the board as nodemcu
➤Click on the blank area then select button open it and name it as relay
➤Select the pin as digital pin
➤Similarly create 3 more buttons and the name them as relay 2,3,4 and pins as Digital pin 4,5,6.


Step 3 : Programming using Arduino
➤Connect the chip to the computer
➤Go to Tools and Select the board as NODEMCU 12E Mode
➤Select the port as Comm3 Go to Files Go to Examples  ➤ Go to blynk ➤Boards WIFI ESP8266 standalone ➤ Change 3 sets of codes –

  • Wifi Name
  •  Auth token ( Obtained from mail sent by Blynk)
  • Wifi Password
Then Click on upload.


Step 4: Configuring IFTTT
Go to ifttt.comLoginClick on New Applet Select “THIS” option
Choose the service as Google Assistant
Click on connect
➤ Select “SAY A SIMPLE PHRASE”
Type in the command that you would want to give to the google assistant (You can also give alternate options )
➤ Click on create Trigger 
Press on “THAT” Choose Webhooks (It will be used to connect to our board) Select make a Web request Enter URL http://188.166.206.43./yourauthtokenreceivedinthemail/UPDATE/D0

Step 4: Connections
 
ESP 8266
Relay Board
D3
IN1
D4
IN2
D5
IN3
D6
IN4
3.3V
VCC
GND and VCC
5V power supply (Battery / Charger)
 Node MCU Connections Diagram

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[] = "682bc686c19e4d048b813a91e5f40a11";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "enter ssid";
char pass[] = "123456789";

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

  Blynk.begin(auth, ssid, pass);
}

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


If you have any doubts please feel free to comment down below.😁
 

Comments

  1. Hey Friend, loved the steps, but my one channel relay has only one vcc , what could i do?

    ReplyDelete

Post a Comment

About Me


Hi!

I'm a mechanical engineering student .I believe in gaining and sharing knowledge .Let's just say " I'll never stop learning and having curiosity". Plus it’s always fun to do engineering projects.