LED Strip + Arduino, desktop backlight project. - Page 1
Forum section: electronics / general

author: Mint.
author_rank: Frequent Contributor
timestamp: September 09, 2012, 12:06:15 am
content: I spend most of my time in front of my computer and therefore most of the time sitting in front of the desk. My current lighting consists of an ikea work lamp, which really isn't doing anything for me. I got the idea after looking around the internet for different computer setups that I can add an LED strip behind my desk to make it look more effective. I've had experience with LED strips before, we've already got one hooked up behind our TV with an LED controller from eBay. But what I want to really do is to try out something new and make some sort of software defined lighting for my work desk. My current setup is simply a macbook air connected to a thunderbolt display, which I just turn on an off using the mains switch. How I imagine it to be, is so:- Turn on mains switch which turns on display and macbook air.- Software on computer starts up and checks the time.- If it's evening then lights turn on slowly increasing brightness, if its not evening they stay turned off.- When I go to my computer I can open up the program and set different colours for the lighting.AND if that all works out I want to create a program which senses the music from my computer and flashes the LEDs according to the beat!Now I've got two weeks (holidays) to design and complete this project. The holidays are two weeks away. So all in all I got 4 weeks.I assume I will need an arduino and some kind of mosfet to do the switching for me as well as the actual LED strip.Does this seem like a do-able project?Where do I start?What should I order?

author: Rerouter
author_rank: Super Contributor
timestamp: September 09, 2012, 12:29:42 am
content: it is definatly doable but its not quite arduino sided software, though you could well do it that way, you would have 3 PWM channels for your strip, simple RGB, probably use the fast pwm code to get a bit better performance out of your code,as for the sound flashing to vastly simplify things, perhaps have the 4th PWM channel send a set point to a comparitor that measures your audio signal, and have that via transistors or signal mosfets pull down your PWM ourputs or feed into a logic input that halts your pwm loop when all 3 channels are off via a while condition, with the set point loop still operating, effectivly shortcutting a segment of code, equally you could have a LDR in a resistor divider to say whether its dark or not, as there is little point to the backlighting when your room is already bright, and have another comparitor trigger high or low for that (removes uncertainty of logic levels) probably trimmed by a trim pot, or instead have your 4th channel control this and the sound level fixed,now comes the nasty part, the software control, as serial reads and writes are quite slow operations compared to what the rest of your loop can do, and here i would probably be considering just what kind of performance hit your willing to take, as your lights would flicker as data is sent, in my own opinion i would implement a physical button to enable the serial comm part of your code with a time constant of about 1 minute, as the previous suggestions have removed all other serial functions than setting the levels, this should be fairly practical,being how you only really need to send 3 8 bit values , it should not be that hard to whip up a simple control panel in your favorite language, just make sure you assert some kind of start and stop code so that it only needs a new value every now and then in place of every cycle,equally however you send your values you will want to store it in the onboard eeprom, else it will reset on each power up,hope this has given you a starting point, you may still want to approach it your own way but this is how i would approach it to remove the serial part as much as possible :/