Description
I made 2 automatic curtains with--
a DC motor,
a rope,
an empty yogurt bottle,
a round piece of paperboard,
a curtain,
the Arduino board, bread board, batteries and resistors.
a force sensor/a photocell
AutoCurtain
To illustrate stepping on the sensor, here I use a slipper in stead of a rug in this picture
Automatic Curtain 1--
Every time when I want to stand at my French door to look out through it, or when I want to open the door to go to my little patio, I'll have to step on the mat in front of the door.
In this case, I put the force sensor under the mat in front of my door. When I step on the mat, the curtain will be automatically drawn open.
Automatic Curtain 2--
I put my bed beside the window. Everyday in the morning I hope my curtain will open by itself so that the sunlight will wake me up. After I open my eyes on the bed, the first sight will be the beautiful sky!!
In this case, I use the photocell instead of the force sensor. Putting the entire set by my window, the photocell can detect sunlight and control the curtain.
My Code
/*
* one pot fades one motor
* modified version of AnalogInput
* by DojoDave <http://www.0j0.org>
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave and again by Aithne Sheng-Ying Pao
*/
int potPin = 0; // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}
My Video
http://www.youtube.com/profile?user=pillypao