Cell-Controlled Room

Cell-Controlled Room © GPL3+

We made a room, where the lights are controlled either by cell phone via Bluetooth or the manual switch.

  • 997 views
  • 11 comments
  • 40 respects

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)
09507 01
Soldering iron (generic)
98h3029 30
Tip Tinner/Cleaner, Lead-Free

Apps and online services

About this project

Aiming at day-to-day comfort, we made a model of low-cost automation.

Code

robotic room automationArduino
int comando;
unsigned long mil = 0;
bool estado;
void setup(){
  Serial.begin(9600);
  pinMode(8,OUTPUT); // Tomada tv           A 
  pinMode(9,OUTPUT); // Luz 1               B
  pinMode(10,OUTPUT);// Luz 2               C
  pinMode(11,OUTPUT);// Tomada ventilador   D
                     // Geral               Z
  pinMode(7,OUTPUT); // 5V bluetooth 
  pinMode(6,OUTPUT); 
  pinMode(5,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(3,OUTPUT);                                 
  for(int i=7;i<=11;i++)digitalWrite(i,1);//DESLIGAR TODOS OS RELES
                    
}

void loop() {
  
 if(Serial.available()>0){
   mil = millis();
   comando = Serial.read();
   Serial.println(Serial.read());
   if(comando =='w')
   {
    estado = 1;
   }
 }
  if(estado == 1){
   digitalWrite(3,HIGH);
   digitalWrite(4,LOW);
  }
  else {
  digitalWrite(3,LOW);
  digitalWrite(4,HIGH);
  }
if(millis()-mil > 1000){
  estado = 0;
}
  
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
//porta 
      if(comando=='a'){
        digitalWrite(11,HIGH); //DESLIGAR
        analogWrite(5,50); //LIGAR
        digitalWrite(6,LOW); //DESLIGAR
        }
      if(comando=='A'){
        digitalWrite(11,LOW); //LIGAR
        digitalWrite(5,LOW); //DESLIGAR
        analogWrite(6,50); //LIGAR
        }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     
//LAMPADA 1
      if(comando=='b'){
        digitalWrite(10,HIGH); //DESLIGAR
        }
      if(comando=='B'){
        digitalWrite(10,LOW); //LIGAR
        }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
//TOMADA 2
      if(comando=='c'){
        digitalWrite(9,HIGH); //DESLIGAR
        }
      if(comando=='C'){
        digitalWrite(9,LOW); //LIGAR
        }
////////////////////////////////////////////////////////////////////////////////////////////////////////////        
//TOMADA VENTILADOR
      if(comando=='d'){
        digitalWrite(8,HIGH); //DESLIGAR        
        }
      if(comando=='D'){
        digitalWrite(8,LOW); //LIGAR
        }
        
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  //DESLIGAR TUDO GERAL
  if(comando=='z'){
        digitalWrite(11,HIGH); //DESLIGAR
        digitalWrite(10,HIGH); //DESLIGAR
        digitalWrite(9,HIGH); //DESLIGAR
        digitalWrite(8,HIGH); //DESLIGAR        

        }
        if(comando=='Z'){
        digitalWrite(11,LOW); //LIGAR
        digitalWrite(10,LOW); //LIGAR
        digitalWrite(9,LOW); //LIGAR
        digitalWrite(8,LOW); //LIGAR
        }

}

Schematics

electric circuit
Bluetooth hc-05
4 channel relay
Arduino one
12v power supply
Led rgb
1 680ohms resistor
1 resistor 1 k
1 resistor 2k
jumper
Circuito sala1 e9pfvmiekn

Comments

Similar projects you might like

Home Automation with Arduino Uno and SmartEdge Agile

Project tutorial by AYUSHMAN SAHA

  • 2,188 views
  • 0 comments
  • 4 respects

Customized Hotel Room

Project tutorial by Wen-Liang Lin

  • 1,819 views
  • 0 comments
  • 4 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 49,267 views
  • 22 comments
  • 141 respects

Health Kit: Humidity and Temperature Control

Project tutorial by Diana Khalipina

  • 9,164 views
  • 2 comments
  • 50 respects

Smart Living Room (Home Theatre)

Project showcase by Alex Warsun

  • 6,617 views
  • 3 comments
  • 22 respects

Bluetooth Controlled Home Light

Project showcase by Khaled Md. Saifullah and Shahadat Hossain Afridi

  • 2,941 views
  • 2 comments
  • 11 respects
Add projectSign up / Login