Home Automation using NodeMCU and Blynk- on Breadboard

In our last tutorial, we learned the basics of relay and its control via a webpage using NodeMCU. There we used basic web server principles, where NodeMCU acted as a web server, and the web page hosted there helped us communicate with the ports to switch relay, thereby switching devices on/off. But there, you need to do a lot of coding and be on the same network to access the local server page, which means it’s time-consuming and you can’t control devices from anywhere. There comes a handy utility to rescue called Blynk, which opens the doors to the IoT world and supports a plethora of devices and platforms. Using it, without much coding and via a simple interface, we are able to do home automation using NodeMCU.

So, let us move one step ahead and utilize Blynk’s capabilities. Believe me, achieving things with Blynk is super easy as opposed to the earlier method. Blynk app is free to use with 1800 free recyclable energy with each account, which is more than sufficient for general projects or there is unlimited energy if the local server is used. Energy is used by each widget you add to the project. You can always purchase more energy for bigger projects or recycle used ones.

BLYNK + NODEMCU ESP8266 + RELAY BOARD = DIY HOME AUTOMATION

Things Required

  • NodeMCU board
  • Micro USB cable + power supply (any mobile charger or laptop USB port will work)
  • Arduino IDE with ESP8266 board definitions & drivers installed
  • Blynk software installed on your smartphone
  • Relay Module (up to 9 relays can be operated using one NodeMCU, I am using 4 channel relay module)
  • AC/DC bulb, fan, etc, to control using the relay (optional)
  • Breadboard *
  • Jumper cables, Male to Female M-F, Female to Female F-F *

* You can connect NodeMCU to Relay board via breadboard using M-F jumper cables or you may skip breadboard and directly connect relay & NodeMCU using F-F jumper cables.

HARDWARE SETUP (with NodeMCU)

Hopefully you have already set up NodeMCU with Arduino. If not you can refer to my review for NodeMCU where I have detailed every step. Now proceeding with steps to connect relay to NodeMCU.

1. Connect GND of relay board to GND of NodeMCU.
2. Connect IN1-IN4 to GPIO’s (D0 to D8). Suppose it’s like IN1-D1, IN2-D2, IN3-D3, IN4-D5.
3. With jumper on VCC/JD-VCC, connect board’s VCC to VIN of NodeMCU (to provide direct 5V supply coming from USB port).
4. Connect AC load on relays NO circuit i.e. phase to each of relay connectors mid terminal and wire from load (e.g. light, fan etc) to left NO terminal (Be careful while dealing with AC)
5. Other ground wire of AC supply goes directly to load.
6. You can also have manual switch parallel to NO circuit for manual on/off.

Home Automation using NodeMCU and Blynk- Schematic Diagram

SOFTWARE SETUP

  1. Steps for the initial setup of the NodeMCU board with Arduino IDE can be found here.
  2. Install the Blynk app from the app store & register.
    Google Play Store | Apple App Store
  3. Create project. Auth token will automatically be sent on email or can manually email from project settings.
  4. Download the library zip from here.
  5. Install Blynk library manually by copying unzipped folders as per mentioned paths on the website for the sketchbook folder of Arduino IDE.
  6. After libraries are installed, another entry with Blynk is created in examples. (Pic attached)
  7. Open Arduino IDE & Go to → File → Examples → Blynk → Boards_WiFi → ESP8266_Standalone.
  8. Enter auth token of Blynk project, said, and password of your Wi-Fi network in the sketch.
  9. Upload sketch to board.
  10. Now in the app add 4 buttons to the project created above, by clicking on + and selecting buttons.
  11. Open each button, name them as per load (e.g. fan1, fan2, overhead light, night lamp), and specify D1, D2, D3, D5 pin with 1 → 0. (Since the relay is active low)
  12. Click on the Play button on top.
  13. Press buttons to control the load from anywhere using mobile.
  14. Enjoy the endless world of IoT and automation. Control everything wirelessly from your smartphone via the Blynk server or local server.
Home Automation using NodeMCU and Blynk

A few other things to try:

Setup Arduino for NodeMCU programming

Blink Onboard Blue Colour LED

Blink External LEDs

Interface With Relay (for controlling AC/DC devices)

0 0 votes
Article Rating
Subscribe
Notify of
90 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
9 months ago

… [Trackback]

[…] Information on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

9 months ago

… [Trackback]

[…] Find More on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

9 months ago

… [Trackback]

[…] Information on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

9 months ago

… [Trackback]

[…] Read More on on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

9 months ago

… [Trackback]

[…] Here you can find 34534 additional Info on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

9 months ago

… [Trackback]

[…] Find More to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

9 months ago

… [Trackback]

[…] Read More Information here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

8 months ago

… [Trackback]

[…] Information on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

8 months ago

… [Trackback]

[…] Read More Information here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

8 months ago

… [Trackback]

[…] Here you will find 88374 additional Info to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

8 months ago

… [Trackback]

[…] Find More Info here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

8 months ago

… [Trackback]

[…] Read More here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

8 months ago

… [Trackback]

[…] Read More Information here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

7 months ago

… [Trackback]

[…] Find More to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

7 months ago

… [Trackback]

[…] Read More Information here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

7 months ago

… [Trackback]

[…] Info to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

7 months ago

… [Trackback]

[…] Here you can find 1268 additional Info to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

7 months ago

… [Trackback]

[…] There you can find 49981 additional Information on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

… [Trackback]

[…] Find More Information here to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

relax everyday

6 months ago

… [Trackback]

[…] Here you can find 48690 more Information on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

… [Trackback]

[…] Here you will find 7812 more Information to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

… [Trackback]

[…] Find More on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

night music relax

6 months ago

relaxing music

6 months ago

soothing music

6 months ago

study music

6 months ago

japanese type beat

6 months ago

bird chirping

6 months ago

Trap \Bass Japanese Type Beat

6 months ago

yoga music

6 months ago

piano music

6 months ago

soft music

6 months ago

… [Trackback]

[…] Read More Information here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

relax music

6 months ago

… [Trackback]

[…] Read More Information here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

… [Trackback]

[…] Find More Info here on that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

music for stress relief

6 months ago

motivation song

6 months ago

calming music

6 months ago

winter

6 months ago

study music

study music

6 months ago

spa music

6 months ago

… [Trackback]

[…] Information to that Topic: abstractotech.com/home-automation-using-nodemcu-blynk-based/ […]

6 months ago

soft jazz

6 months ago

calm music

6 months ago

stress relief

6 months ago

piano music

piano music

5 months ago

relax

5 months ago

relaxing piano music

90
0
Would love your thoughts, please comment.x
()
x