Javatpoint Logo
Javatpoint Logo

IoT project of controlling home light using WiFi Node MCU, and Relay module

In this project, we are going to build a home light controlling system using the Wi-Fi network or Internet (Mobile data). Using this project we are able to control our home light from anywhere in the world. In this project, we will use Wi-Fi Node MCU, 4 Channel Relay module, etc.

Hardware Requirements

  1. Wi-Fi Node MCU ESP8266
  2. Standard USB cable to connect Node MCU
  3. 4 Channel Relay module (5V)
  4. Jumper wires female to female
  5. Home Light (Bulb)
  6. Bulb holder
  7. Wire
  8. AC 220v/120v home appliances or 9v Hi-Walt Battery

Software requirements

  1. Arduino software
  2. Blynk app

Working principle of this project (Node MCU, Relay Module)

In this project, there are three main components used an Android Blynk app, Wi-Fi Node MCU and 4 Channel Relay module.

IoT project of controlling home light using WiFi Node MCU, and Relay module

The Android Blynk app sends the serial data to the Wi-Fi Node MCU by clicking ON button. The Wi-Fi Node read the input data and process it according to program uploaded inside it and generate the output to 4 Chanel Relay Module.

When the Blynk app's button turns on, it turns ON the home light, and when the Blynk app's buttons turns OFF, it turns OFF the home light.

Download the Blynk application from play store and install it on your device.

IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module
IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module
IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module
IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module
IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module
IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module
IoT project of controlling home light using WiFi Node MCU, and Relay module

A program written on Arduino IDE to control the home light using WiFi Node MCU, 4 Chanel Relay Module:

Add the board type to your Arduino IDE

Add the board type to your Arduino IDE if not added earlier before compiling. Go to File > Preferences > Settings and add http://arduino.esp8266.com/stable/package_esp8266com_index.json in Additional Boards Manager URLs and click OK.

IoT project of controlling home light using WiFi Node MCU, and Relay module

Include the esp8266 board community before compiling the above code otherwise, it generates an error.

To include library click Tools > Board > Board Manage...

IoT project of controlling home light using WiFi Node MCU, and Relay module

Search for esp8266 and install it.

IoT project of controlling home light using WiFi Node MCU, and Relay module

Select your board type

Now, select your board type, go to Tools > Board: > NodeMCU 1.0.

IoT project of controlling home light using WiFi Node MCU, and Relay module

Add Libraries

Download the latest Blynk library from https://github.com/blynkkk/blynk-library/releases/latest and add it to program

IoT project of controlling home light using WiFi Node MCU, and Relay module

If the Blynk libraries are not able to be added in your program then, extract it and paste all the directories in Arduino libraries C:\Program Files (x86)\Arduino\libraries.

Now, connect Node MCU device with your personal computer using Standard USB cable to connect Node MCU and upload the program in it.

IoT project of controlling home light using WiFi Node MCU, and Relay module

Digital circuit diagram

4 Channel Relay Module              Node MCU

GND   -------------------------------->      GND

IN1   -------------------------------->     D0

IN2   -------------------------------->     D1

IN3   -------------------------------->     D2

IN4   -------------------------------->     D3

VCC   -------------------------------->     Vin

Connection between Relay Module, Bulb, and input power:

  1. Connect common-point (com) of Relay Module with home light.
  2. Connect normally-open (no) of Relay Module with power.
  3. Connect remaining one home light wire with the power source.

This project has operated using both Wi-Fi as well as Mobile data.

Output:

IoT project of controlling home light using WiFi Node MCU, and Relay module IoT project of controlling home light using WiFi Node MCU, and Relay module




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA