RGB LED colour and brightness control

Thread Starter

kimdenton

Joined Feb 1, 2024
3
Thank you for all your responses. To explain the situation more I currently have an Arduino nano every. The final product will have 4 buttons that give a certain colour temperature and then a up/down button that will control the brightness on each colour temperature setting. The reason I don't want to use PWM for the brightness as well as the colour is because of the issues where one colour is set at a far lower level than the other eg RGB (20,20,1) if I wanted to reduce the overall brightness by 50% I would need to set the blue at either 0 or leave it at 1 which would change the colour mix.
 

Ya’akov

Joined Jan 27, 2019
10,259
Thank you for all your responses. To explain the situation more I currently have an Arduino nano every. The final product will have 4 buttons that give a certain colour temperature and then a up/down button that will control the brightness on each colour temperature setting. The reason I don't want to use PWM for the brightness as well as the colour is because of the issues where one colour is set at a far lower level than the other eg RGB (20,20,1) if I wanted to reduce the overall brightness by 50% I would need to set the blue at either 0 or leave it at 1 which would change the colour mix.
If you use the MCU and calculate the relative numbers for each emitter, you can account for both overall brightness (a terrible word, since it doesn’t really mean anything in particular, maybe ”perceptual brightness”) and color.

Why are you doing this? Is it a matter of the perception of these parameters by a human? If not, what sort of accuracy are you after? In your example of 20, 20, 1 what are the units? If, for example you were using an 8 bit value, then the 1 would almost certainly be imperceptible compared to a 0.

I guess you need to explain the application for this device since that weighs heavily on the approach for a solution.
 

crutschow

Joined Mar 14, 2008
38,546
The final product will have 4 buttons that give a certain colour temperature and then a up/down button that will control the brightness on each colour temperature setting.
If you want button control, then a microprocess generating PWM signals would likely be the best solution.
But it would seem the gain for the PWM signal for each LED to change the brightness will need to be proportional to the PWM settings for the desired color (in other words to keep the proportional change in each LED current constant as the brightness changes).
Thus the three currents change by the same percentage, not the same absolute value.
I would assume this multiplication can be done in a micro, such as the Arduino, to generate the needed duty-cycle for each PWM signal.

You should experiment with the LEDs for various colors and brightness to see what the exact current relationship is to maintain a constant color with brightness.
That will then need to be incorporated in how the PWM signals change with the brightness setting.
 
Top