Arduino Bluetooth Internet of Things IoT IoT Projects Videos

Control LED From Your Voice Command Using Arduino and HC-05 Bluetooth

What are you thinking about Controlling LED from your own voice command ?? When I heard about it I thought it would be very difficult project to controlling LED from Voice. If you are also feeling the same trust me it’s as easy as making cup of tea. So without wasting time let’s see How to Control LED from your Voice Command using Arduino and HC-05 Bluetooth module.

So to catch our voice command and process to Arduino board we need something right? To achieve this we have developed an Android App that is IoTBoys freely available on Google Play Store. So what does this IoTBoys App do ? Ok. The purpose of this application is to detect the voice command and pass through Serial Communication HC-05 to the Arduino Board. As we have written sketch below that will take care of all. Once you watch below video you will understand clearly.

Components you needed for Control LED From Your Voice Command Using Arduino and HC-05 Bluetooth:-

  1. Arduino Uno Board
  2. 1 x USB cable
  3. 1 x Bread Board
  4. 1 x Bluetooth (Module HC-05)
  5. 3 x LED (Red, Green, Blue)
  6. 4 x Jumper wire (Male to Male)
  7. 4 x Jumper wire (Male to Female)
  8. Android app IoTBoys Available in play store

Wiring Connection for Control LED From Your Voice Command Using Arduino and HC-05 Bluetooth:-

Note – You need to first unplug RX and TX connection from Arduino and then upload the below sketch else you may face uploading error.

Sketch/Source Code :-

String voice;
int RED = 2;
int GREEN = 3;
int BLUE = 4;
void RedOn(){
digitalWrite (RED, HIGH);
}
void RedOff(){
digitalWrite (RED, LOW);
}
void GreenOn(){
digitalWrite (GREEN, HIGH);
}
void GreenOff(){
digitalWrite (GREEN, LOW);
}
void BlueOn(){
digitalWrite (BLUE, HIGH);
}
void BlueOff(){
digitalWrite (BLUE, LOW);
}
void allon() {
digitalWrite (RED, HIGH);
digitalWrite (GREEN, HIGH);
digitalWrite (BLUE, HIGH);
}
void alloff() {
digitalWrite (RED, LOW);
digitalWrite (GREEN, LOW);
digitalWrite (BLUE, LOW);
}
void setup() {
Serial.begin(9600);
pinMode(RED, 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 == "off" || voice=="all off")
{
alloff() ;
}
else if(voice =="red" || voice =="red on"){
RedOn();
}
else if(voice =="red off"){
RedOff();
}
else if(voice =="green" || voice =="green on"){
GreenOn();
}
else if( voice =="green off" ){
GreenOff();
}
else if(voice =="blue" || voice =="blue on"){
BlueOn();
}
else if(voice =="blue off"){
BlueOff();
}
voice="";
}
}
Control LED From Your Voice Command Using Arduino and HC-05 Bluetooth

Home Automation Using Facebook Chat And Arduino ESP8266 WiFi Module

Voice Control Home Automation System Using Arduino and HC-05

How To Control Home Appliance From Internet Using Arduino and ESP8266

About the author

IoT Boys

IoT Boys

8 Comments

Click here to post a comment

Meet Our Team

Rajeev Ranjan Founder IoTBoys
Founder IoTBoys
Shambhoo kumar
Founder IoTBoys

Subscribe Us