IoT Home Automation - Node MCU

by ranja07 in Circuits > Wireless

820 Views, 4 Favorites, 0 Comments

IoT Home Automation - Node MCU

00.jpg
0.jpg

Hello Viewers, In this Instructable, we will learn how to create our own IoT- Home automation project and implement using the NODE MCU Wi-Fi module with a relay module and the Blynk app. We can able to control worldwide through the Blynk App.

Supplies

1. ESP8266 Node MCU

2. 5V 4Channel Relay

3. Jumpers

4. Switch Box

5. Four Switches and Plug Adapters

6. Feedback Circuit (Resistors 10kΩ)

7. 3Pin Plug

8. The required amount of wire

9. Mini Bread Board

10. Micro USB Male to Micro USB Female

11. Windows PC or MAC

12. Android or IOS phone

Node MCU & Blynk App

1.jpg
2.png

Node MCU- This is open-source firmware and development kit that helps you to prototype your IoT product. Node MCU always refers to the firmware rather than the associated development kits. Both the firmware and prototyping board designs are open source. Low cost.

Blynk App- One app to prototype, deploy, and remotely manage connected electronic devices at any scale. Available in both iOS and Android to control Arduino, ESP8266, ESP32, Node MCU, and other microcomputers with smartphones over the Internet.

Install Blynk App

3.jpeg
4.jpeg

Install Blynk App on your iPhone or Android device through these link

iOS: https://apps.apple.com/in/app/blynk-0-1-legacy/id808760481

Android: https://play.google.com/store/apps/details?id=cc.blynk

Create a IoT Project With Blynk Account

5.jpeg
6.jpeg
7.jpeg
8.jpeg
9.jpeg
10.jpeg
11.jpeg
12.jpeg
13.jpeg
14.jpeg
15.jpeg

Installation of the app is Completed So that we can move on to Creating our IoT project.

If you have already possessed a Blynk account then, follow these steps:

1. Login using Mail Id / Facebook

2. Click New Project

3. Enter the project name and choose the device as ESP8266

4. Auth token can be received through your registered Mail Id Copy that or go to Project Settings >> Auth Tokens >> Copy all

If you are a Beginner then, follow these steps:

1. Open Blynk app à Click Create New Account

2. Enter Mail Id and Set Password for Sign Up

3. Click New Project

4. Enter the project name and choose the device as ESP8266 then, click Create

5. Auth token can be received through your registered Mail Id Copy that or go to from Project Settings >> Auth Tokens >> Copy all


Design UI for Control in Blynk App

1. Open the “Widget Box” (‘+’)

2. Add Four Buttons

3. For all four Buttons, Name it and Select “Switch” Mode

4. Define the Output PIN as “Virtual V1”, “Virtual V2”, “Virtual V3”, “Virtual V4”, for “Switch 1”, “Switch 2”, “Switch 3”, “Switch 4”, respectively. If you want to change the output pin, then you want to change the Arduino code also

Installing the Board in Arduino IDE and the Blynk Library

23.PNG
24.PNG
22.PNG

Include ESP8266 Core to Arduino IDE

1. Go to “File” >>“Preferences” and enter the following URL to “Additional Board Manager URLs”

http://arduino.esp8266.com/stable/package_esp8266c...

2. Open the “Tools” >> “Board” >> “Boards Manager”.

3. Search for “esp8266” and Install the latest version.

4. After installation makes sure that “INSTALLED” appears.

5. Select your board under “Tools" >> “Board” >> “ESP8266 Boards (2.7.4)” >> “NodeMCU 0.9 (ESP-12 Module)”

Install Blynk Libraries

1. Install the latest release of the Blynk libraries on GitHub.

2. Unzip the file.

3. Move the libraries to C:/User//Documents/Arduino/libraries.

Uploading the Code to the Node MCU

19.png
20.png

Change the SSID and password with your SSID and password.

Paste the Auth token which you copied from your Mail/Project Settings.

Connect Node MCU to PC/Laptop.

Compile and upload the code. Check for Done Compiling notification.

Open the Serial Monitor and check whether the connection was successful.

Downloads

Make Connection Using Circuit Diagram

21circuit diagram.png
Wiring Connection IoT Home automation 1
Wiring Connection IoT Home automation 2
22.jpg
23.jpg
24.jpg
25.jpg
26.jpeg
27.jpeg

RELAY Module to Node MCU

GND-------------GND

IN1---------------D0

IN2---------------D1

IN3---------------D2

IN4---------------D6

VCC--------------Vin

SWITCH to Node MCU

1st Switch Upper screw terminal---------------------D4

2nd Switch Upper screw terminal--------------------D5

3rd Switch Upper screw terminal---------------------D7

4th Switch Upper screw terminal---------------------TX

All 4 switches Lower screw terminal-----------------3V3

FEEDBACK Circuit to Node MCU & Switch

1st Resistor one terminal--------------------------1st Switch Upper screw terminal

2nd Resistor one terminal-------------------------2nd Switch Upper screw terminal

3rd Resistor one terminal--------------------------3rd Switch Upper screw terminal

4th Resistor one terminal--------------------------4th Switch Upper screw terminal

All 4 Resistor’s another terminal-----------------GND

Our New IoT Home Automation

IoT Home automation - Node MCU

***NOTE: Before checking and powering Node MCU, we want to “ON” all the switches in the switchboard to make the Relay connection a Closed one. It is required only at the Initialization stage.***

Now let us check if our IoT project works

So, you guys can see the photos and video, which ensures that the Node MCU IoT project is working perfectly fine.
If you have learned something new in this tutorial, don’t forget to comment and share it.

Any Queries mean ping me in the comment section; I will get you ASAP.