The goal of this project was to turn normal 2" wooden slat blinds blinds into "smart" blinds that open automatically during the day and close at night. There are two buttons that allow the blinds to temporarily open or close bypassing the light status. Additionally, a 433 Mhz RF receiver allows for manual control of the blinds if desired. A 433 Mhz transmitter is used in conjunction with a Raspberry Pi to enable smart phone control. There are many ways to do this more elegantly, but I wanted to use the parts and tools I had laying around. The result is a low-budget, extremely capable blind control system that looks terrible but works great!
Step 1: Step 1: Hardware Configuration
- Arduino Uno
- TowerPro MG945 servo (modified to be continuous) with servo horn
- some header wires and breadboard
- 433 mhz RF receiver from ebay
- 3 10K resistors
- 5v power supply
- 2 push buttons for temporary manual control
- aluminum strap
- 6 screws
- white paracord
- conical tube (small pill bottle would work fine). Using a bottle was nice because I could screw the servo horn to the servo through the lid of the tube making a secure connection.
- Wire the arduino, servo, RF receiver, and photoresistor as shown in the diagram.
- Bend aluminum strap to make a make a bracket. Attach servo directly to wall using screws.
- Drill a hole through the center of the tube lid allowing servo horn screw to pass through.
- Screw servo horn to lid from outside of the lid.
- Screw servo horn/lid to servo from inside of the lid.
- Drill two holes through the tube allowing paracord to pass through. You can add a couple of screws to the end of the tube to keep the paracord from slipping off.
- Attach 2 lengths of paracord to tube by passing each length of paracord through the corresponding open hole and tying a figure-8 knot.
- Attach the tube to the lid tightly so that it doesn't come unscrewed when the servo rotates.
- On the free ends of the paracord, tie a Taut-line hitch so you can easily adjust the tension/length. You could also use some carabiners if you want a more robust quick connect option
- Wrap the cords in opposite directions on the tube so that when the servo rotates one cord pulls and the other lengthens.
- Use long headers for the photoresistor and tape it to the window.
Note: the amount of required torque depends on your blinds. You may find you have to use a bigger servo and/or use a different mounting schema for bigger or older blinds. I used a command hook to help control the angle of the cords during winding. You can engineer this as much as your patience and wallet allows!
Step 2: Step 2: Arduino Code and Best Practices
Attached is the Arduino code.
The code is fairly straight forward. There is a loop that monitors the photoresistor. If the value goes under a certain threshold (500 in my case), it triggers a state changes. The state change triggers the loop which sets the servo parameters and rotates it. There is a delay at the end of the main loop to prevent the blinds from opening and closing constantly when the light is at a threshold value.
If a push button or RF signal is detected, another loop is initiated which continues until the opposite button RF command is detected. As with most code, it's hard to explain but easy to watch.
You can monitor what is happening in the serial monitor. It helps a lot when setting the photoresistor values for "day" and "night." If you find you need more or less sensitivity with your photoresistor, change the 10K resistor to one more suitable for your brightness. There are many great tutorials explaining how to choose the best resistor to use in conjunction with a photoresistor.
I borrowed heavily from ssshake. Thanks for the great code! His setup is much more sophisticated than mine and would recommend if you're looking for something more ambitious. Here is a link to his setup.
Note, during the first cycle of the loop it might detect a state change (depending on the light) and rotate the servo. This made it hard for me to get the initial cord wrapping figured out. Because I was too lazy to change the code if I was starting the system in the dark or daylight, I found it easiest to unplug the servo during the first cycle of the loop. This lets the code "stabilize" to whatever the current light status is. I hook up the pull cords, plug the servo back in, and off it goes. During the testing, you can change the delay time at the end of loop so you don't have to wait for the blinds to be responsive again.