Sunday, May 1, 2011

LED Lighting Control for Bookcase

A little while ago, I decided that I wanted to add some lighting control to my bookcase.  Now, this bookcase isn't for books (ironic huh?), instead, it is used for holding our DVDs.  We have a little over 500 DVDs and growing but the problem is that it is difficult to find a movie to watch.  To add to the frustration, the bookcase isn't exactly designed for movies and allows very little light into the cubes.


The case and an exploded view
When I decided to add lighting control to this case, I quickly realized that I didn't just want white lights that I could adjust the brightness on.  I wanted full color lights with the ability to change each color intensity and the light brightness.  After some research, the TLC5940 lighting controller turned up as being the most cost-effective way of controlling so many lights.  The 5940 will control 16 channels through PWM and allow them to be controlled by an Arduino.  For the LED lights, I decided that RGB LEDs would be the way to go this way I could adjust the Red, Green and Blue intensity levels individually to give me a wide range of color options.  If I wanted to theme the case for Halloween, I could adjust the controllers to make an orange glow.  For other holidays I could do other colors as well.  What I'll need, is 3 TLC5940s, and Arduino board, and 3 potentiometers to control the chips.  I don't want the lights to be on all the time, so I'll add a range finder that only turns the lights on when I get close enough to the bookcase.  Additionally, I want to be able to control the lights in each cube when I reach in for a DVD.  I'll be adding motion detectors in each cube. Once the motion detector triggers, that particular cube will turn to a bright white, and the other cubes will fade down to around 30% or so light-intensity.


Now, I have the circuit done for the standard lighting controller and the potentiometers using the Arduino.  I will start working on the motion detection system soon, then adding on the functionality of the range finder.  One thing I'm still up in the air on, is whether I should add some sort of push-button that adds time for the lights to stay on, or if I should just keep the lights on for one minute or so.


Here is what I am thinking that the final controller box will look like.  The top two rows of gold pins will go to each cube's light strip. The next two rows of pins will go to each cube's motion sensor.  The last row (with the five pins) will be for the potentiometer controller.  Also, the TLC5940s will be on the first three shelves inside the controller with the minimum Arduino circuit (think boarduino)  on the bottom shelf.  


The lighting controller (the brains)
I can't forget to give credit to some very smart individuals for helping me along with this project, either directly or indirectly.  First is to Alex Leone. He created the library files for the TLC5940s and also made several example sketches.  He has also been very helpful to me when I emailed him asking for some advice.  Next is jmsaavedra who posted an Instructable on how to make a Perfoard Hackduino.  This is great because it will allow me to build the controller board for my lights much smaller and cheaper than having to buy a pre-built one. Here is the link to his Instructable.

If you would like to see the code that I have already done (the basic lighting control using potentiometers) please feel free to contact me and I will gladly help you out.

No comments:

Post a Comment