CHINMAYMANDAVE1779
Published © GPL3+

Bluetooth via Voice Controlling of Switching LEDs

First steps towards home automation. (Setting up Bluetooth and voice controls.)

IntermediateFull instructions provided1,395
Bluetooth via Voice Controlling of Switching LEDs

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×10
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 221 ohm
Resistor 221 ohm
×2
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1

Software apps and online services

Arduino Bluetooth Voice ControlleR

Story

Read more

Schematics

CIRCUIT DIAGRAM

Code

CODING

C/C++
#include <SoftwareSerial.h>
String value;
int TxD = 11;
int RxD = 10;
int servoposition;
SoftwareSerial bluetooth(TxD, RxD);

void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  Serial.begin(9600);       // start serial communication at 9600bps
  bluetooth.begin(9600);
}

void loop() {
  Serial.println(value);
 if (bluetooth.available())
   {
    value = bluetooth.readString();

    if (value == "all LED turn on"){
    digitalWrite(2, HIGH);
    digitalWrite(3, HIGH);  
      }

    if (value == "all LED turn off"){
      digitalWrite(2, LOW); 
      digitalWrite(3, LOW);       
      }

    if (value == "turn on Red LED"){
    digitalWrite(2, HIGH); 
      }

    if (value == "turn on green LED"){
      digitalWrite(3, HIGH);       
      }
      
    if (value == "turn off red LED"){
    digitalWrite(2, LOW); 
      }

    if (value == "turn off green LED"){
      digitalWrite(3, LOW);       
      }

 }

}

Credits

CHINMAYMANDAVE1779

CHINMAYMANDAVE1779

1 project • 0 followers

Comments