Maker Pro
Maker Pro

RGB LED Control

dizwold

Nov 14, 2013
17
Joined
Nov 14, 2013
Messages
17
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?
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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?
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)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
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?
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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?
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)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The problem is not the circuit; it's defining what brightness you want from each of three colours, given a single-dimension control source.
The LED color for the higher voltage would be controlled by an inverted signal compared to the lower voltage LED color.
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.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
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
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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.
You are right.
Is it possible to change the colour of an rgb led from blue, green to red with voltage / a pot?
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.
 

BobK

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

Bob
 

Arouse1973

Adam
Dec 18, 2013
5,177
Joined
Dec 18, 2013
Messages
5,177
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.

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.
Adam
 

BobK

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

Bob
 

Arouse1973

Adam
Dec 18, 2013
5,177
Joined
Dec 18, 2013
Messages
5,177
I know this sounds pedantic but it's really important. Define change colour?
Adam
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Hi.
I just want to change the colour as the voltage is increased from 0v to 12v.

I've just found this page, and the tutorial on the LM3914 is a good possibility;

http://electronics.stackexchange.com/questions/53409/rgb-led-each-color-on-at-a-specific-voltage
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
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
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/
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
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:

example potentiometer to RGB mapping.png
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.
 

dizwold

Nov 14, 2013
17
Joined
Nov 14, 2013
Messages
17
@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.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
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
 

Arouse1973

Adam
Dec 18, 2013
5,177
Joined
Dec 18, 2013
Messages
5,177
See if this duty cycle spread sheet will help.
Adam
 

Attachments

  • DutyCycle.zip
    17.3 KB · Views: 87

Arouse1973

Adam
Dec 18, 2013
5,177
Joined
Dec 18, 2013
Messages
5,177
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

Oh yeah that's going to be nice
 
Top