paint-brush
Make Arduino Voice-Controlled Appliances with HC-05 Bluetooth Moduleby@dorje
3,006 reads
3,006 reads

Make Arduino Voice-Controlled Appliances with HC-05 Bluetooth Module

by DorjeMay 27th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Make Arduino Voice-Controlled Appliances with HC-05 Bluetooth Module. Arduino could integrate with sensors that means you could use a number of sensors and develop a project with them. This project is based on voice control, using commands you could control your appliances. To develop this project you should need some components which are: Arduino Uno, Bluetooth Module (HC-05) Mobile Phone(App installed AMR_VOICE) Jumper Wire (AMR_Voice) and Breadboard.

Company Mentioned

Mention Thumbnail
featured image - Make Arduino Voice-Controlled Appliances with HC-05 Bluetooth Module
Dorje HackerNoon profile picture

Arduino is an awesome platform for learning how an embedded system works. Arduino could integrate with different sensors that means you could use a number of sensors and develop a project with them.

In this post, we are going to describe Bluetooth Module (HC-05) and Arduino Uno. How it works and develop a project like voice control appliances.Where you could turn ON and OFF your appliances through your voice commands.

Pin Diagram of HC-05 Bluetooth Module

Step 1: Setup Arduino IDE

This is the first step if you have not set up Arduino IDE then install and setup. Follow the link to set up.

Step 2: Code

String voice;     //String type variable declared
int 
ledPin = 2,       
fanPin = 3,
tvPin = 4; 


/* Turn ON all appliances*/
void allon(){
     digitalWrite(ledPin, HIGH); 
     digitalWrite(fanPin, HIGH); 
     digitalWrite(tvPin, HIGH);
     }


/* Turn OFF all appliances*/
void alloff(){
     digitalWrite(ledPin, LOW); 
     digitalWrite(fanPin, LOW);
     digitalWrite(tvPin, LOW); 
     
}
  
 void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 
  pinMode(fanPin, OUTPUT); 
  pinMode(tvPin, OUTPUT);
 
}


 void loop() {
  while (Serial.available()){  
  delay(10); 
  char c = Serial.read(); 
  if (c == '#') {break;} 
  voice += c; 
  }  
  if (voice.length() > 0) {
    Serial.println(voice); 
     
  
    
  if(voice == "*everything on")
  {
    allon();
  }  
  
  else if(voice == "*everything off")
    {
      alloff();
    } 
  
  /* Turn ON using particular command*/
  else if(voice == "*fan on") 
    {
      digitalWrite(fanPin, HIGH);
    } 
 
  else if(voice == "*light on")
    {
      digitalWrite(ledPin, HIGH);
    }


  else if(voice == "*tv on")
  {
    digitalWrite(tvPin, HIGH);
  }
  
  else if(voice == "*all on")
    {
      digitalWrite(ledPin, HIGH); 
      digitalWrite(fanPin, HIGH);
      digitalWrite(tvPin, HIGH);}
 
  /* Turn off using particular command */ 
  else if(voice == "*fan off")
    {
      digitalWrite(fanPin, LOW);
    } 
  
  else if(voice == "*light off")
    {
      digitalWrite(ledPin, LOW);
    }


  else if(voice == "*tv off")
  {
    digitalWrite(tvPin, LOW);
  }
  
  else if(voice == "*all off")
    {
      digitalWrite(ledPin, LOW);
      digitalWrite(fanPin, LOW);
      digitalWrite(tvPin, LOW);
    }
  
voice="";}}

Setup 3: Wiring

Let’s hands dirty with some jumper wire. To develop this project you should need some components which are:

  • Arduino Uno
  • Bluetooth Module (HC-05)
  • Mobile Phone(App installed AMR_VOICE)
  • LEDs
  • Jumper Wire
  • Breadboard

Conclusion

This project is based on voice control, using commands you could control your appliances but with this device, you can do more than that so keep in touch with me.