HOME AUTOMATION WITH HC-05 BLUETOOTH APP || Minventions APP




HOME AUTOMATION WITH HC-05 BLUETOOTH APP





CIRCUIT DIAGRAM:




COMPONENTS REQUIRED:

1. ARDUINO UNO/NANO.
2. HC-05 BLUETOOTH MODULE.
3. RELAY BOARD ( 4 CHANNEL ).
4. JUMPER WIRES.
5. MOBILE .
6. MKINVENTIONS BLUETOOTH HOME AUTOMATION APP.



HOME AUTOMATION APP APK FILE:



SOURCE CODE:

//MKINVENTIONS MADHAN CHIRUGURI.
//HOME AUTOMATION WITH HC-05 BLUETOOTH MODULE.

char command; 

int LIGHT1  = 4;//LIGHT1
int LIGHT2  = 5;//LIGHT2
int LIGHT3  = 6;//LIGHT3
int LIGHT4  = 7;//LIGHT4

void setup() 
{       
  Serial.begin(9600); 

  pinMode(LIGHT1, OUTPUT);
  pinMode(LIGHT2, OUTPUT);
  pinMode(LIGHT3, OUTPUT);
  pinMode(LIGHT4, OUTPUT);
}

void loop(){
  if(Serial.available() > 0){ 
    command = Serial.read(); 

digitalWrite(LIGHT1, LOW);
digitalWrite(LIGHT2, LOW);
digitalWrite(LIGHT3, LOW);
digitalWrite(LIGHT4, LOW);

    switch(command){

    case 'A':  //LIGHT1 ON 
      digitalWrite(LIGHT1, HIGH);
      break;
      
    case 'a':  //LIGHT1 OFF
      digitalWrite(LIGHT1, LOW);
      break;


    case 'B':  //LIGHT2 ON 
      digitalWrite(LIGHT2, HIGH);
      break;
      
    case 'b':  //LIGHT2 OFF
      digitalWrite(LIGHT2, LOW);
      break;


     case 'C':  //LIGHT3 ON 
      digitalWrite(LIGHT3, HIGH);
      break;
      
    case 'c':  //LIGHT3 OFF
      digitalWrite(LIGHT3, LOW);
      break;   


    case 'D':  //LIGHT4 ON 
      digitalWrite(LIGHT4, HIGH);
      break;
      
    case 'd':  //LIGHT4 OFF
      digitalWrite(LIGHT4, LOW);
      break;     

         }
  }
  } 

Post a Comment

0 Comments