# RGB LED Control

Discussion in 'LEDs and Optoelectronics' started by dizwold, Aug 19, 2014.

1. ### dizwold

17
1
Nov 14, 2013
Is it possible to change the colour of an rgb led from blue, green to red with voltage / a pot?

Im going to build a power supply, 0-12vdc with an illuminated knob on the pot.
I wish to change the colour from blue 0v through to red 12v, but don't really want to use a mcu to do this.

Is it feasible?

2. ### Gryd3

4,098
875
Jun 25, 2014
Yes it is, but not directly.

What kind of color scheme are you wanting?

(I'm thinking of using voltage to PWM, and/or comparators. sorry, no schematic)

3. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
You could probably use three variable current sources, but how would you define the mapping between a single-dimension control (a rotary or slider potentiometer) and three independent quantities? When you use a colour selector on your PC, there are three separate sliders; one for red, one for blue, and one for green. This allows you to select any colour that can possibly be displayed. How would you do this using a single control?

4. ### Gryd3

4,098
875
Jun 25, 2014
Lots of thinking and a dedicated circuit?
I was thinking a possible solution could be a couple voltage controlled PWM sources to control 2 of the 3 LEDs.
The LED color for the higher voltage would be controlled by an inverted signal compared to the lower voltage LED color. I'm just unsure how you could make an LED fade on, then fade off when provided a linear change in reference voltage from 0 to 12V. (This would be the color at 6VDC)

5. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
The problem is not the circuit; it's defining what brightness you want from each of three colours, given a single-dimension control source.
I don't understand. I thought he wants to control the red, green and blue intensities of a single RGB LED using a single potentiometer.

6. ### BobK

7,682
1,688
Jan 5, 2010
You can control something to go through the spectrum with a single control. It can then adjust only hue, not brightness or saturation. If the control went from 0 to 3V, it could work like this:

0 = red
>0 < 1 fade red to green
1 = green
> 1 < 2 fade green to blue
2 = blue
> 2 < 3 fade blue to red
3 = red again!

So for example, in the range 0 to 1V you would set the duty cycle of PWM for the red LED to 1 - v and the duty cycle for green to v. In the other two ranges, you would subtract the base of 2 or 3 and then do the same with the fade from / to colors.

For example, 1.3V: The range is green to blue. Subtract 1 to get 0.3, so the PWM signal for green is 70% and for blue is 30%.

Bob

7. ### Gryd3

4,098
875
Jun 25, 2014
You are right.
Seems OP wants Blue at 0V, Green at 6V, and Red at 12V.
It sounds pretty easy to have the Blue die fade off from 0V to 6V, and have the red ie fade on from 6V to 12V.. but I don't know where to begin having the green die fade on from 0-6, and off from 6-12.
Op has not stated exact function yet.

8. ### BobK

7,682
1,688
Jan 5, 2010
With a micro you can make them fade any way you want.

Bob

5,164
1,087
Dec 18, 2013
I agree it's not very clear. Does he want set stages when the LEDs are either on or off. Or does he want to fade in the colours? With an RGB LED you can have over 16 million shades of colour from the combination of different voltages. PWM is one way I can think of doing it.

17
1
Nov 14, 2013
11. ### BobK

7,682
1,688
Jan 5, 2010
Okay, I missed the part about not wanting to use a micro. Much more difficult without one.

Bob

5,164
1,087
Dec 18, 2013
I know this sounds pedantic but it's really important. Define change colour?

13. ### BobK

7,682
1,688
Jan 5, 2010
Change color could mean anything. You only said blue at 0V and red at 12V. What colors in between?

If you want it to fade from blue to read through all mixes of red and blue, that is fairly easy. If you want it to go from blue to green to red through all the colors of the rainbow, a little more difficult.

Bob

14. ### Gryd3

4,098
875
Jun 25, 2014
dizwold,
Take a look at the above posts. We are unsure if you want the hue to fade or if you want the color to instantly change when set to specific voltages.

The page you linked for us will turn the following colors:
Blue, Teal, then White.
The LEDs for that circuit are only turned on at specific voltages with a very small amount of fade/

15. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
No, I don't think the LM3914 will be useful at all.

Here's what you need to do. You need to show us a graph that specifies how the intensity for each of the colours (red, green and blue) changes as the control potentiometer is varied from one end to the other. Something like this:

I have no idea whether that's what you want or not, and I'm not suggesting it is. I'm just showing you how you need to specify your requirements before we can tell you how to achieve them.

16. ### dizwold

17
1
Nov 14, 2013
@Arouse1973. I want it to look pretty. LOL. I have the parts so why not.

Sorry for being vague.
Any colours really, but would prefer red to be at 12v.
May be light green, green, teal, blue, purple, red. That would then make increments of 2v.

5,164
1,087
Dec 18, 2013
Ok now we are talking.

18. ### BobK

7,682
1,688
Jan 5, 2010
So you want discrete colors for different voltage ranges:

0-2V = blue
2-4V = ?
4-6V = ?
6-8V = ?
8-10V = ?
10-12V = red

right?

edit: I think fading them would be more fun, and with a micro would much less hardware than the 6 ranges you want.

Bob

5,164
1,087
Dec 18, 2013
See if this duty cycle spread sheet will help.

File size:
17.3 KB
Views:
87