Hello and welcome back. In this tutorial, we will learn how to make a home automation system using the Nodemcu ESP8266 board and the new Blynk application. I used a two-channel relay module for that. You can use any other relay module. Like 4-way, 8-way, or 16-way. It depends on your job. Also, the appliances in your home can be connected to these relays. These include lamps, fans, televisions, water pumps, etc. After that, we can easily control these appliances using our smartphones. For that, this article will guide you. Also, I used two lamps for example. You can use any other appliances. But, you have to be careful about the AC voltage.
Ok, let’s do this project step by step. The required components are given below.
- Nodemcu board x 1 — Amazon / Our Store
- Relay module x 1 — Amazon / Our Store
- Bulb holder x 2
- Bulb x 2
- Plug top x 1
- Breadboard x 1 — Amazon / Our Store
- Jumper wires — Amazon / Our Store
Firstly, identify these components.
Secondly, connect the Nodemcu board to the breadboard.
Thirdly, connect the bulb holders to the relay module. For that, use the circuit diagram below.
Next, connect the plug top to the 230VAC input point.
OK, now connect the relay module to the Nodemcu board using the jumper wires. For that, use the circuit diagram above. Next, connect it to the computer.
Now, let’s set up the Blynk web application step by step. For that, follow the instructions below.
- First, go to the Blynk official website using your browser. Then login to this site using your email and password. (If you don’t have a Blynk account, you must make a new account. For that, use this link. It will guide you)
- Next, click the template button and create a new template . For that, name it as you like. Also, select the hardware as ESP8266 and the connection as WIFI.
- Then, click the “Datastreams” tab and create two Datastreams as VitualPin. Also, set the first pin and the second pin to V0 and V1. Then, select the data type as an integer.
- Now, click on the Web Dashboard tab. Then, drag and drop two buttons to the dashboard. Next, click the setting icon in the button and select the datastream we created earlier. That is, V0 for button one and V1 for button two. Finally click the save button.
- Next, click the Search Icon button. After, click the New Devices button and after click the “From template” button. Finally, select the template we created earlier.
OK, the Blynk web application is ready for us.
OK, now let’s create the program for this project. It’s as follows.
/*New Blynk app with Home Automation
- Now, copy and paste the Blynk auth token. To do this, check the “Device Info” tab of your Blynk web application.
- Next, enter your correct WIFI name and password.
- Now, select the board and port. Then, upload this program to the Nodemcu board. (If you haven’t yet installed the ESP8266 boards, please use this link and follow the instructions)
OK, now let’s set up the Blynk mobile dashboard. For that, follow the instructions below.
- First, download and install the Blynk app on your phone. Then, run this application. Now, you can see the template we created ealiar. Next, click this template and set up your dashboard.
- Now, click the upper right corner button and include the two buttons to the dashboard. Then, arrange these widgets as you like.
- Next, click the buttons one by one and select the detastreams V0 and V1 respectively. Also, select the mode as switch.
OK, the Blynk app is ready.
Now, connect the 5 VDC external power supply to the Nodemcu board. For that, use the circuit diagram above.
Finally, put the bulbs to the holders and connect the plug top to the AC voltage. (If you have no knowledge of this AC voltage, please seek the assistance of an adult)
OK, now you can operate these relays using the web or mobile dashboard. The full video guide is below. So, see you in the next project.