Google Assistant Based Home Automation Using IFTTT

Introduction:

Internet of Things: The Internet of things (IoT) is the network of physical devices, vehicles, home appliances and other items embedded with electronics, software, sensors, actuators, and connectivity which enable these objects to connect and exchange data. Each thing is uniquely identifiable through its embedded computing system but is able to inter-operate within the existing Internet infrastructure.

Google Assistant:

Google Assistant is a virtual personal assistant developed by Google that is primarily available on mobile and smart home devices. Unlike Google Now, the Google Assistant can engage in two-way conversations.Assistant initially debuted in May 2016 as part of Google’s messaging app Allo, and its voice-activated speaker Google Home. After a period of exclusivity on the Pixel and Pixel XL smart phones, it began to be deployed on other Android devices in February 2017, including third-party smart phones and Android Wear, and was released as a standalone app on the iOS operating system in May. Alongside the announcement of a software development kit in April 2017, the Assistant has been, and is being, further extended to support a large variety of devices, including cars and smart home appliances. The functionality of the Assistant can also be enhanced by third-party developers.

 

The project works in the following manner:             

Here many websites are used for their different use like Adafruit website and IFTTT website to trigger the site Adafruit. So, Here how it works.

  1. Open account in io.adafruit.com using your gmail id and create a toggle button feed over your dashboard. To do this first we log into it and go to Dashboard and give it to a suitable name by choosing toggle button and in that dashboard will we create one feed. Here we have given “switch” name in our dash board. In this dashboard we will find important information like user name, a key of that feed which we have created and the feed name.
  2. Now switch into the website IFTTT. Sing in into it and create one recipe here it’s called recipe. IFTTT stands for IF This Then That so we need to set the key This and Than only. So to set This we choose google assistant to take our voice and match with our provided key word like ” Turn on my kitchen light” and with response write down “Ok Let me do. Turning on your kitchen light” you can write anything in place of response words to speak out. Now to set Than, here we choose send any value to the feed we have created. Our feed name is “switch”. So, switch is a variable which holds the value. And we set some value to it. Let’s suppose we set it to ‘1’. And again to turn off set it to ‘2’. Any value or character you can choose but not the special character.
  3. Now we need to read this variable switch value using our wifi module. Here we have used ESP8266-01 wifi module.
    1. The ESP8266 ESP-01 is a Wi-Fi module that allows microcontrollers access to a Wi-Fi network. This module is a self-contained SOC (System On a Chip) that doesn’t necessarily need a microcontroller to manipulate inputs and outputs as you would normally do with an Arduino, for example, because the ESP-01 acts as a small computer. Depending on the version of the ESP8266, it is possible to have up to 9 GPIOs (General Purpose Input Output). Thus, we can give a microcontroller internet access like the Wi-Fi shield does to the Arduino, or we can simply program the ESP8266 to not only have access to a Wi-Fi network, but to act as a microcontroller as well. This makes the ESP8266 very versatile, and it can save you some money and space in your projects. In this tutorial we are going to show you how to set up the ESP-01 Wi-Fi module, configure it, and verify that there is communication established between the module and another device.
      And send the value to our microcontroller Arduino UNO. Arduino UNO receives the data and process as per our requirement.
    2. Arduino UNO: Arduino is an open source computer hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and control objects in the physical world. The project’s products are distributed as open-source hardware and software, which are licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL), permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially in preassembled form, or as do-it-yourself (DIY) kits. Arduino board designs use a variety of microprocessors and controllers. The boards are equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The boards feature serial communications interfaces, including Universal Serial Bus (USB) on some models, which are also used for loading programs from personal computers. The microcontrollers are typically programmed using a dialect of features from the programming languages C and C++. In addition to using traditional compiler tool-chains, the Arduino project provides an integrated development environment (IDE) based on the Processing language project.

COMPONENTS REQUIRED:

  1. Arduino UNO
  2. ESP8266-01
  3. 1K and 10K ohm resistors.
  4. 12-0 Step-down transformer.
  5. IN4007 Diode.
  6. Three pin socket: To connect any device
  7. 5mm LED
  8. 7805 and 7812 voltage regulators.
  9. 12v Relay.
  10. Transistor (BC547)
  11. Bulb holder
  12. TWO pin plug.

 

Circuit Connection and How Circuit Works:

According to the block diagram the major components of the circuit are:

  1. Power Supply
  2. Arduino UNO
  3. Wifi Module ESP8266-01
  4. Relay and relay drivers.

The Arduino UNO board is connected to ESP module and Relay with Relay drivers. ESP8266-01 is the most important part of the circuit. Should be connected in a proper manner to transmit and receive data.

Power Supply: While the device will be running on AC supply, the circuit will require 12V and 5V DC supply. The 12V supply will be provided via external power supply and supplied to 12V relay and voltage regulator. The other components/circuits will need a 5V DC supply which will be provided via 7805 voltage regulator that is converting the input 12V supply to 5V DC.

Arduino UNO: Main logic decision making takes place over here.

Relay and Relay drivers:  When a key get confirmed the respective pin become HIGH and due to this HIGH LEVEL or 5v it tiggers the transistor BC547 connected with a resister to its base, emitter is grounded and collector of this BC547 is connected to the one end of the coil of 12v relay. So, when transistor get voltage more than the voltage of base-emitter it triggers the transistor making the current to flow from collector to the emmiter. And provides a ground to the relay circuit and relay starts operating. Means COMM point of relay switches to NO from NC point. NO is connected with the NEUTRAL point of AC supply and PHASE is provided to the device initially. So, whenever the COMM point switches to NO from NC, COMM provides NEUTRAL to the device. And the device or any appliances or bulb connected to it gets ON.

Search and Download circuit diagram and code from this LINK.