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.

In the tutorial video, I have explained all the following steps in details.

Required Components:

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

Required Components for the PCB:

1. Relays 5v (SPDT) (8 no)

2. BC547 Transistors (8 no)

3. PC817 Optocuplors (8 no)

4. 510-ohm 0.25-watt Resistor (8 no) (R1 - R8)

5. 1k 0.25-watt Resistors (10 no) (R9 - R18)

6. LED 5-mm (10 no)

7. 1N4007 Diodes (8 no) (D1 - D8)

8. Push Buttons (8 no)

9. Terminal Connectors

10. 5V DC supply

Required Software:

1. Arduino IDE

2. Blynk App

Circuit Diagram of the ESP8266 Blynk Project:

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:

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:

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 log in to the 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:

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:

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:

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:


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:

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:

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:

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:

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

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

Select Shipping Address and Payment Mode:

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 the JLCPCB order page.

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:

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:

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 Appliances With Blynk App:

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

But you can connect multiple NodeMCU as per your requirement.

Finally!! the Smart Home system is ready

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

I hope you have liked this Alexa 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.