In this IoT project, I have shown how to make IoT-based Smart Home Automation using MultipleESP32 NodeMCU ESP8266 networks to control all the home appliances from the switches & Blynk IoT 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 complete Home Automation system has the following features:

  • Connect multiple ESP32 and NodeMCUs with the same Blynk account (FREE plan).
  • Control home appliances with WiFi(Blynk App).
  • Control home appliances with manual switches.
  • Monitor real-time feedback in the Blynk App.
  • Control home appliances manually without internet.
  • You can connect any number of microcontrollers in this IoT network as per the requirements.

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

So if you follow all the steps, you can easily make this IoT project just by using ESP32 or NodeMCU and relay module. Or you can also use a custom-designed PCB for this project.

Although the PCB is not mandatory, I have used PCB to make the circuit compact and give the project a professional look.

Required components for the ESP32 control 4 Relays PCB

  • ESP32 DEVKIT V1
  • Relays 5v (SPDT) (4 no)
  • BC547 Transistors (4 no)
  • PC817 Optocuplors (4 no)
  • 510-ohm 0.25-watt Resistor (4 no) (R1 - R4)
  • 1k 0.25-watt Resistors (6 no) (R5 - R10)
  • 10k 0.25-watt Resistor (1 no) (R11)
  • LED 5-mm (6 no)1N4007 Diodes (4 no) (D1 - D4)
  • Push Buttons (4 no)
  • Terminal Connectors
  • Jumpper (2 no)

Required components for the NodeMCU control 4 Relays PCB

  • NodeMCU ESP8266
  • Relays 5v (SPDT) (4 no)
  • BC547 Transistors (4 no)
  • PC817 Optocuplors (4 no)
  • 510-ohm 0.25-watt Resistor (4 no) (R1 - R4)
  • 1k 0.25-watt Resistors (5 no) (R5 - R9)
  • LED 5-mm (5 no)
  • 1N4007 Diodes (5 no) (D1 - D5)
  • Push Buttons (4 no)
  • Terminal Connectors
  • Jumpper (2 no)

Multiple ESP32 NodeMCU ESP8266 Network

Now if you have multiple rooms, then you can use either ESP32 or NodeMCU for each room and then repeat the same circuit for each room.

If you use ESP32 then you can use either a 4-channel or 8-channel relay module, but for the NodeMCU you have to use the 4-channel relay module.

There is no limitation on the number of ESP32 or NodeMCUs that can be connected. All microcontrollers will connect to the Blynk server using the same Authenticate Token.

So we can control each NodeMCU or ESP32 independently from the Blynk IoT App.

Circuit Diagram of the ESP32 Control Relays

The circuit is very simple, I have used the GPIO pins D23, D22, D21 D19 to control the 4 relays.

And the GPIO pins D13, D12, D14 & D27 are 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.

If you use the momentary pushbutton then just connect the pushbutton across the GPIO pins and GND instead of switches.

Please take proper safety precautions while working with high voltage.

Circuit Diagram of the NodeMCU Control Relays

For the NodeMCU, I have used the GPIO pins D1, D2, D5 & D6 to control the 4 relays. And the GPIO pins SD3, D3, D7 & RX are connected with push buttons 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.

The D3 pin should not be connected with GND during the booting process of NodeMCU.

If you use latched switch then just connect the switches across the GPIO pins and GND instead of pushbuttons.

Create New Template for ESP32 in Blynk Cloud

For this smart house project, I have used the Blynk IoT Cloud Free plan. Click on the following...

Read more »