Make your own Google Home device

K Shakthi Dhar Reddy
6 min readJun 30, 2020

“Hey Google”, “OK Google” these are the buzz words in our day to day lives and the wake word for our Google Home.

As a matter of fact it has made us too lazy to move around and switch on devices like tube light, Fan and AC……, all we need to do is say “Hey google, turn on the lights”.

“But then why cant we make our own device, with our own cool wake words ?”

I started asking this question to myself and started my research, of course I had to use Google for this again. In this journey of finding an answer to my question, i was introduced to the field of IoT and AI which then directed me towards a new microcotroller: Node MCU.

NODE MCU

Node MCU is an open source LUA based firmware developed for ESP8266 wifi chip. By exploring functionality with ESP8266 chip, it comes with ESP8266 Development board/kit.

All we needed to make our own Voice assisted BOT was Node MCU and the device we want to operate. We need to install few apps in our android device in order to make use of our google assistant, to communicate with our bot/ Node MCU.

Blynk Application

Blynk is a new platform that allows you to quickly build interfaces for controlling and monitoring your hardware projects from your iOS and Android device. After downloading the Blynk app, you can create a project dashboard and arrange buttons, sliders, graphs, and other widgets onto the screen.

IFTTT

IFTTT helps you connect all of your different apps and devices. When you sign up for a free account, you can turn on Applets that help your apps and devices work together to do specific things they couldn’t do otherwise.

Now lets get started to create our own google home device

Lets get to work…

Step 1: Setting up your Blynk App

  • Search for Blynk app in Play store and install. You would have to sign up with your email id and create an account.
  • You will now see an option to create new project, go ahead and create a new project, name it as per your wish and click on create, you will then get a pop up message saying an Auth token was sent to your registered mail id, click OK and proceed.
  • Go to the widgets option by clicking the + icon at the top, you will now have an option to choose from variety of widgets. Choose the Styled button option as we are going to control LED’s using Google assistant. Now tap on the styled button appearing on your screen, to open settings. You can give a title to your button as well, and also change the color and theme.
  • In the PIN option choose the digital pin where you are connecting you are going to connect the led in Node MCU, i am going to use the in built led which is digital gp2 pin.
  • In the settings tab, set the device as ESP8266, you can also copy the Auth tokens to the clipboard or ask for re sending the email, by pressing the respective options.
  • Now you are all done with setting up your Blynk app.

Step 2: Coding Your Node MCU

  • Its time to code the Node MCU, in order to connect it with our Blynk App.
  • Node MCU can be programmed on Arduino IDE itself, make sure you have downloaded ESP8266 board from the Boards Manager and also blynk library from Library manager under tools option.
  • Choose the ESP8266- Node MCU 1.0(ESP 12 E Module) in boards and also choose the correct port in which you have connected the Node MCU.
  • Enter the code as given below and enter the Auth token you received to you mail id in auth[] and the ssid, password of you wifi/ hotspot to which your Node MCU is to be connected.
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// add your Auth Token sent to your mail
char auth[] = "Auth token here";
// enter your wifi/ hotspot ssid and pasword
char ssid[] = "ssid here";
char pass[] = "password here";
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}

You can Test if the Node MCU is connected to your Blynk app by running the app and checking the button functionality present in you app.

Step 3: Setting up your IFTTT

  • Install IFTTT app from play store, and login/ sign up with the same mail id as registered earlier with Blynk application.
  • Go to Get more and select Create. We can choose various actions to be performed for various situations using IFTTT, Click on This option and select Google Assistant as trigger service.
  • Now we can create our own modified call statements for the google assistant to trigger the corresponding action. Select say a simple phrase, and enter what you want to say and what the reply should be as per your wish and click continue. Now, next step is to create a link between IFTTT and our Blynk App and this task is carried out by +THEN functionality. Search and select Webhooks, this allows us to make a connection between IFTTT and Blynk.
  • Select make a web request option and enter the details as shown, enter your Auth token in the place mentioned in url and also the pin number of where the LED is connected as per gpio numbering [ search for Node MCU pin mapping]. Select method as POST and Content type as ‘application/json’, in the body enter [“1”] as our command is to turn on the light.
  • Do the same for turning of the light by giving your own input and output speech/ commands and change the body to [“0”] while turning off.

Step 4: Congratulations, you are done

  • Test your device by connecting the Node MCU to power supply and test it out by calling out your If This commands.

“If you think that the internet has changed your life, think again. The Internet of Things is about to change it all over again!” — Brendan O’Brien

What Next?

What we have seen is the basic implementation of Internet of Things and Artificial intelligence, we can take this a step ahead by using relay modules and connecting them to our real life appliances like Table Light, Fan and many more.

Google Home has a similar functionality, except that its much more advanced and much more comfortable to use and has larger application.

“Internet of Things is transforming the everyday physical objects that surround us into an ecosystem of information that will enrich our lives. From refrigerators to parking spaces to houses, the Internet of Things is bringing more and more things into the digital fold every day, which will likely make the Internet of Things a multi-trillion dollar industry in the near future.”

--

--