This is a project on Home Automation where we can control home appliances by making use of IoT.We can control any appliances like light, buzzer, heating appliances and many more!!. We are using Bolt IoT to make switching of appliances easy. In this project, we control a light by voice commands using google assistant. We give commands of our choice by IFTTT to control the appliances and also specify the reply we get by giving those commands. By this, we turn the appliances On and Off by just saying some phrases like "Turn the lifht on" for switching on the light and "Turn the light off" for switching the light off.
2. Steps for building projectstep 1:Hardware Connections:
Plug the longer end of the Light in the pin 0 of Bolt wifi module and shorter end to the ground pin (GND), and power on the Bolt WIFI.
step 2:Make a note of the Bolt API key and device id:
You can find the API key in https://cloud.boltiot.com/ -> API
You can find the device id in https://cloud.boltiot.com/ -> Devices
step 3:Create the GPIO control command:
We know that LED is a digital output device, we will need to get a Digital Write command that can be sent to Bolt over the Internet to switch on the LED.
The structure of the command is:
https://cloud.boltiot.com/remote/API_KEY/digitalWrite?pin=PIN_NUMBER&state=HIGH/LOW&deviceName=DEVICE_ID
You need to replace the Parameters are:
API_KEY: You can get it from API tab on cloud dashboard.
PIN_NUMBER: Pin to which you have connected the LED. Values can be either 0, 1, 2, 3 or 4
HIGH/LOW: This value indicates if you want to turn on/off the LED. HIGH will turn it on, LOW will turn it off.
DEVICE_ID: The id of your device. You can get it from cloud dashboard.
The sample command to turn the led ON connected to device having ID BOLTXXXXXXXX to PIN 0 is:
Step 4: Creating your IFTTT Account:
Go to IFTTT and create a new applet by clicking here. Sign in to IFTTT using the same gmail account that was signed in with google assistant.
click on create and create a new applet by clicking on "Add".
After clicking on add you will be redirecting to the page(as shown below) where you have to search on the search box: "Google assistant".
After that you have to click on google assistant then you will be redirected to page where you have asked to choose the trigger. You just have to select on "say a simple phrase"(as shown below).
After clicking on the "say a simple phrase" option, you will get the page where you have to fill up the details(shown below).
After filling up all the details click on Create trigger.
Again choose 'create applet' and choose the service 'webhooks'.
Click on webhooks and make a request.
Set up the URL as the one we generated using gpio digitalwrite command and other fields as shown above.Click on create and then finish.
On the above steps I had created for turning on the LED
Similar steps can be used to build the steps for turning off the LED.
Turning Off ledThe only change that has to made for turning off led is to make the Value as 0 and change the phase. All other steps are similar as stated above.
3.Final step and Done!!!!Now, Start Google Assistant on your smartphone and say "Ok Google" along with phrase that you have mentioned in creating trigger.
Now your assistant work according to you and project is successful!!
Comments
Please log in or sign up to comment.