Light Reactive Curtain

by Danger is my middle name in Living > Decorating

10432 Views, 44 Favorites, 0 Comments

Light Reactive Curtain

5687356265_aa921e0054.jpg
5687921114_9932b68773.jpg
For the last project of the semester in my  Craft and Computing class, we had to make a family of items that fulfilled some need that people have.  My team partner and I are all about self expression and so we decided we wanted to make something artistic to help people express themselves in some way.  Since we live in dorms, we are not allowed to do very many things to our rooms as far as decorating and painting and things, so we decided to make some cool things people could use in their dorms.

One of those things was a light reactive curtain for a window.  When the curtain senses that there is light outside, the servo pulls the curtain up to let more light into the room and it closes when it is dark outside.

Materials:

-Fabric
-Arduino Uno
-Curtatin rod
-Wire (and spool)
-Foam core
-Zipties
-Hot glue

Sew the Curtain

5687922018_d9c2d856fb.jpg
5687354511_01f7e00e17.jpg
5687355589_d57bc52184.jpg
5687923012_680e6dfbfa.jpg
5687922666_af0a69efc7.jpg
First, we sewed the curtain.  You can really make your curtain any kind you want.  We found some pretty, sheer, sparkly, green fabric, which was awesome, but we also wanted the curtain to not be see through so we added a layer of black fabric to the back.  
I sewed the short edges of both fabrics together and hemmed the other sides so there would be no loose threads.  I then sewed a channel at the top for a curtain rod to go through.  Finally, I sewed two seams down the center of the curtain about half an inch apart for a cord to go through and pull the curtain open.

Mechanism

5687923692_b073c551bf.jpg
5687367687_2eba1ab334.jpg
5687367877_57538590f7.jpg
5687367971_afb7c30c92.jpg
5687370153_c7fe6b061b.jpg
5687361689_5d72b8efb8.jpg
5687936224_895357938b.jpg
5687938716_24439c3604.jpg
5687938556_e5cf1934ba.jpg
5687361495_b4f20dfdf7.jpg
5687361273_49a488d014.jpg
5687361051_1771006e4e.jpg
5687925848_f25bc83af1.jpg
5687371545_14c3e7db21.jpg
5687371297_bf7262aeaf.jpg
5687371063_269f52fcac.jpg
5687939002_636ee896cd.jpg
5687927310_80cf02e8d8.jpg
To open and close the curtain, we ran a wire through the channel in the center of the curtain and attached a Popsicle stick to the bottom so that the wire wouldn't be pulled out.  We opted for a a wire instead of a string or cord because the wire is smooth and therefore able to gather the curtain up with minimal friction.

We hacked a servo so that it was able to rotate completely, made a box out of foam core to house our electronics, and made a hole in one side so that most of the servo was inside the box with just the part that rotates sticking out.  We attached a spool to wind the wire onto the servo, then attached the whole box to the hanger that we used to demonstrate our curtain.

Circuit

servo circuit.jpg
5687357171_f6b260788d.jpg
5687356665_7eb5c2d75e.jpg
5687925212_dff54f25d1.jpg
5687951468_ede6ff8e7a.jpg
5687937476_d84655831c.jpg
5687937072_a3e02964f2.jpg
5687368787_6053604e23.jpg
5687368353_03319877b3.jpg
We used an Arduino Uno to control our sensor and servo. The circuit and circuit are shown below. You will have to adjust the delay in the code based on your servo and the length of your curtain, and the light threshold based on your location.

#include <Servo.h>

Servo myservo; // create servo object to control a servo

int lightPin = 0; // analog pin used to connect the photoresistor
int ledPin = 11; //analog pin to connect to LED


void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
pinMode(ledPin, OUTPUT); //sets the led pin to output
Serial.begin(9600);
}

void loop()
{
int threshold = 400; //400 for classroom, 100 for bedroom/dorm
int lightLevel = analogRead(lightPin);
Serial.println(lightLevel);

if (lightLevel>threshold){ //if it sees light (light=high resistance, dark = low resistance)
myservo.write(180);//forward
//digitalWrite(ledPin, HIGH);
delay (5000); //spin servo for 5 sec
while (analogRead(lightPin)>threshold){ //while light is still above threshold
// digitalWrite(ledPin, LOW);
myservo.write(87); //do nothing (no movement)
delay(10);
}

}else{ //if it sees no light
myservo.write(0); //reverse
// digitalWrite(ledPin, HIGH);
delay (5000);//spin servo for 5 sec
while (analogRead(lightPin)<threshold){ //while light is still below threshold
//digitalWrite(ledPin, LOW);
myservo.write(87); //do nothing (no movement)
delay(10);
}
}
}


Awesome Curtain

5687353739_7225a6a478.jpg
5687356265_aa921e0054.jpg
5687921114_9932b68773.jpg
Our curtain ended up working remarkably well!  One problem is that the code has to be re calibrated if you move the curtain into different lighting conditions, but if this were to just be hanging in a window as an actual curtain, that would not be a problem.
Video coming soon!