Designing Smart Chatbot with IoT for home automation with videos (Hindi & English) Using Arduino

Workflow of Chatbot

kunal verma 4

In this project, we will be using ESP8266 12e manufactured by Lolin to make a Chatbot that can control our home applications. To chat with our chatbot, we will use Facebook messenger platform. Also, we will integrate some AI into our chatbot using Chatfuel. It will then be integrated with IFTTT and Adafruit IO. Adafruit IO is linked to our ESP8266 at the hardware side. In a gist, the output pins of ESP8266 will be controlled through our Facebook Messenger Chatbot.

The project is amazing for those who want to integrate some AI into their IoT.

Workflow of Chatbot

Complete Workflow of Chatbot with IoT

The Fig. 1 will give you some idea of the process we are up to in this project. The IoT and the Chatbot segments are developed separately. Then, we will merge these two to make our final Chatbot.

Material to get started:

  • ESP8266 12e NodeMCU manufactured by Lolin (Check the datasheet, if you are using a different version.)

ESP8266 12e by Lolin

ESP8266 12e by Lolin

  • USB Type C cable to program ESP8266 12e from a laptop or PC. Most Android phones use this type of cable.

USB Type C Cable 1

USB Type C Cable

  • Relay Module – Relay is an electro-mechanical switching device. In a relay, we can control switching AC or DC appliances digitally by providing input to relay input pins. Here we have used a 1-channel relay operating on 5 Volts.

Channel Relay Module

Channel Relay Module

To connect your AC appliance, use the following connection with the Relay Module use the following connection. The Signal pin is IN.

Channel Relay Module

Relay Connection

With some wires and breadboard.

Back End Set-up:

  1. Set-up with Facebook Messenger:

We need a Virtual human to chat with. For this, we will create a Facebook Page.

Facebook Page

Create a Facebook Page

To create a Facebook Page, click here and Get Started with Community or Public Figure. Fill your Page name and Category.

page details

Fill the page details

If you wish, you can even add a Profile Picture and Cover Page to it. You must also hide your Page name and do settings so that your page is not available publicly.

2. Set-up with Chatfuel Platform:

Go to Chatfuel Platform from here. Sign Up with the same Facebook profile you created the Page and go to the Dashboard and select “Create from Template” and then “Blank Bot”.


Create a Chatbot

Now the Blank bot is created in the Dashboard and you need to connect it with the Facebook Page. So, click “Connect”.

Connect Bot

Connect Bot

Now Select the Facebook Page you want to connect with. Now you can start with the AI part of the Chatbot.

Go to Automate and edit the Welcome Message by changing the User’s First name.

Welcome Message

Welcome Message

Now Click the Default Answer and edit it in the same way. The default answer is replied for the commands not programmed in your Chatbot or for any unexpected error.

Default Answer

Default Answer

Now, we start adding Blocks. Blocks are the functions that will be executed on chat commands. Click on the + symbol to add these blocks. These functional blocks will hit the APIs of IFTTT server.

Add Block

Add Block

Create two blocks and rename them as Relay On and Relay Off. 

Select Relay On block and add a Text card to it. This text card is a reply that our Chatbot gives on performing this certain block.

 Text Card

 Add a Text Card

You can edit this Text Card in your preferred answer. Do the similar settings for the Relay Off with Light Off message.

Text Card for Relay On

Edit this Text Card for Relay On

Now, click on Set Up AI (1) and select + ADD AI RULE (2) and fill the AI. This is the main set up of its AI.

Set Up AI

Set Up AI

Add its AI rules by written all permissible phrases a user can say (1) and reply with Blocks (2) and add the corresponding block (3). To add each phrase simply type the phrase and Enter.

 AI with the Rules

Set Up its AI with the Rules

We will leave it here. Further settings will be done after setup with IFTTT.

3. Set-up with Adafruit IO:

Adafruit IO serve is the IoT end. Here our ESP8266 gets connected with its server and executes our desired command. Go to Adafruit IO. Sign Up or Sign In to your Adafruit IO account.

Adafruit IO account Set Up

 Adafruit IO account Set Up

After creating Adafruit, you should be taken to Adafruit Home Screen.

Now Select Feeds from hand menu and Click Action > Create a New Feed from the drop-down menu.

new Feed

Create a new Feed

Give this any name you wish, I created “onoff”. Now, Go to Dashboards > Actions > Create a New Dashboard. Similarly name this one also, I named it “LightAutomation”.



And click on + “Blue +” on the Top right side of your Dashboard to create a new block.

Select “Toggle” Block.

 new block

Create a new block

Now, choose your feed and click “Next Step”.

Choose Feed

Choose Feed

Fill the block settings and “Create the Block”.

Block Settings

Block Settings

Now let’s merge everything with IFTTT.

  1. Set up with IFTTT:

Create an account on IFTTT ( by Signing Up with your same Google Account you are using in your phone.

Now go to My Applets > New Applet > Click “ + this “. Search for the service Webhooks and select it.

Service Webhooks

 Choose a Service – Webhooks

Select Request a Web Service and Fill the event name and Create Trigger.


Create a Trigger

After creating Trigger, we must fill the Action Service. For that click on + that.


Read more: Designing Smart Chatbot with IoT for home automation with videos (Hindi & English)

Leave a Comment

Your email address will not be published. Required fields are marked *