Project tutorial
Bluetooth Voice Controlled Appliances with 'OK Google'

Bluetooth Voice Controlled Appliances with 'OK Google' © GPL3+

Control home appliances with voice, using Bluetooth and Google Assistant.

  • 4,234 views
  • 6 comments
  • 15 respects

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)
09507 01
Soldering iron (generic)

Apps and online services

About this project

My project is about controlling home appliances with Google Assistant and Bluetooth. I decided to make this project as when I was searching the web regarding voice controlled home automation projects, I found that most of the projects were based on WiFi. I gathered information regarding how Google Home and Amazon Echo are controlling home appliances, I was really astonished knowing how the technology has evolved. After gathering information regarding WiFi-based home automation, I started to gather information regarding Bluetooth-based home automation. While digging out the information from the web, a thought suddenly struck my mind. The thought was "why, in the case of Bluetooth home automation, does the user need to click on the button of the application every time for saying a command". I know that the button was acting as a trigger for activating Google Speech Recognizer and Google Text-to-Speech. So I made up my mind to build a project where the user doesn't have to press the button at all and everything will be automated. Later on when I started working on the project, I came to know that Google Home is capable of connecting to Bluetooth speakers to play music but is unable to connect to Bluetooth-based home appliances. So to remove the button on the Android App, I used Google Assistant ('OK Google'), a voice-activated trigger switch, to activate the app and Google Speech Recognizer and Google Text-to-Speech.

Watch this video to know how I made it:

Block Diagram:

Circuit Diagram:

Bluetooth Voice Controlled Appliances with 'OK Google' Copyright (C) 2018 by Suman Kumar Das
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Code

Code for Bluetooth voice controlled appliances with 'OK GOOGLE'Arduino
Bluetooth voice controlled appliances with 'OK GOOGLE'
 String voice;

#define FAN 10
#define TUBELIGHT 9
#define BULB 8

void setup() 
{                                            // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(FAN, OUTPUT);
  pinMode(TUBELIGHT, OUTPUT);
  pinMode(BULB, OUTPUT);
   analogWrite(TUBELIGHT,255);                    // Since LED must be off in the beginning
   analogWrite(FAN,255);
   digitalWrite(BULB,HIGH);
}

void loop() {
 
  while (Serial.available())   //Check if there is an available byte to read
  {                            
  delay(10);                   //Delay added to make thing stable
  char c = Serial.read();      //Conduct a serial read
  if (c == '#') {break;}       //Exit the loop when the # is detected after the word
  voice += c;                  //Shorthand for voice = voice + c
  } 

  if (voice.length() > 0) {
    Serial.println(voice);
  //----------Control Multiple Pins/ LEDs----------// 

       if(voice == "tubelight")//                             
     {
     analogWrite(TUBELIGHT,0); 
     analogWrite(FAN,255);
     digitalWrite(BULB,HIGH);
     }  
  else if(voice == "green")//                              
     {
    analogWrite(TUBELIGHT,255);
    analogWrite(FAN,255);
    digitalWrite(BULB,HIGH);
     }
  else if(voice == "fan")//                              
     {
    analogWrite(TUBELIGHT,255);
    analogWrite(FAN,0);
    digitalWrite(BULB,HIGH);
     }

      else if(voice == "bulb")//                                
     {
    analogWrite(TUBELIGHT,0);
    analogWrite(FAN,255);
    digitalWrite(BULB,LOW);
     }

       else if(voice == "go")//                                
     {
    digitalWrite(BULB,HIGH);
     }
  else if(voice == "lights")//                               
     {
    analogWrite(TUBELIGHT,0);
    analogWrite(FAN,0);
    digitalWrite(BULB,LOW);
     }
   else if(voice == "good night")//                         
     {
    analogWrite(TUBELIGHT,255);
    analogWrite(FAN,255);
    digitalWrite(BULB,HIGH);
     }
  
voice="";                                                       //Reset the variable after initiating
  }}

Schematics

Circuit Diagram
circuit diagram for Bluetooth voice controlled appliances with 'OK GOOGLE'
Circuit kwx9joytrh

Comments

Similar projects you might like

Voice Controlled Home Automation Using Arduino via Bluetooth

Project showcase by JoyDutta06

  • 1,013 views
  • 0 comments
  • 4 respects

Bluetooth Controlled Light Switch

Project showcase by Team The Instrumentation Crustaceans

  • 27,093 views
  • 4 comments
  • 27 respects

Bluetooth Controlled Servo

Project tutorial by JANAK13

  • 17,762 views
  • 19 comments
  • 41 respects

2WD Voice Controlled Robot with Arduino and BitVoicer Server

Project tutorial by Marcio Tamagushi

  • 14,155 views
  • 12 comments
  • 45 respects

Voice Controlled Car

Project tutorial by Yug_Ajmera

  • 32,386 views
  • 1 comment
  • 26 respects

Arduino Controlled Smart Hydroponic Modular System

Project in progress by Luis Antonio Martin Nuez

  • 19,579 views
  • 3 comments
  • 97 respects
Add projectSign up / Login