RGB light project questions
Jason Hickner
Posts: 21
Hello!
I'm putting together an RGB light that needs a bit more brightness than standard low-voltage LEDs can provide. I've been looking at using a group of red, green and blue luxeon 1watt or 3watt LEDs together to create an RGB light.
The problem is controlling the relative brightness of the 3 LED groups. The propeller doesn't have the voltage or current to drive the LEDs, so I need to use some sort of intermediary driver with its own voltage source. I'm not sure what sort of device I should be looking for, though. I'd like to be able to control each of the 3 channels (R, G, independently.
I've run across some LED dimmers that use a potentiometer to adjust brightness via PWM, and I've thought about trying to use three of those with the pots replaced with digital resistors, but I'm not sure how quickly the resistors can be adjusted (fast enough for smooth lighting transitions?) and besides it seems like there must be an easier way.
Any ideas or suggestions would be very much appreciated. Thank you!
- Jason
I'm putting together an RGB light that needs a bit more brightness than standard low-voltage LEDs can provide. I've been looking at using a group of red, green and blue luxeon 1watt or 3watt LEDs together to create an RGB light.
The problem is controlling the relative brightness of the 3 LED groups. The propeller doesn't have the voltage or current to drive the LEDs, so I need to use some sort of intermediary driver with its own voltage source. I'm not sure what sort of device I should be looking for, though. I'd like to be able to control each of the 3 channels (R, G, independently.
I've run across some LED dimmers that use a potentiometer to adjust brightness via PWM, and I've thought about trying to use three of those with the pots replaced with digital resistors, but I'm not sure how quickly the resistors can be adjusted (fast enough for smooth lighting transitions?) and besides it seems like there must be an easier way.
Any ideas or suggestions would be very much appreciated. Thank you!
- Jason
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
http://focus.ti.com/docs/prod/folders/print/tps61081.html
and I think this pdf shows how to connect it to a pwm signal (in their wled example).
http://focus.ti.com/lit/an/slyt279/slyt279.pdf
- Jason
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Jason
www.pr0jects.com
If you've got more time on your hands to experiment than money for expensive driver pucks, here's a circuit that takes a PWM input (from a Propeller counter or a software PWM routine), filters it to a voltage, and uses that to control the LED current. With the possible exception of the inductor, you can probably build it from stuff you have on hand:
R1, R2, and C1 form a filter and voltage divider which is used to feed the positive input of a comparator. The negative input is fed by feedback from a half-ohm current sense resistor on the MOSFET driver's source. The comparator will act in such a way as to keep the voltage on its two input pins equal. Resistors R3 and R4 establish a hysteresis band for the comparator. Without hysteresis, and if the comparator were replaced with an op-amp, the MOSFET would be operating in its linear region and overheating. But we don't want that. In the configuration shown, the comparator will oscillate, and the MOSFET will always be either fully on or fully off. The peak-to-peak current ripple will depend on the ratio of R3 to R4. The frequency will be determined by R3, R4, and L1. These values should be adjusted for a frequency around 20kHz. Any lower than that, and you'll be able to hear it squeal. (I'm guessing at a value for L1 around 270µH to start with. That's a wild guess, though.)
You will need to breadboard this with a dummy load so you can fiddle with the values without hosing your expensive LEDs. I haven't actually tried this particular circuit, but I've used circuits that are similar to it.
Good luck!
-Phil
This is what I'm doing for the ybox2 project. I've attached the code for this module, but it should be pretty easy to figure out. If you need it to go slower, you just need to add a delay at the start of the assembly loop.
Sorry if this code is kinda ugly. It's a work in progress for cog that will handle the tri-color led, the speaker, and also act as a watchdog if the button is pressed for longer than 5 seconds. Obviously, you only care about the former. But I'm too lazy/busy to edit it right now.
Values go from 0-255.
This concept could easily be scaled to handle as many duty-cycled pins as you need.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
—
darco
www.deepdarc.com/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 12/6/2007 2:17:23 AM GMT
It should be noted that the NCO and PLL outputs all have a 50% duty cycle. To get an adjustable duty cycle at a reasonable, constant switching frequency, you have to do it in software.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
—
darco
www.deepdarc.com/