Intro: Light-Controlled Blinds
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!
- 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
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.
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.
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!
Second Prize in the