Gabriel Alejandro Giraldo Santiago
Published © GPL3+

Simulation of a Domotic System of Lights

We are going to build a scale model to demonstrate the operation of light control through Bluetooth with Arduino.

BeginnerFull instructions provided2 hours1,813
Simulation of a Domotic System of Lights

Things used in this project

Story

Read more

Custom parts and enclosures

Blueprints

Example of Blueprints

Schematics

Blueprints

Blueprints 1

Blueprints 2

Code

CODE

C/C++
void setup() {
Serial.begin(9600);
pinMode(8, OUTPUT);// put your setup code here, to run once:
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
 
void loop() {
  // put your main code here, to run repeatedly:
 if(Serial.available()>0)
   {     
      char data= Serial.read(); // reading the data received from the bluetooth module
      switch(data)
      {
        case 'a': digitalWrite(8, HIGH);break; // when a is pressed on the app on your smart phone
        case 'b': digitalWrite(8, LOW);break; // when d is pressed on the app on your smart phone
        default : break;
      }
      Serial.println(data);
   }
   delay(50);

 if(Serial.available()>0)
   {     
      char data= Serial.read(); // reading the data received from the bluetooth module
      switch(data)
      {
        case 'c': digitalWrite(9, HIGH);break; // when a is pressed on the app on your smart phone
        case 'd': digitalWrite(9, LOW);break; // when d is pressed on the app on your smart phone
        default : break;
      }
      Serial.println(data);
   }
   delay(50);

 if(Serial.available()>0)
   {     
      char data= Serial.read(); // reading the data received from the bluetooth module
      switch(data)
      {
        case 'e': digitalWrite(10, HIGH);break; // when a is pressed on the app on your smart phone
        case 'f': digitalWrite(10, LOW);break; // when d is pressed on the app on your smart phone
        default : break;
      }
      Serial.println(data);
   }
   delay(50);

 if(Serial.available()>0)
   {     
      char data= Serial.read(); // reading the data received from the bluetooth module
      switch(data)
      {
        case 'g': digitalWrite(11, HIGH);break; // when a is pressed on the app on your smart phone
        case 'h': digitalWrite(11, LOW);break; // when d is pressed on the app on your smart phone
        default : break;
      }
      Serial.println(data);
   }
   delay(50);
}

Credits

Gabriel Alejandro Giraldo Santiago

Gabriel Alejandro Giraldo Santiago

11 projects • 82 followers
I am a young boy with ideal to achieve everything that I propose. Lover of Science, Technology and innovation.

Comments