<<

International Journal of Advanced Research in Engineering and (IJARET) Volume 12, Issue 3, March 2021, pp.120-127 Article ID: IJARET_12_03_014 Available online at http://iaeme.com/Home/issue/IJARET?Volume=12&Issue=3 ISSN Print: 0976-6480 and ISSN Online: 0976-6499 DOI: 10.34218/IJARET.12.3.2021.014

© IAEME Publication Scopus Indexed

GOOGLE ASSISTANT VOICE ACTIVATED AUTOMATIC CONTROL OF HOME APPLIANCES USING IOT AND NODE MCU

Sandeep Chintha Assistant Professor, Department of Electronics and Communication Engineering, Geethanjali College of Engineering and Technology, Hyderabad, India

K. Ramya Prathima Systems , Infosys Ltd, Hyderabad, India

ABSTRACT In the modern technology, home system makes our lives easier and comfortable because the data can be transmitted or received between the devices by connecting the home appliances with (IoT) and can be accessed or operated from anywhere, at any time. includes controlling aspects of home, remotely through electronic devices. In this , we are going to implement the home automation concept which is voice controlled and here “ Assistant” is used for the voice recognition. Unlike other voice activated home automation systems, in the proposed system the appliances are operated from anywhere without any distance limits as we are using internet for giving commands from to the system which controls the appliances. The Google Assistant takes the user’s voice commands as input. “Adafruit IO” is a cloud based IoT web server which is used to create the switches virtually and linked with “IFTTT” which is used for creating simple conditional statements. These statements from IFTTT are added as voice commands for Google Assistant. The entire communication between the devices is based on internet i.e., with Wi-Fi. Whenever the command is given to the Google Assistant by the user, these commands are decoded and passed to “NodeMCU” which in turn controls the relays connected to it. Hence the device or appliance connected to the respective relay can be switched ON or OFF as per the demand of the user. Key words: Home automation, NodeMCU, IFTTT, Adafruit IO, Google Assistant Cite this Article: Sandeep Chintha and K. Ramya Prathima, Google Assistant Voice Activated Automatic Control of Home Appliances Using IOT and Node MCU, International Journal of Advanced Research in Engineering and Technology (IJARET), 12(3), 2021, pp. 120-127. http://iaeme.com/Home/issue/IJARET?Volume=12&Issue=3

http://iaeme.com/Home/journal/IJARET 120 [email protected] Sandeep Chintha and K. Ramya Prathima

1. INTRODUCTION “Home automation”, the name itself implies that it is automatic and electronic control of household features and appliances. The home utilities can be easily controlled through the Internet by using few elements of home automation system mainly , actuators and controllers as per the requirement. “” (IoT) is the modern developing technology which deals with the hardware devices and the software applications connected over the network. The main application of IoT is Home Automation. Automation leads increase in efficiency but with less effort. By using IoT, we could successfully control the devices in various areas, one of the examples is, to controlling the home automation using NodeMCU. Since the proposed system deals with voice activation, here the user’s speech is provided as the input to microphone and this home automation system will work only if the is near and better. Thus, microphone recognizes the voice provided by the person or the user and sends to the recognizing module. Then the module searches for the nearest word and if there are any noises or disturbances. If the command given is correct, then action is performed. The home automation system gives immediate access to control all the home appliances. Moreover, home automation is a time saving system. For the physically challenged and elderly people, they find it difficult to reach the switchboard to turn on/off the appliances. So, a voice- controlled home automation system can be useful for them to access the appliances by sitting at a place. We use a for giving user commands by using the Google assistant and NodeMCU, with Wi-Fi connectivity to gain access and control the devices or home appliances.

2. IDEOLOGY The idea is to control the different kind of home appliances by taking the voice command from the user via Google Assistant. The command is translated by the smart phone and if it is an appropriate command then it is sent to the IFTTT (If this, then that). The IFTTT acts as the mediator through which the user will communicate with the appliances. The IFTTT will send the signal to the NodeMCU which in turn send the appropriate command to the Relay which controls the appliances. We use a Smartphone for providing user commands using the Google assistant and NodeMCU, of course with Wi-Fi connectivity to access and also control the devices. Hence, we will be able to automate every appliance we need, sitting at a place.

3. HARDWARE ESSENTIALS 3.1 NodeMCU (ESP8266) The NodeMCU is an open source IoT hardware development board. It contains the Wi-Fi module (ESP8266) which is used to connect the devices with the network. ESP8266 is a cost- effective Wi-Fi chip, hence NodeMCU is an inexpensive which is suitable for the construction of home automation systems.

3.2 Relay Module A relay is an electro-magnetic switch. Hence, the relay module can be used as series of switches which is used to turn ON or OFF the appliances. The relay can be operated in two configurations

3.2.1 Normally open relay By default, normally open relays are in open position which means that when they are not used, there is no contact between the circuits. When power is introduced, an electromagnet pulls first circuit in contact with second circuit and makes it a closed-circuit allowing power to flow. When power is turned off, again it behaves as an open circuit.

http://iaeme.com/Home/journal/IJARET 121 [email protected] Google Assistant Voice Activated Automatic Control of Home Appliances Using IOT and Node MCU

3.2.2 Normally closed relay The normally closed relays are by default in closed position which implies that the circuit is closed. When a very high power is introduced then the first circuit move away from the second circuit to turn it off. In our requirement the relay module is to drive one appliance (bulb), thus one channel relay module is used.

4. SOFTWARE ESSENTIALS 4.1 Google Assistant Google Assistant or Google’s voice assistant is software which is used to give voice commands. It is a software based on which allow the user to control the applications in their device. In general, the keyword “Ok Google” is used to start the communication with the Google Assistant. Assistant is able to schedule alarms, search the Internet, adjust hardware settings and show this data in their Google account. This feature is available in almost all kinds of android mobile phones. The users can give the voice commands through Google Assistant to access smart devices and applications. 4.2 IFTTT (If This Then That) IFTTT - a service where a user can program a response to event using simple conditional statements. Simply, it is a website where if-else statements generally known as applets are created. To set up the application, first login the app. and conditional statements can be created. IFTTT facilitate us to define the commands to be given from the Google Assistant to switch ON or OFF the appliance. Whenever the command is given from Google Assistant, then IFTTT application will trigger Adafruit IO which will pass the command to NodeMCU through Wi-Fi to switch ON or OFF the respective appliance. 4.3 Adafruit IO Adafruit IO is basically a cloud service. User can store and visualize the data multiple times. User can connect over the internet anywhere and view the dashboards. This application allows user to create chart, graph etc. to display the data. The data is kept private and secured for us. This data can be accessed through a web-browser; hence it provides the ideal hub for operating various IoT applications. 4.4 IDE Arduino IDE – Arduino Integrated Development Environment is an open-source software that uses Java as its mainly used for writing and compiling code into Arduino module. This also supports C, C++ programming languages. The code written by user consists of two functions, setup () and loop () which are compiled, linked with main () function. Arduino IDE is used to compile the program and to flash the code into Arduino board.

5. BLOCK DIAGRAM

Figure 1 Block diagram for home automation using NodeMCU and Google Assistant

http://iaeme.com/Home/journal/IJARET 122 [email protected] Sandeep Chintha and K. Ramya Prathima

6. CIRCUIT DIAGRAM

Figure 2 Circuit connections of hardware components

7. PROCEDURES 7.1 Setting up Adafruit IO • Sign up for an account at www.Adafruit.io • Then create a dashboard at Adafruit, which acts as a user interface to control things remotely. Give a name to the dashboard and save it. • Next is to create feed i.e., the user interface. Then select the toggle feed, to control light ON/OFF. • Select the created feed and then configure. Here, 0 is used to switch OFF and 1 is used to switch ON.

Figure 3 Dashboard after login

7.2 Applet's creation with IFTTT • Create an account on IFTTT by using the same sign-up credentials used for Adafruit. • After log-in, click on “My Applets” and select “New Applet”. Now configure the applets based on the requirement.

http://iaeme.com/Home/journal/IJARET 123 [email protected] Google Assistant Voice Activated Automatic Control of Home Appliances Using IOT and Node MCU

• Click on to “This” and enter a phrase, here the phrase to switch ON the light. Another applet with another phrase is to be created for the light to switch OFF. Basically, “If this” connects with Google Assistant using the mail-id. • Similarly, another page is shown, where we need to configure “That”. "Then That” connects the Adafruit IO to the Google Assistant. • Choose the feed names and click the “Finish” button to create the applet. Accordingly, create applets for all the relays.

Figure 4 Creating statements in IFTTT website

7.3 Connecting NodeMCU with Arduino IDE • Install and open the Arduino IDE software. Go to “File” -> “Preferences” and add ESP8266 board manager. • Then go to “Tool” -> “Board Manager” -> select ESP8266 Arduino board and select version. Install it to the software. • Finally upload the source code and libraries.

7.4 Interfacing NodeMCU with Relay

• The voltage pin Vin (+5V) of the NodeMCU is connected to the voltage pin of relay module. Similarly, the ground pin of is connected to ground pin of relay module. • There are 8 digital data pins in NodeMCU. As we are using 1-Channel relay, D0 pin of NodeMCU is connected to the control pin of relay module.

8. WORKING With the help of Google Assistant, user gives voice commands and when these commands are received, then data is interpreted and analyzed whether the voice command is meant for IFTTT because these commands are added to Google Assistant via IFTTT. If these are valid commands, then IFTTT application will trigger Adafruit IO which will pass the command to NodeMCU through Wi-Fi to switch ON or OFF the respective appliance. For example, if the command is “Ok Google turn ON light” then Google assistant interprets this as light = ON to IFTTT which in turn makes the connected relay to switch ON this way- the data if it is valid, then it is sent to Adafruit IO which is displayed on the dashboard. The commands provided through Google assistant are decoded and given to NodeMCU (ESP8266). Now the microcontroller looks for the appliance which is connected to respective relay and makes the device to switch ON automatically. The communication between the application and microcontroller is via Wi-Fi.

http://iaeme.com/Home/journal/IJARET 124 [email protected] Sandeep Chintha and K. Ramya Prathima

Figure 5 Creating trigger feed in Adafruit

Figure 6 Creating “THEN THAT” statement

9. RESULT By providing voice command using Google Assistant the light is switched ON or switched OFF according to the user requirement. The circuit connections are made as shown in the figure 7. Then the command ‘turn light ON’ is given through Google assistant to switch ON the light and the command ‘turn light OFF’ is to switch OFF the light. As the code is already uploaded onto NodeMCU board via Arduino IDE, the board gets connected to Wi-Fi. Hence the light is turned ON as shown in figure 8 and then turned OFF as shown in figure 9 as per the user’s command.

http://iaeme.com/Home/journal/IJARET 125 [email protected] Google Assistant Voice Activated Automatic Control of Home Appliances Using IOT and Node MCU

Figure 7 Circuit setup

Figure 8 Blub glowing after receiving ‘light turn ON’ command

Figure 9 Bulb switched OFF after receiving ‘light turn OFF’ command

http://iaeme.com/Home/journal/IJARET 126 [email protected] Sandeep Chintha and K. Ramya Prathima

10. CONCLUSION IoT Technology is becoming more efficient these days because of tremendous growth in home automation applications and also everything could be controlled from anywhere sitting at a place. The working of these IoT devices is automatic and there is no need for man-made interventions. It provides greater advantages which decreases energy by improving home security. On the other hand, home automation system is flexible to accommodate new appliances because one can operate the appliances even though if the user is far away from the home. With the help of such IoT devices, the daily lives or the work of the users is made simple, easier and accurate.

REFERENCES

[1] Abdul Aziz Md, K Harshasri and K Shanmukha Rao, “Cost-Effective Voice Controlled Home Automation Using IoT “, Vol 4, Issue 3, March 2017.

[2] https://learn.adafruit.com/adafruit-io/mqtt-api

[3] https://ieeexplore.ieee.org/Xplore/home.jsp

[4] https://www.pantechsolutions.net/google-assistant-based-voice-controlled-home- automation

[5] Manish Prakash Gupta, “Google Assistant Controlled Home Automation”, Volume: 05 Issue: 05 May2018.

[6] https://www.digitaltrends.com/mobile/what-isgoogle-assistant

[7] Purushottam, and Chandan Kumar Dubey, “Automation by Voice Commands”, Volume 8, Issue V, MAY 2018.

[8] Saurabh Singh, Harjeet Matharu and Dr. Sangeeta Mishra, “Internet of Things (IoT) Based Home Automation System”, November, 2017. DOI:10.5281/Zenodo.1049436.

[9] https://codeometry.in/home-automation-using--and-google-assistant

[10] Aayush Agarwal, Anshul Sharma, Asim Saket Samad and S Babeetha, “UJALA- Home Automation System Using Google Assistant”, Vol-4 Issue-2 2018.

[11] https://nodemcu.readthedocs.io/en

http://iaeme.com/Home/journal/IJARET 127 [email protected]