Light-Controlled Blinds

10,098

226

20

About: I'm studying biomedical engineering.

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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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!

Home Automation

Second Prize in the
Home Automation

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    20 Discussions

    None
    KyleL24

    1 year ago

    For some reason my outputs are not getting a voltage? My motor works and im getting 9 volts across ground and pin 4. I figured getting like should put 9 volts across 2-3 but nothing. Any idea?

    None
    maspinall

    2 years ago

    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.

    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

    None
    WaggaBob

    4 years ago

    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 "motor out of sync" issues.

    1 reply
    None
    b_elomarWaggaBob

    Reply 4 years ago on Introduction

    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.

    None
    diy_bloke

    4 years ago on Introduction

    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

    4 replies
    None
    diy_blokediy_bloke

    Reply 4 years ago on Introduction

    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

    None
    b_elomardiy_bloke

    Reply 4 years ago on Introduction

    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.

    None
    juan3

    4 years ago

    I love this project, now you can do the same for the curtains;)

    1 reply
    None
    b_elomarHussanAlesez

    Reply 4 years ago on Introduction

    It works because natural sunlight will always penetrate the blinds, and if calibrated correctly it will detect the sunlight.