Arduino control with using Android voice command


We will provide Arduino communication via bluetooth with the previously defined sentence commands in the Android application.

You can use this project in home automation systems.

For now we will use the ready-made application. In the following days I will publish a tutorial on creating an application. (Such as the application I created for a remote controlled car)

Hardware Required:

- Arduino Uno
- Bluetooth Module HC05 or 06
- LED
- 220 ohm Resistor
- Smartphone
- Wires
- Breadboard

Application :

BT Voice Control for Arduino
Created by SimpleLabsIN

You can find Google Play Store


Code :



String voice;

int led1 = 2;
int led2 = 3;
int led3 = 4;

void allon() {
  digitalWrite (led1, HIGH);
  digitalWrite (led2, HIGH);
  digitalWrite (led3, HIGH);
}

void alloff() {
  digitalWrite (led1, LOW);
  digitalWrite (led2, LOW);
  digitalWrite (led3, LOW);
}

void setup() {
  Serial.begin(9600);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, 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 == "*all on")
  {allon() ; }
  else if (voice == "*all off")
  {alloff() ; }
  
voice="";
}
}