loading
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

Step 1: Sew the Curtain

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.

Step 2: Mechanism

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.

Step 3: Circuit

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);
}
}
}


Step 4: Awesome Curtain

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!
cool idea. thx for sharing
Danger is your middle name? Your making curtains, dude. I love the instructable though, very intuitive.
i think this might be a girl =D
My sincerest apologies my dear Madam. I do believe I was confused earlier but now believe to be in proper state. A good day to you as well as your colleagues, I do wish you the brightest (and according to the curtain, dimmest) of days.
Heheh, "dear Madam". I think that's the most formal Ms Danger's ever been addressed!
I have been called Madam before, actually, and by strangers (!). But that's another story...
I would love to hear it if you so please.
No chance of that on this website :P
Danger, as admin, don't make me have to flag you :)
Like I said, not saying anything here &lt;.&lt; &gt;.&gt;
Well, thanks?! But men can make curtains too, ya know! Feminism and all that stuff!
I noticed you where a girl not because you where making curtains but because of your beautiful feminine hands in some of the pictures
Yes, I am a lady, haha. If it were a man making curtains that would be awesome, too. Guys who have crafting skills are hot! haha :)
wow, um i know nothing about what you just said :S what kind of classes would i need to take to understand if not make this? <br>will simple electronics work? <br>and what was the cost of the equipment? <br> <br>ps.. this is an awsome!!!!!!!!!! idea.. i would like to use it to keep a ceiling window closed during day and open at night. <br>can same principal be applyed accordingly?
I'm an engineering student, which probably helps, but I know of plenty of non-engineering students who have figured out basic circuitry and stuff. There are some instructables about it!<br>This basic principle could definitely be applied to a ceiling window, although your rig might be a bit more complicated. Let us know how it goes!
Probably the most expensive thing would be the arduino, and you can find most of the information about using that and the circuits online.
This is awesome! I'm definitely going to implement a version of this to keep those pesky floodlights from the apartment complex next door from keeping me awake. Thanks for the idea!
Post a picture and tell us how it goes!
Awesome as always! Arduino is always really fun.
Cool!

About This Instructable

9,596views

46favorites

License:

Bio: I'm just a lady who likes making stuff. I got my degree in engineering but also enjoy cooking, sewing, knitting, gardening and backpacking, among ... More »
More by Danger is my middle name:21 Travel Tips and Tricks 20 Before and After Transformations 33 DIY Power Supplies  
Add instructable to: