100% found this document useful (1 vote)
1K views3 pages

Curtains Project Report

The document describes an intelligent curtains project that uses an Arduino, motor shield, stepper motor, light dependent resistor (LDR), and other components to automatically open and close curtains based on light intensity. The curtains will open when the Arduino reads an input lower than 235 units from the LDR, indicating daylight, and will close when it reads over 320 units, indicating nighttime. The code controls the stepper motor's direction and speed to open or close the curtains based on the LDR sensor values compared to pre-set light level thresholds.

Uploaded by

Mahmoud Alasmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views3 pages

Curtains Project Report

The document describes an intelligent curtains project that uses an Arduino, motor shield, stepper motor, light dependent resistor (LDR), and other components to automatically open and close curtains based on light intensity. The curtains will open when the Arduino reads an input lower than 235 units from the LDR, indicating daylight, and will close when it reads over 320 units, indicating nighttime. The code controls the stepper motor's direction and speed to open or close the curtains based on the LDR sensor values compared to pre-set light level thresholds.

Uploaded by

Mahmoud Alasmar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

01/08/2017

IntelligentCurtainsProject

Objective:
Thepurposeoftheprojectistobuildacurtainthatisstimulatedbytheintensityof
thelight.Thecurtainwillbecontrolledbyamotor,atthedaytimethemotorwill
openthecurtainandatnightitwillbeclosed.

Equipment:
- ArduinoUNO
- MotorShield
- StepperMotor
- LDRphotoresistor
- 1kand10ohmresistance
- LED
- Wires

Details:

Inourprojectthestandardunits(voltages)forLEDlightatdaylightandmoonlightare
235(1.14V)and320(1.56V)respectively.Whenthearduinoreadsaninputunitlower
than310,itwillsendsquarewavewithspecificdutycycle(speed)tooperatethe
steppermotorandopenthecurtain,ontheotherhand,itwillsendsignaltooperate
themotortoclosethecurtainiftheinputishigherthan350.

Code:
#include<AFMotor.h>//neededlibrarytocontrolsteppermotor
intldr=A0;//setanaloginputpin
intsensorValue;
inti=0;
intj=0;

AF_Steppermotor1(48,1);//setportofthesteppermotorand#ofrevolutionsper
minute

voidsetup(){
Serial.begin(9600);
pinMode(A0,INPUT);

voidloop(){
motor1.setSpeed(0);//setinitialspeedofthemotor


//readthevaluefromthesensor:
sensorValue=analogRead(ldr);//readtheanaloginput
Serial.print(sensorValue);
Serial.print("");
Serial.print(i);

if(sensorValue<235&&i<1){
motor1.setSpeed(700);//setthespeedofthemotor
motor1.step(48*150,FORWARD,DOUBLE);//set#ofstepsperrevolution,direction
andnumberofcoilsneededtobeused
i++;
j=0;
}

if(sensorValue>320&&j<1){
motor1.setSpeed(700);
motor1.step(48*150,BACKWARD,DOUBLE);
j++;
i=0;
}
}

You might also like