Bluetooth controlled Light

 

Description

     Guys, we are going to control an LED light using your mobile phone.  The only thing you want to do is connect your smartphone with the Bluetooth Module and install an application for Bluetooth control. Okay, let's make it.

Click the below link to download the app


Components Required

 1. Arduino UNO    * 1
 2. Bluetooth Module(HC-06)   * 1
 3. LED(Any color)  * 1
4Jumper Wires
5Bread Board1

 

  

Circuit Diagram



Program

Complete your coding with the help of the Arduino ide. Upload program to your Arduino board makes sure that the Arduino port selection option is perfect. Avoid chance to get an error during uploading program to board

Click here to learn: "How to Upload your code to Arduino boards Without Error"

String state;
void setup() 
{
 pinMode(11,OUTPUT);
 Serial.begin(9600); 
}

void loop() 
{
  if(Serial.available())
  {                             
    state = Serial.readString();          
 }
 
 if (state == "OFF") 
 {
    digitalWrite(11,HIGH);
 } 
 
 if (state == "ON")
 {
 digitalWrite(11, LOW);
}
}