Intuitive Light

No more stubbing your toes on furniture in the dark.

Made by skokate

We all have stubbed our toe on tables and chairs while searching for the light switch in the dark. And many times we reach our bed and realize that we forgot to switch off the light and we are annoyed to get back up. Intuitive Light offers a clever solution to this problem. As the light coming from your window reduces and the ambient light becomes dull, the Intuitive Light switches on the light in your home so you are never in the dark. And when you go to sleep, the system detects your presence on the bed and switches off the main light and switches on the night lamp/light.

Created: January 28th, 2015

0

The sensor circuit uses a force sensor and a photo resistor. A motion sensor can also be used to switch on main light only when presence is detected, but it was beyond my scope for this project. So for now the light sensor detects ambient light and switches on the main light in the house when it starts getting dark. When person sits on the bed and activates the force sensor, the main light switches off and the night light switches on.

0
int L1 = A0; // brighter light in the room
int P = A1;  //force sensor detects whether person on bed or not
int R = A2;   // detects light near window
int L2 = A4;  // dim light or night light


int brightness=0;

void setup() {


   // the Spark cloud as 'brightness'
   Spark.variable("brightness", &brightness, INT);

   // Set up pin for output
    //declaring types of pins
    pinMode (L1, OUTPUT);
    pinMode (P, INPUT);
    pinMode (R, INPUT);
    pinMode (L2, OUTPUT);
 
}

void loop()


   
{
    //declaring integer values for readings from force sensor as well as photoresistor
    int vp= analogRead(P);
     brightness=analogRead(R);
    //logic for circuit
    if (vp<1000 && brightness<100)
    // if ambient light is low and no person in the bed switch on bright/main light
    { digitalWrite (L1,HIGH);
    }
    else if  (vp>1000 && brightness<100)
    //if ambient light is low and person present in the bed switch on dim/night light and switch off bright light
    { digitalWrite (L1,LOW);
    digitalWrite (L2, HIGH);
    }
    else
    //all other conditions both lights are off
    {
    digitalWrite (L1,LOW);
    digitalWrite (L2, LOW);
    }
}
Click to Expand
0
//trials for both sensors

int p= A1;
int l =A0;

void setup() {
    pinMode(l,OUTPUT);

}

void loop() {
    int val= analogRead(p);
    if(val>1000){
        digitalWrite(A0,HIGH);
    }
    else{
        digitalWrite(A0,LOW);
    }
   
}



//trial 2

int res= A2;
int l =A0;

void setup() {
    pinMode(l,OUTPUT);

}

void loop() {
    int val= analogRead(res);
    if(val>100){
        digitalWrite(A0,HIGH);
    }
    else{
        digitalWrite(A0,LOW);
    }
   
}
Click to Expand
0

Sources: For cover pic : http://fortikur.com/lumilove-night-light/lumilove-night-light-with-baby-sleeping/


x
Share this Project


About

We all have stubbed our toe on tables and chairs while searching for the light switch in the dark. And many times we reach our bed and realize that we forgot to switch off the light and we are annoyed to get back up. Intuitive Light offers a clever solution to this problem. As the light coming from your window reduces and the ambient light becomes dull, the Intuitive Light switches on the light in your home so you are never in the dark. And when you go to sleep, the system detects your presence on the bed and switches off the main light and switches on the night lamp/light.