Tuesday, February 16, 2010

Arduino Controlled Electric Blinds

This next project wasn't so much to save energy, as it was something interesting to add to the house. The blinds in out kitchen are always left open into the night, and everyone in the house uses the lights in the morning instead of the natural sunlight. I decided it might be a cool project to under take, and make the blinds automatically open in the morning and close at night. Along with that, I included a push button to open and close them as we please.



The first and most important part of this project is the Arduino micro-controller. It is a popular, open source, platform and there are tons of programming and project examples out there. I picked up mine from Spark Fun, along with a usb programming board.



The Arduino micro-controller works great with the USB programming board, however $30 was a little to much money for me to just stick in a little black box. Luckily all you need to use the micro by itself is a 16MHz oscillator, and two 22pF capacitors. A good guide to breadboarding a stand alone Arduino can be found here.

For the first part of the program, I concentrated on was controlling the blinds with the push of a button. For this you will to be able to read a push button signal with one of the digital inputs on the Arduino. In the program, I set a flag so that I know whether or not the blinds have been opened or closed and have set up 2 digital outputs. When the button is pressed, depending on the open/close flag, the outputs go from both low, to one high for a specified time (however long it takes for blinds to open), then back to both low. Once the blinds are then opened, and the button is pressed again, the output that stayed low last time goes high, and the output that went high stays low. It does this for the set amount of time again, then sets both low, waiting for another button press.



In order for these outputs to control the motors, we need to somehow get the 3.3v, small current signal from the micro, to operate the 5v, larger current motors. To do this, I took the 2 outputs from the Arduino, and ran them into 2 separate Darlington opto isolators. Because we used a 3.3v regulator, we can still hook onto the 5v source in order to control the h bridge and both of the motors. The 3.3 volt signals from the Ardunio outputs, go into the opto isolators which control the 5v that controls the h-bridge, which in turn controls the motors.

When one Arduino output is 5v and the other 0v, the motors turn on and go forward. When the outputs are switched around, the first being 0v and second 5v, the motor goes backwards. When both outputs are 0v, the motor is turned off and does not move.



The great 5v geared motors are perfect for opening and closing the blinds. They have a plastic shaft which can have a hole drilled through for connecting to the blinds. They are easily mounted with the mounting brackets from Solarbotics. I was able to rig up a mount from materials I had around the house, but you can get some materials from your setup at the local hardware store.



Now that we are able to control the motors with the push button, we need to be able to control them with light, or the absence of. To measure the light, I picked up a Light Dependent Resistor (LDR) which can be used with the Arduino analog to digital converter (ADC). Combining the LDR with another 10k resistor in a voltage divider, the ADC reads takes a reading of 3.3v= 1023, and 0v=0. You will have to fiddle around with the actual values from when the sun goes up and down, so that your blinds open and close at the correct time.



Once all these parts are on a breadboard and are working correctly together, you are able to put them all on a circuit prototype board that can fir inside a project box. In the picture of mine, the red and brown wires are going to the LDR, the blue wires to the motors, and the black wires to the power adapter. Because the blinds will open or close any time the push button is pressed, this could cause a minor problem if you have the program open and close the blinds every time the light goes from light to dark or vice versa. Say it is light out, the blinds are open, and you would like to close them. If you leave them closed, then when it becomes dark out again, the micro will sense to close the blinds, only they will open because it will do the opposite action as the last time. You need to compensate for this in your program, which included at the bottom of this post





Parts list
Two Solarbotics GM3 Gear Motors - $5.75 each
Two Gear motor mounting brackets - $1.35 each
Arduino USB Programming Board - $29.95
Atmega328 w/ arduino bootloader - $5.50
28 pin Dip socket - $1.50
Two 22pf resistors - $0.25 each
16MHz crystal oscillator - $1.50
H bridge motor driver - $2.35
Pushbutton - $0.95
3.3v regulator - $1.95
Light Sensitive Resistor - $1.35
5v power supply - $5.95
DC power jack connector - $1.25
Two Opto Isolators - $1.25 each
Prototype circuit board
Project Box

Arduino Light Sensitive Blinds Code


Schematic

7 comments:

  1. How do you mount the Gear Motor bracket - the black thing on the blind ?

    ReplyDelete
  2. I found your website perfect for my needs. It contains wonderful and helpful posts. I have read most of them and got a lot from them. Integral Window Blinds

    ReplyDelete
  3. The installation of your Electric blinds were new to me. It just like simple and yet complicated. Anyway, I found this good for energy saving. Keep posting.

    ReplyDelete
  4. What's the difference between these geared motors or a servo? Trying to understand the difference. These appear to be very similar to servos, but I think a servo would run directly off the 3.3v and would be capable of operating the blinds crank.

    ReplyDelete
  5. Hi guys! Let me take a minute of your time.
    Our young startup has developed a revolutionary product for automation of existing window blinds. It is Wi-Fi and ZigBee enabled. We have launched a Pre-Order campaign today - please like, share and contribute!
    Check out the link below: http://bit.ly/1bkbCHh

    ReplyDelete
  6. The article written is really great and informative. will be looking further for these type of posts. Thanks.
    Motorized Blinds UAE

    ReplyDelete