Projectsraspberry pi

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi

Proper now, dwelling automation using Internet of points (IoT) is among the many important domains which is attracting consideration from large tech companies.

All of us want to non-public a smart dwelling, nevertheless sometimes language turns right into a barrier in organising IOT dwelling automation system. Lots of the present dwelling automation packages help only a few languages, sometimes English.

Wouldn’t or not it is good if we’re in a position to administration our dwelling with numerous languages like Hindi, Bengali, Marathi and so forth?

Positive, it’s attainable now! On this DIY problem, we will make an IOT dwelling automation system that may assist you administration your non-public house with voice directions given in your hottest language.

This dwelling automation system makes use of google assistant to handle the great devices at dwelling. So, it moreover helps all the languages supported by the google assistant. We might even make an app to handle the system.

Let’s start the problem –

Bill of Supplies

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi

Setting Raspberry Pi

The very very first thing we’ve to do is to rearrange an Apache server in Raspberry Pi. To do it, open the terminal window and run the following command.

sudo apt-get arrange apache2 -y

After worthwhile arrange of the server, we’re in a position to take a look at it by typing the I.P deal with of your Raspberry Pi in any web browser. If the server is working constructive, we’ll get the Apache internet web page throughout the web browser. Now, we’ll use our Apache server to course of PHP Recordsdata, for this it’s advisable have the latest mannequin of PHP module for Apache. To get this module run this command –

sudo apt-get arrange php libapache2-mod-php -y

Subsequent, we’ll create a PHP file to handle the GPIO of Raspberry Pi. To take motion, open terminal in Raspberry Pi and go to its html itemizing by  this command as you presumably can see in Fig 1.

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 1. Creating php file from terminal

Subsequent create a PHP file by the usage of “sudo nano lightsoff.php” command

and write the following piece of code in it,

<?php

System    (“gpio -g mode 27 out”);

System   (“gpio -g write 27   0”);

?>

Then press Ctrl+X  to avoid wasting numerous and exit from the editor.

After this create a lightson.php file for turning the lights on and paste the following code in it.

<?php

System    (“gpio -g mode 27 out”);

System   (“gpio -g write 27   1”);

?>

Repeat the equivalent course of for controlling completely different GPIO of Raspberry Pi.

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 2. Code In PHP

You presumably can receive the complete code for turning lights on and off from the hyperlink beneath.

Setting Google Assistant

Now, we will put collectively the google assistant for our voice command. First open the language settings of google assistant and select the language of your various. Then open the google assistant settings and go to “Routines” selection. You will get a plus floating button throughout the menu of Routines, click on on on that after which set the voice command that you just simply have to create. As an example, should you want to administration lights, you presumably can set the voice directions in your hottest language to activate the lights. After this, set the movement for that voice command throughout the given format (Refer Fig. 3,4,5,6,7)

“search Rpi IP address/ PHP file name”.

Search 192.168……../ lightsoff.php.

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 3. Setting language in google assistant.
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 4. Going to google assistant settings
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 5. Google assistant setting menu
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 6. Google assistant Routines setting
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 7. Google assistant command setting

Connection

Now be part of the weather as illustrated beneath.

Raspberry pi           Relay Board

GPIO 13                    Relay IN 1

GPIO 15                    Relay IN  2

5V                            Relay 5V

GND                          GND

 

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 8. Connection
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 9. Setting all of the items in enclosure

App Making

We’re in a position to moreover create an app to handle the lights. Let’s make the app.

Open Android studio and create a model new problem with bottom navigation bar and do coding as illustrated beneath (Refer Fig. 10 ,11,12,13,14).

To start out with, set the permission in app to entry the net on account of we will use Wi-Fi to handle GPIO of RPi.

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 10. Setting permission in manifest

Then go to Mainactivity.java and create a WebView and String variables as throughout the picture beneath.

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 11. Creating WebView
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 12. Creating code to load URLs of RPi server

Fig 14. Creating Navigation bar

Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 13. Creating app construction.
Multi-Language Voice Administration IOT Dwelling Automation Utilizing Google Assistant and Raspberry Pi
Fig 14. Creating Navigation bar

Testing :

Vitality the Raspberry Pi with 5V DC. Then be part of Raspberry Pi and your phone to your Wi-Fi group or you could as nicely use phone HOTSPOT. Then say “hey google” adopted by the voice command that we have set in our hottest language. As an example, say “hey google light on kar do”

And it will activate the lights. Chances are you’ll as nicely administration lights with the app we have merely created. Open the app and press the icons in navigation to indicate the lights on/off

DOWNLOAD

Leave a Reply

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

Back to top button