Bluetooth Voice Control

SRJT08304

Jugaadu decides to throw the birthday party at his home. He invites all his friends. Jugaadu is looking for arranging an Advanced disc floor to dance all night. He wanted to have a good birthday party memory. He didn't want to hire any DJ but wants to create multiple lighting effects using an Advanced lighting system. Let us help him for his birthday bash?

Bag Items:

  1. Arduino UNO UNO
  2. Jumper Wires
  3. USB Cable
  4. Foamsheet
  5. Battery and DC Jack
  6. Gluegun
  7. Bluetooth Module HC 05
  8. LEDs
  9. Cutter
  10. Breadboard
We can make a Bluetooth voice-controlled lighting system for the Disc. Like as when we say- Red On then Red lights will be on. Likewise, we can have multiple lighting effects which can be controlled by voice command.

    String voice; 
int yellow=2; 
int green=13; 
int blue=4; 
void yellowOn() { 
digitalWrite(yellow,HIGH); 
} 
void yellowOf() { 
digitalWrite(yellow,LOW); 
} 
void greenOn() { 
digitalWrite(green,HIGH); 
} 
void greenOf() { 
digitalWrite(green,LOW); 
} 
void blueOn() { 
digitalWrite(blue,HIGH); 
} 
void blueOf() { 
digitalWrite(blue,LOW); 
} 
void allon() { 
digitalWrite(blue,HIGH); 
digitalWrite(green,HIGH); 
digitalWrite(yellow,HIGH); 
} 
void allof() { 
digitalWrite(blue,LOW); 
digitalWrite(green,LOW); 
digitalWrite(yellow,LOW); 
} 

void setup(){ 
Serial.begin(9600); 
pinMode(yellow,OUTPUT); 
pinMode(green,OUTPUT); 
pinMode(blue,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=="on" || voice=="all") 
{ 
allon(); 
} 
else if(voice=="of" || voice=="all of") 
{ 
allof(); 
} 
else if(voice=="yellow" || voice=="yellow on") 
{ 
yellowOn(); 
} 
else if(voice=="yellow of") 
{ 
yellowOf(); 
} 
else if(voice=="green" || voice=="green on") 
{ 
greenOn(); 
} 
else if(voice=="green of") 
{ 
greenOf(); 
} 
else if(voice=="blue" || voice=="blue on") 
{ 
blueOn(); 
} 
else if(voice=="blue of") 
{ 
blueOf(); 
} 
voice=""; 
} 

}