Energy is being wasted around the World. With our project we are mainly focusing on the lighting used in building, airports, and virtually evey closed space where light must be on during daytime.
We believe that these infrastructures could reducing their energy consumption through regluting and adapting their interior lighting where the lighting would be reduced when there would be enough sunlight coming in, and increased when there wouldn't be enough to get to the optimum level of luminance.
we have finally made some noticeable progress in our project. After a lengthy discussion with our supervisor, he advised us to try and make a our concept work a single led, and guess what IT WORKS !
it took us some time but we eventually were able to figure it out. the pictures above and bellow show the circuit we built and used.
We also came up with the code which we will share soon on our next log.
We also started making the arduino program conected to the light sensor. The program we have recognize the intensity of ambient light and tells us if it is :
- Dark
- Light
- Luminous
- More luminous
- Very bright
We now have to deal with a mean to connect the LED strip to the arduino and modify our code to change the intensity of led light according to ambient light.
1st of all we decided to use a photoresistance in order to collect the ambiant light.
Furthermore we are using a led strip of 12V so we needed to put a transistor.
We followed the following scheme.
We add at this scheme the photoresistance.
If you want to create the same thing as we did follow the cable management.
2
2nd step : Code
int led = 9; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is int fadeAmount = 100000000; // how many points to fade the LED by int photocellPin = 0; // the cell and 10K pulldown are connected to a0 int photocellReading;
// the setup routine runs once when you press reset: void setup() { // declare pin 9 to be an output: pinMode(led, OUTPUT); Serial.begin(9600); }
// the loop routine runs over and over again forever: void loop() {
// set the brightness of pin 9: analogWrite(led, brightness);
// change the brightness for next time through the loop: brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade: if (brightness <= 0 || brightness >= 255) { fadeAmount = -fadeAmount;
photocellReading = analogRead(photocellPin); Serial.print("Analog reading = "); Serial.print(photocellReading); // the raw analog reading // We'll have a few threshholds, qualitatively determined