Vaisakh1997Bonifaceshafeeque
Published © GPL3+

Control LEDs Using Arduino And Bluetooth

Arduino and Bluetooth modules control the LEDs. And we can replace these LEDs with relays so we can also control other appliances, too.

IntermediateShowcase (no instructions)1,895
Control LEDs Using Arduino And Bluetooth

Things used in this project

Schematics

Circuit diagram

connect the arduino and Bluetooth module as show in the picture

Code

arduino sketch

Arduino
upload the sketch into your arduino board
char junk;
String inputString="";

void setup()                    
{
 Serial.begin(9600);            
 pinMode(13, OUTPUT);
pinMode(10,OUTPUT);
pinMode(7,OUTPUT);
}

void loop()
{
  if(Serial.available()){
  while(Serial.available())
    {
      char inChar = (char)Serial.read(); 
      inputString += inChar;       
    }
    Serial.println(inputString);
    while (Serial.available() > 0)  
    {
 junk = Serial.read() ; 
}      
    if(inputString == "a")
{         
      digitalWrite(13, HIGH);  
    }
else if(inputString == "b")
{  
      digitalWrite(10, HIGH);
    }
else if(inputString == "c")
{  
      digitalWrite(7, HIGH);
    }
else if(inputString == "x")
{  
      digitalWrite(10, LOW);
 digitalWrite(13, LOW);
 digitalWrite(7, LOW);
    }
    inputString = "";
  }
}

Credits

Vaisakh1997

Vaisakh1997

2 projects • 14 followers
Boniface

Boniface

0 projects • 4 followers
shafeeque

shafeeque

0 projects • 5 followers
Thanks to Vaisakh.

Comments