Breaking

Friday, December 6, 2019

HOME AUTOMATION USING GOOGLE ASSISTANT AND NODEMCU

HOME AUTOMATION USING GOOGLE ASSISTANT AND NODEMCU

HOME-AUTOMATION-USING-GOOGLE-ASSISTANT-AND-NODEMCU


Hello friends ! in this article we will discuss about " HOME AUTOMATION USING GOOGLE ASSISTANT AND NODEMCU".  Everything is getting smarter today, so why can't we make our home smarter? Why can't we make every gadgets at home advanced?
today lots of gadgets and process available in market. with which you can makes your home a smart home. some gadgets are very expensive , some gadgets are inexpensive. also some of them very complex to install and use . but in this article i will talk about very cheap price gadgets and easy to install With which you can easily create a low cost smart home.

ex. Google Assistant , Google nest mini , Google home mini , google home , amazon Alexa. amazon echo dot , etc.

The whole process i used Google Assistant because google is the most popular and maximum people have an android mobile phone, also google home mini , nest mini, home are most popular as compare to any other smart speaker .
Don't worry if you have Amazon Alexa or Echo Dot, you I can done these processes. almost maximum process are same.

  • REQUIREMENT :


1. you must have google nest mini or google home mini or google home.
if you not have this, then you must have an android mobile (in that mobile must be support google Assistant ).

2. a Google account.

3. you  install the blynk app on your mobile phone. ( this app avalible in google play store and ios store).

4. nodeMCU ESP8266 Wi-Fi module.

5. if you control the 4 devices then use 4 ch. relay module.

6. some jumper wires.

7. Wi-Fi connection. if don't have any Wi-Fi connection then you can used your mobile hotspot connection.

8. 5V dc adapter.

  • PROCESS :

WE CAN DIVIDE TOTAL PROCESS INTO 2 STEPS :
  • Hardware & assembling :
  • Software & programing :



before do anything, you set up your google nest mini,home mini, home with your google account. or if  you want to control your mobile phone then complete your google assistant setting with your google account.
  • HARDWARE & ASSEMBLING :

1. at first connect your relay VIN pin to Node MCU VIN pin.
2. then connect your relay IN1 to node MCU D0-D16 pin. which you want.
but my personal recommendation, if you connect pins serial ways then it is very easy to process and identify.
3. then connect your relay IN2 to node MCU D1 pin.
4. after that the connect relay GND pin to any GND pin in node MCU.
5. the connect your Gadgets in your relay module.
6. connect your 5v DC adapter with your node MCU.

For better understanding you can see this picture. this will be easier for you and helps you to make a quick connection. 


your assembly parts are complete.
  • SOFTWARE & PROGRAMMING :

First of all download BLYNK app on google play store or IOS store.

after download open your BLYNK app and login your google account.
if you have not any account in BLYNK app then create a new account.(You must remember that the BLYNK APP login  Google Account and your Google Home and Mobile google assistant's Google Account both are same.)



after successfully login click on New Project option .

then give your Project Name. then click on choose device option. and choose the NodeMCU. then choose connection type Wi-Fi. after that click on Create option.


after that BLYNK has been send a authorization code in your gmail account.

then you can see a blank field and top of  that have a + icon
 click on the + icon and add the buttons.


after successfully add the buttons . configure the each buttons.


first give the Button Name. then choose your pin(D3) and set value 1 / 0 and click on SWITCH option.



BLYNK app setup is complete.
  • NOW IT'S TIME TO PROGRAMING :

At first download and install the Arduino IDE software on your computer .
I gave the Arduino ID download link.-> https://www.arduino.cc/en/Main/Software

then connect nodeMCU on your computer(via USB cable).

then open your gmail account -> open BLYNK app mail.

there you will see a Authorization code , copy that 
also you will see the Latest Blynk library option , download that.

after download extract the Blynk library zip file. then you will see the 2 folders 1.libraries 2.tools

first open the libraries folder and copy the all of that. then open system drive (like C,D,E) -> open program folder -> open Arduino folder

inside Arduino folder  you will see the library folder-> open that folder
then paste the all copy items.

Do the same process for the Tools folder.

open the Arduino IDE application .
then click on File option -> examples -> Blynk ->Boards_Wi-Fi -> ESP8266_standalone.

inside the program you can add the Authorization code , Wi-Fi name and password .


then choose your board. how to do it.
Click on Tool -> Board: -> then select nodeNCU 1.0 (ESP-12E module).


Then choose your port number. how to do it.
Click on Tool -> Port -> then select your Port (ex.COM 7) .

when everything is ok click on Upload. then wait for sometime . after successfully uploading the program, it's time to disconnect your NodeMCU from your computer .and connect to 5v DC adaptor.

  • IT'S TIME TO APPLICATION SYNCHRONIZATION AND MAKING COMMANDS:

At first go to ifttt.com then click on sign in and log in with your google account.
if you have not any account in IFTTT then create a new account. (You must remember that the IFTTT login Google Account and your Google Home or Mobile google assistant's Google Account both are same.)

after that click on Create ( or type this URL https://ifttt.com/create ) then you will see " if this [+] than that " .

click on [+] icon -> you can see a search option. In that search bar, search Google Assistant.

then you can choose a trigger type , my recommendation choose "Say a simple phrase " trigger type.
after that "Complete trigger fields ". how to do it ? 
Check out the picture below. (you can change any text which you want).



click on [+] icon -> similarly you can see a search option. In that search bar, search webhooks.


then click on "make a web request" -> "Complete action fields" you will put some data. just like
in URL option you will paste a url . i'll give this URL in below.

http://188.166.206.43/2f8482b704cf41fbacb23d937ce10778/update/D0

then method type 'PUT' also Content Type 'application/json' and Body (optional) type ["0"]
See the image below for a better understanding.


Similarly you can add the Light off trigger. just change the Body (optional) type ["1"]

Now everything is ready to work .
  • CONCLUSION:

I know this is a very large post and looks very complicated. but if you read this article with Patience I'm sure you can easily do these steps.and you will create more advance feature .
if you have to any problem working on the project . please comment below or contact us.

No comments:

Post a Comment