Smart Home With Multiple NodeMCU ESP8266 Network With Blynk

by techstudycell in Circuits > Microcontrollers

11606 Views, 55 Favorites, 0 Comments

Smart Home With Multiple NodeMCU ESP8266 Network With Blynk

vlcsnap-2021-03-22-10h03m54s982.png
thumb _website.jpg
vlcsnap-2021-01-17-19h59m11s931.png
vlcsnap-2021-03-22-09h05m21s171.jpg
Home Automation System using multiple NodeMCU ESP8266 network with Blynk | IoT Projects 2021

In this IoT project, I have shown how to make IoT-based Smart Home Automation using Multiple NodeMCU ESP8266 network to control all the home appliances from the pushbuttons & Blynk App. If the internet is not available, then you can control the home appliances from manual switches. During the article, I have shown all the steps to make this smart home system.

This ESP8266 NodeMCU control smart relay has the following features:

  1. Connect multiple NodeMCUs with the same Blynk account.
  2. Control home appliances with WiFi (Blynk App)
  3. Control home appliances with manual switches.
  4. Monitor real-time feedback in the Blynk App.
  5. Control home appliances manually without internet.

For each room, you just need a relay module & NodeMCU to make this smart home project.

Supplies

  1. NodeMCU
  2. Relays 5v (SPDT) (4 no)
  3. BC547 Transistors (4 no)
  4. PC817 Optocuplors (4 no)
  5. 510-ohm 0.25-watt Resistor (4 no) (R1 - R4)
  6. 1k 0.25-watt Resistors (5 no) (R5 - R9)
  7. LED 5-mm (5 no)
  8. 1N4007 Diodes (5 no) (D1 - D5)
  9. Push Buttons (4 no) or Switches
  10. Terminal Connectors
  11. 5V DC supply

Circuit Diagram of the ESP8266 Blynk Project

vlcsnap-2021-01-17-20h31m08s036.jpg

The circuit is very simple, I have used the GPIO pins D1, D2, D5 & D6 to control the 4 relays.

And the GPIO pins SD3, D3, D7 & RX connected with switches to control the 4 relays manually.

I have used the INPUT_PULLUP function in Arduino IDE instead of using the pull-up resistors.

I have used a 5V mobile charger to supply the smart relay module.

Multiple NodeMCU ESP8266 Network

vlcsnapccccc.jpg

Now if you have multiple rooms, then you have to repeat the same circuit for each room.

There is no limitation on the number of NodeMCUs that can be connected.

All NodeMCU will connect to the Blynk server using the same Authenticate Token. So we can control each NodeMCU independently from Blynk App.

Control Relays With Internet Using Blynk

vlcsnap-2021-03-22-10h07m53s749.png
vlcsnap-2021-03-22-10h08m19s762.png
vlcsnap-2021-03-22-10h05m35s524.png

If the NodeMCUs are connected with the WiFi, then you can control the home appliances from Blynk App.

You also use multiple smartphones to control the appliances with Blynk App. For that, you have to login same Blynk account from all the smartphones. In this way, all smartphones will be sink to the Blynk server.

You can control, monitor the real-time status of the relays from anywhere in the world with the Blynk App.

Control Relays Using Push-buttons

vlcsnap-2021-03-22-09h04m22s262.png
vlcsnap-2021-03-22-09h05m05s620.png
vlcsnap-2021-03-22-10h07m34s516.png

If the WiFi is not available, you can control the relays from the pushbuttons.

The NodeMCU will check for the WiFi after every 3 seconds. When the WiFi is available, the NodeMCU will automatically connect with the WiFi.

Configure the Blynk App for the Multiple NodeMCUs

Multiple NodeMCU_22MAR2021 PIC 1.jpg

1. Install the Blynk App from the Google play store or App store. Then create an account.

2. Sign In and Tap on the New Project.

3. Give the name to the project, select NodeMCU, Connection type will be WiFi. Then tap on Create.

3. Blynk will send an authentication token to the registered email id. Tap on OK.

Add the Button Widgets in Blynk App to Control Relays

Multiple NodeMCU_22MAR2021 PIC 2.jpg

Then add 8 button widgets from the Widget Box to control the 8 relays.

Create buttons with V1, V2, V3, V4, V5, V6, V7, V8 pins to control the relays.

Select the Mode as Switch for all the buttons.

**Here I have used an active low Relay module, so to turn ON the relay we have to send “0” and “1” to turn OFF the relay.

I have used virtual pins V1, V2, V3, V4 to control the first relay module (Room-1)

And V5, V6, V7, V8 to control the second relay module (Room-2)

I have explained all the details in the tutorial video.

Code for Blynk ESP8266 Home Automation

vlcsnap-2021-03-22-10h07m04s646.png
vlcsnap-2021-03-22-10h12m25s972.png
vlcsnap-2021-03-22-10h04m32s388.png

In the Tutorial video, I have explained all the steps to program the NodeMCU ESP8266 using Arduino IDE.

Before uploading the code you have to install the ESP8266 board and Blynk library.

Then enter the WiFi name, WiFi password & Blynk Auth Token in the code.

Enter the following WiFi credential and Authentication token in the code:

  • WiFi Name at “WiFi Name”
  • WiFi Password at “WiFi Password”
  • Auth Token sent by Blynk at “AUTH TOKEN“

Select the “NodeMCU 1.0 ESP-12E” board and proper PORT. Then click on the upload button.

For each NodeMCU, you have to change the virtual pins in the code.

For the first NodeMCU, virtual pins will be V1, V2, V3, V4.

And for the second NodeMCU, virtual pins will be V5, V6, V7, V8.

Designing the PCB

vlcsnap-2021-01-17-19h58m26s121.png
vlcsnap-2021-01-17-19h58m40s950.png
vlcsnap-2021-01-17-19h58m50s543.png

To make the circuit compact and give a professional look, I have designed the PCB after testing all the features of the smart relay module on the breadboard.

You can download the PCB Gerber file of this home automation project from the following link:

https://drive.google.com/uc?export=download&id=1Jx4D_DSV_ei1y0a82AbtxbsNhy8sjCmY

Order the PCB

JLC PCB_Pic 1.jpg
JLC PCB_Pic 2.jpg

After downloading the Garber file you can easily order the PCB

1. Visit https://jlcpcb.com/RHS and Sign in / Sign up

2. Click on the QUOTE NOW button.

3 Click on the "Add your Gerber file" button. Then browse and select the Gerber file you have downloaded.

Uploading the Gerber File and Set the Parameters

jlc pcb pic 2.2.png
JLC PCB_Pic 3.jpg

4. Set the required parameter like Quantity, PCB masking color, etc

5. After selecting all the Parameters for PCB click on SAVE TO CART button.

Select Shipping Address and Payment Mode

FPR02XCKL1ddCQAUS.jpg
F637WIQKL1ddCQAUR.jpg
IMG20210109165955_01.jpg

6. Type the Shipping Address.

7. Select the Shipping Method suitable for you.

8. Submit the order and proceed with the payment.

You can also track your order from JLCPCB.com. My PCBs took 2 days to get manufactured and arrived within a week using the DHL delivery option.

PCBs were well packed and the quality was really good at this affordable price.

Solder All the Components on PCB

vlcsnap-2021-01-17-19h59m20s552.png
vlcsnap-2021-01-17-19h59m26s786.png
vlcsnap-2021-01-17-19h59m32s188.png

After that, I have soldered all the components as per the circuit diagram.

Then connect the NodeMCU board with the PCB.

Connect the Home Appliances

cccc.jpg

Connect the 4 home appliances with the relay module as per the circuit diagram. Please take proper safety precautions while working with high voltage.

Connect 5-volt DC supply with the PCB. (I have used my old mobile charger)

Control Applicances With Blynk App

vlcsnap-2dddffff.jpg

Here I have connected 2 NodeMCUs to control appliances for 2 rooms.

But you can connect multiple NodeMCU as per your requirement.

Finally!!

vlcsnap-2021-03-22-09h18m01s828.png
vlcsnap-2021-03-22-09h05m05s620.png
vlcsnap-2021-03-22-10h05m35s524.png

Now you can control your home appliances in a smart way.

I hope you have liked this home automation project. I have shared all the required information for this project. I will really appreciate it if you share your valuable feedback.
Also if you have any query please write in the comment section. Thank you & Happy Learning.