loading

Hey!

Don't you hate remembering to open or close your blinds? Or are you just lazy like me... Then this is the perfect Arduino project for you!

This Arduino project is designed to automatically open and close blinds by determining if it's day or night. A motor controls the blinds with the help of a photocell. All controlled by an Arduino!

Skills required:

  • Basic electronics
  • Basic programming with Arduino

NB In order to show that the Light-Controlled Blinds works, the demo above is illustrating day and night with a light switch.

Step 1: Parts

The parts that you will need for this project:

  • Arduino ($25)
  • Photocell ($1)
  • Full-Bridge Motor Driver Dual - L298N ($3)
  • DC Motor ($5)
  • 10k Ohm resistor ($0.25)
  • Breadboard and Wires ($5)
  • 9V Battery and Snap Connecter ($3)
  • USB Cable A to B ($4)
  • Wall Charger - 5V USB (1A) ($4)

Most of these parts can be ordered from Sparkfun etc.

Don't worry about the cost because you'll be able to use them in many more projects. Unless you like your Light-Controlled Blinds so much that you decide to use them as permanent installment!

Step 2: The Circuit

Power Supply
The Arduino Uno is powered by a 5V 1A wall charger. Therefore we use 5V to power the motor driver (L298N) and the photocell (LDR07). We use the 9V battery to power the motor. By powering the motor with 9V instead of 5V, we can take full advantage of the motor and its torque.

Connecting
Be aware that L298N must be inserted into the breadboard. As shown Fritzing wouldn't let me do that. As stated above, we supply the L298N with 5V, and therefore connect pin 9 to 5V from Arduino. Connect pin 1 and pin 15 to GND as those are CurrentSense (we don't need them). L298N can control two motors, and we only need one. Connect pin 8 to GND, and the output pins 2 and 3 to the DC motor. Remember to choose a suitable length for the motor wires! To supply the motor with 9V, connect pin 4 to the 9V battery.

Now for the Arduino control connect:
Pin 7 to pin 4 on Arduino
Pin 6 to pin 6 on Arduino (PWM)
Pin 5 to pin 5 on Arduino
LDR07 to pin A0 on Arduino

Step 3: The Code

Download the Arduino code below and run it. I have commented throughout the code to make modification easy. Some adjustments may be needed regarding light sensitivity, and open/close time for blinds.

Adjustable variables:
motorRunMillis: Time it takes for blinds to open
motorRunMillis2: Time it takes for blinds to close
photocellDark: Photocell reading to determine when it’s dark
speed: Speed of the motor

Test if the system is working by opening the Serial Monitor, and shade the photocell. The motor should be turning backwards when covered by your hand, and forward when your hand is removed.

Step 4: Installation

It's time to get creative! But first, put your breadboard, Arduino and 9V battery in a box to keep them safe. Make sure that there is a hole for the photocell and the USB cable.

The tricky part here is to make the motor rotate the shaft (that thing you normally rotate to open and close blinds). Find a piece of metal or a socket and glue it to the motor. It's important that the motor has a strong base, and not loosely attached. Stack a couple of boxes if necessary.

Congratulations! You got yourself Light-Controlled Blinds!

I hope you enjoy this project. I will be really grateful if you voted for me in the Home Automation Contest!

<p>Hahaha that opened and closed a lot faster than I was expecting! Love it! </p>
<p>Haha thanks!</p>
hey dude! thanks for your code! now I understand how to control LDR thanks!
No problem! Glad I could help!
<p>im a bit confused as the dc motor only has 2 terminals and depending what way the positive is determines the way the motor turns.</p><p>but this is not the case with this chip as it send on a positive on both switch terminals. meaning the dc motor wont turn without a negitive</p>
Could you use a servo instead of a DC motor? They can do a few turns and you can specify the exact start/stop position so there would be no &quot;motor out of sync&quot; issues.
<p>Unfortunately I didn't have a servo motor at the moment, so i used a DC motor instead. But you're right. Using a servo motor is a much better alternative.</p>
<p>beautiful project. There is a weakness. If for whatever reason the motor would only open or close the blinds half (say coz a temp loss of power) the motor is out of sync. It will think it needs to open or close the blinds full and keep going when it is already done. No doubt that will lead to some damage</p>
<p>perhaps it would be wise to store the motor position in EEPROM so in case of a power failure the setup can read the motor position and take it from there</p>
<p>It's my first time controlling a motor with Arduino, and i didn't think about that. But you're right, storing motor position in EEPROM is wiser in case of power loss.</p>
<p>nevertheless great project</p>
<p>Thanks!</p>
<p>I like this project, amazing idea</p>
<p>Thank you!</p>
I love this project, now you can do the same for the curtains;)
<p>Nothing is impossible! Will try to implement it on curtains some day :P</p>
<p>Brilliant work b_elomar, i really like your idea!</p>
<p>Thanks, I really appreciate it!</p>
Fake will no work... Once blind close sensor get no light
<p>It works because natural sunlight will always penetrate the blinds, and if calibrated correctly it will detect the sunlight.</p>

About This Instructable

8,475views

224favorites

License:

Bio: I'm studying biomedical engineering.
More by b_elomar:Light-Controlled Blinds 
Add instructable to: