In this IoT project, I have shown how to make an ESP01 Project using Blynk IFTTT to control a 2-channel relay module with the Google Assistant, and manual switch.

During the article, I have shown all the steps to make this Blynk home automation system.

Tutorial Video on new Blynk ESP8266 ESP01 Project

This Blynk ESP8266 control smart relay has the following features:

So, you can easily make this home automation project at home just by using an ESP01 and relay module. Or you can also use a custom-designed PCB for this project.

Required Components for the PCB

Circuit Diagram of the ESP01 Home Automation Project

This is the complete circuit diagram for this home automation project. I have explained the circuit in the tutorial video.

The circuit is very simple, I have used GPIO-0 and GPIO-2 to control the 2 relays.

And the GPIO pins GPIO-3 and GPIO-1are connected with push buttons to control the 2 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.

After programming the ESP01 disconnect the GPIO-0 from the GND pin.

Setup Blynk Cloud FREE Account

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

Click on the following link to create a Blynk Cloud account.

https://blynk.cloud/dashboard/register

Then, you have to create a template in the Blynk cloud.

Steps to Create New Template for ESP8266

You will get the BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME after creating the temple.

The BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME will be required while programming the ESP01 ESP8266.

Create a Datastream in Blynk Cloud

After that, you have to create Datastreams. Here I will control 2 relays, so I have to create 2 Datastreams.

In a similar way, create the next datastreams with virtual pin V2.

Set Up Blynk Cloud Web Dashboard

Now go to the web dashboard tab.

Drag and drop 2 Switch widgets.

Go to the settings of each widget, and select a Datastream.

Install Blynk IoT App to Configure Mobile Dashboard

Add Widgets in Blynk IoT App

Design the PCB for This Smart Home System

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.

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

Download the PCB Gerber File

Order the PCB

After downloading the Garber file you can easily order the PCB from JLCPCB.

1. Visit https://jlcpcb.com 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 color, 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

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 ESP01 board with the PCB.

Program the ESP-01 With Arduino IDE

If you use the PCB, then you can easily go to program mode with a switch (PMOD) and directly connect the FTDI232 USB to serial interface board with ESP-01.

Otherwise, you refer to this circuit to program the ESP-01. During programming, the GPIO-0 and GND should be connected.

Code for This ESP-01 Home Automation Project

First, download the code from the following link.

Download the Source Code

You have to keep all the 10 files in the same folder.

After uploading the code, turn off the PMOD switch on the PCB and press the reset button.

Update the WiFi Credentials Through OTA

After programming the ESP01, you have to update the WiFi credentials from the Blynk IoT app.

In the tutorial video, I have explained all the steps to update the WiFi credentials to ESP-01 through OTA.

Testing the PCB

After the ESP-01 connects with the Blynk server, control the relay from the Blynk IoT app to test the PCB.

Now we will connect the Google Assistant with Blynk using IFTTT.

Create FREE Account in IFTTT

Create an IFTTT account, then log in.

https://ifttt.com/

In the FREE plan, you can create 5 Applets. To control each relay you need 2 Applets, so to control 2 relays you need 4 Applets.

For each applet, you have to define a trigger and related action. In this project, if you say any pre-define commands in Google assistant, then the related Webhook request will be sent to the Blynk Cloud server.

Create Google Assistant Trigger for Applet in IFTTT

Steps to add Google Assistant Trigger in Applet

Create Webhooks Action for Applet in IFTTT

Here in the action, we will add Webhooks to send web requests to update the Datastream value in the Blynk server.

Please refer to the following Blynk API URL syntax to update the Datastream value.

Syntax: https://{server_address}/external/api/update?token={token}&{pin}={value}

The server region could be found in the right bottom corner of the web interface.

You can get the Auth Token from the Device Info tab. (Refer to tutorial video on top)

Now, enter the related Blynk URL to update the Datastream value. The method will be "GET". Keep other details as it is. (Refer to the picture)

Our first Applet is created. In a similar way, you have to create the next 3 Applets. Please refer to the tutorial video.

Control Relays Using Blynk IoT App

If the ESP01 is connected with WiFi, then you can control the home appliances from Blynk IoT App.

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

Control Relays With Google Assistant

You can also control the relay from Google Assistant with pre-defined voice commands.

Control Relays Manually With Buttons

You can also control the relays from the pushbuttons.

If the ESP01 is connected with Wi-Fi then you can monitor the real-time feedback in the Blynk IoT App.

I hope you have liked this new Blynk home automation project. I have shared all the required information for this project.

I will really appreciate it if you share your valuable feedbacks. Also if you have any query please write in the comment section. Thank you & Happy Learning.