Jump to content

Control Home appliances using Google Assistant


Recommended Posts

Components Used1 NodeMCU

whatsapp_image_2020-07-24_at_92902_pm_LO
 

NodeMCU is an open source firmware for which open source prototyping board designs are available

1 RelayLoad : 10A, AC 250V/ 15A, 125V

1 Bulb

Google assistant is AI (Artificial Intelligence) based voice command service. Using voice, we can interact with google assistant and it can search on internet, schedule events, set alarms, control appliances, etc.

This service is available on smartphones and Google Home devices.

We can control smart home devices including lights, switches, fans and thermostats using our Google Assistant.

I build an application which can control home appliances. Here, I control 60 W bulb using Google Assistant service.

This application includes Google assistant along with Adafruit server and IFTTT service.

 

Hardware Used

  • NodeMCU – 32-bit ESP8266 development board with Wi-Fi SoC.
  • Relay module
  • One 60 W Bulb

To build home automation application, I used three different platforms

  • Google Assistant
  • Adafruit
  • IFTTT

To use above services we need to configure them.

 

High Quality PCBs From NEXTPCB

 

 

 

Nextpcb is one of the best Online PCB manufacturing company from where you can order PCBs online without any hassle. The company works 24 hours a day, 7 days a week nonstop. With their high tech machinery and automated work stream, they can manufacture huge quantities of high-class PCBs within hours.

 

NEXTPCB can develop PCBs of various complexity. They develop Simple and cheap PCBs with Single layer board for hobbyists and enthusiasts as well as complex multi layer board for high standard industrial applications. Nextpcb works with large product manufacturers and may be the PCB of devices you are using such as laptop or mobile phones were made at this factory

 

 

 

Adafruit

First, created account at www.Adafruit.io

adafruit_sign_in.png?auto=compress%2Cfor
 

Now, create dashboard at Adafruit. This dashboard is a user interface to control things remotely.

adafruit_dashboard_create.png?auto=compr
 

After following above steps, provide name to the dashboard and save it. We can see our dashboard as follows,

adafruit_dashboard.png?auto=compress%2Cf
 

Now, create feed (user interface) to control light On-Off. To create it, just click on ‘+’ symbol and select toggle feed shown below,

create_feed.png?auto=compress%2Cformat&w
 

After selecting toggle feed, pop-up window appears as shown below.

create_feed_name.png?auto=compress%2Cfor
 

Enter name of our feed (shown in red box) and create it. After creation, select the created feed (here mine is light) and then click on Next step.

In the next step configure the feed which is shown below,

feed_configuration.png?auto=compress%2Cf
 

Here, I used 0(OFF) and 1(ON) text for button and then click on create. This will create toggle button on your dashboard which can be used to control things remotely.

dashboard-feed_created.png?auto=compress
 

Now, my dashboard is ready for IoT application like home automation.

IFTTT (If This Then That)

If This Then That, also known as IFTTT is a free web-based service to create chains of simple conditional statements, called applets. An applet is triggered by changes that occur within other web services such as Gmail, Facebook, Telegram, Instagram, or Pinterest.

For example, an applet may send an e-mail message if the user tweets using a hashtag or copy a photo on Facebook to a user's archive if someone tags a user in a photo.

Here, I used IFTTT to use google assistant service and Adafruit service in chain. So, when I use google assistant to control light of my home by saying Ok google, turn the light ON or OFF. Then IFTTT interpret the message and can send it to Adafruit’s dashboard as a understandable command to the created feed.

 

 

 

 

Configure IFTTT

First step is creating account on IFTTT.

IFTTT_signup.png?auto=compress%2Cformat&
 

Note: Create account on IFTTT byusing same e-mail id which you have used for Adafruit.

After account creation, click on My Applets and then select New Applet shown below,

new_applet.png?auto=compress%2Cformat&w=
 

After selecting a new applet, we get a new page in which we should click on to This as shown in below image.

this_command_applet.png?auto=compress%2C
 

Then search for Google Assistant and select it.

applet_service_search.png?auto=compress%
 

Now, enter voice phrases which we will use as a command for google assistant.

enter_phrases_to_trigger.png?auto=compre
 

We can enter any phrase as per our application. As you can see, the phrases entered in the above fields is for making Light ON. For making Light OFF, we have to create another applet with different phrases.

Now, we get another page on which we have to click on that option which is used to connect Google Assistant with Adafruit.

that_command_trigger.png?auto=compress%2
 

Then search for Adafruit and select it.

applet_service_search_adafruit.png?auto=
 

After selecting Adafruit, choose action as shown below,

adafruit_data_send.png?auto=compress%2Cf
 

Now enter what data we need to send to which feed of Adafruit dashboard.

adafruit_action_fields.png?auto=compress
 

Click on Create Action.

So, when I use Google Assistant on my mobile and give voice command as “Ok Google, Turn LED ON”, applet created in IFTTT receive this command and will send data ‘1’ to the Adafruit feed. This will trigger the event on Adafruit dashboard which is continuously monitored by the microcontroller (here NodeMCU). This microcontroller will take action as per the data change on the Adafruit dashboard.

 

google_assistant_nodemcu_cycle.png?auto=
 

 

 

 

 

Interfacing Diagram

home_appliance_control_updated_D5N0SLwkm
 

Circuit Diagram for Home Appliance Control using google Assistant

Library

Here, I used the Adafruit MQTT library for receiving data from the Adafruit server. To install this library, select option Sketch -> Include Library -> Manage Libraries.

In that library, search for Adafruit MQTT and installed it.

Control Home’s Light using Google Assistant and NodeMCU

I build an IoT based home automation application in which I control the 60 W bulb at remotely using AI based Google Assistant.

Here, I used NodeMCU to read data from Adafruit server and act accordingly. 60 W bulb connected to NodeMCU via relay for controlling it voice command using google assistant.

 

High Quality PCBs From NEXTPCB
fe861nqk2v2h1c6_AmpBwmqCVT.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 
Nextpcb Is one of the best Online PCB manufacturing Company from where you can order PCBs online without any hassle. The company fast lead time : as fast as 24 hours. With their high tech machinery and automated work stream, they can manufacture huge quantities of high-class PCBs within hours.
Nextpcb can Develop PCBs of various complexity . They Develop simple and cheap PCBs with single layer Board For hobbyists and enthusiasts as well as complex multi layer board for high standard industrial applications NextPcb work with Large product Manufacturers And may Be the PCB of devices you are using such as laptop or smartphone were made at this factory.

High Quality PCBs From NEXTPCB

 

 

Nextpcb PCB Sample
Nextpcb PCB Sample
 

 

Nextpcb Is one of the best Online PCB manufacturing Company from where you can order PCBs online without any hassle. The company fast lead time : as fast as 24 hours. With their high tech machinery and automated work stream, they can manufacture huge quantities of high-class PCBs within hours.

Nextpcb can Develop PCBs of various complexity . They Develop simple and cheap PCBs with single layer Board For hobbyists and enthusiasts as well as complex multi layer board for high standard industrial applications NextPcb work with Large product Manufacturers And may Be the PCB of devices you are using such as laptop or smartphone were made at this factory.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...