Project showcase
Home Automation Using Google Assistant

Home Automation Using Google Assistant © LGPL

This includes creating Adafruit account then linking to IFTTT website then adding to Google Assistant for voice commands.

  • 29,881 views
  • 18 comments
  • 79 respects

Components and supplies

Apps and online services

About this project

The idea behind this is to control home devices with voice. On the market there are many devices available to do that. But making your own is awesome. So, let's do it. Build your personal assistant that will do the work for you. Just your assistant requires voice commands.

Part 1

Setting Adafruit.io

Part 2

Setting IFTTT account and linking with Google Assistant app:

Part 3

Code

Home Automation using Google assistant appC/C++
#include <SoftwareSerial.h>// import the serial library
SoftwareSerial mySerial(2, 3); // RX, TX
int Data; // the data receive d from the app store here
int a=0,b=0,c=0,d=0,e=0; //used for key presbs or not 
int ONE=5;    //Digital pin 6 isS used to ON relay 1
int TWO=6;    //Digital pin 7 is used to ON relay 2
void setup() {
  // Setup code to initialize all the user and predefined functions
  Serial.begin(115200); //Software serial initialization
  mySerial.begin(115200); //
  pinMode(13, OUTPUT);// Set pim 13 as OUTPUT
  pinMode(ONE, OUTPUT);// Set pim 6 as OUTPUT
  pinMode(TWO, OUTPUT);// Set pim 7 as OUTPUT
  digitalWrite(13,HIGH);
  //Serial.println("      Google Assistant Based Home Automation  ");
  //Serial.println("            www.myengineeringstuffs.com       ");  
  delay(3000);delay(3000);
  digitalWrite(13,LOW);
}

void loop() {
     if (mySerial.available())  // wait for the data to be available at the receiver buffer.
       {
        Data=mySerial.read(); // Read the dat store it in the variable.
        Serial.write(Data);
       if(Data=='1')
           {// if character '1' pressed ....    
           a=1;                       
           digitalWrite(ONE,HIGH); 
           Serial.println("ON1");
           digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
           delay(1000);
           digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
           }
      if (Data=='2')
          {// if character '2' pressed ....
          a=0;
          digitalWrite(ONE,LOW);
          Serial.println("OFF1");
          digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
           delay(1000);
           digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
          }
      if (Data=='3')
            {// if character '3' pressed ....
            b=1;
            digitalWrite(TWO,HIGH);
            Serial.println("ON2");
            digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
           delay(1000);
           digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
            }
      if (Data=='4')
          {// if character 'S' pressed ....
          b=0;
          digitalWrite(TWO,LOW);
          Serial.println("OFF2");
          digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
           delay(1000);
           digitalWrite(13, HIGH);
           delay(1000);
           digitalWrite(13,LOW);
          }   
       }
delay(300);
}

Comments

Similar projects you might like

Speak to Arduino and Control It with Google Assistant

Project tutorial by ElectroPeak

  • 86,958 views
  • 30 comments
  • 199 respects

Candy Dispenser with Google Assistant

Project tutorial by Arduino “having11” Guy

  • 20,560 views
  • 3 comments
  • 71 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 74,384 views
  • 23 comments
  • 174 respects

Siri and Google Now home automation

Project in progress by Andres Santos

  • 22,808 views
  • 3 comments
  • 24 respects

RGB Lighting Reactive to Music and WiFi Controlled

Project tutorial by Philipp Jurasic

  • 5,688 views
  • 2 comments
  • 28 respects

J.A.R.V.I.S. : A Virtual Home Assistant

Project tutorial by Team Blitzkrieg

  • 89,162 views
  • 19 comments
  • 299 respects
Add projectSign up / Login