Hey guys.
I'm new to electronics and LED.
After searching all over for what I'm looking for I'm beginning to think I need to build it myself.
All suggestions are welcome
For my project I need to be able to physically control both the kelvin and the brightness of my 24v LED strip. I would like it to have a small display to show what kelvin it's at and what percentage the brightness is. I think one clickable knob would be sufficient.
I'd like the display to only show the current kelvin and brightness. One click would highlight the kelvin and you could turn the knob to change it's value. Another click would highlight the brightness and turning the knob would change the percentage. Another click would deselect.
And maybe a long press would be on/off ?
I'm looking to build about 15 of these controllers, and hoping for them to be pretty compact hehe.
I'm not looking for anything with Bluetooth, WiFi, apps or remotes. Just the old school hard wired controls
I haven't bought the LED strip but here is an example of one:
You need an LED strip that has LEDs for which an Arduino library already exists, or you need to buy a controller and figure out the protocol with an oscilloscope. The first option is much easier.
I've seen many projects that control the brightness. That's not the issue.
But what I haven't found is any projects that have a screen and some logic that can accurately tell me what kelvin and what percentage the strip is currently running at.
This is a similar idea with a knob and a screen for feedback but way over engineered for my need hehe:
You'll need 2 power supplies. One to control the brightness of the warm LEDs and one to control the cool LEDs. For non-addressable strips you'll need 2 MOSFET drivers, and you can research how to do that. (MOSFETs will "pass" PWM for dimming.)
If the manufacturer doesn't give you the needed information about variable color temperature you'll need a way to measure the color temperature and map it out yourself.
You can find examples of writing to an LCD display. You should treat this as a separate project and after you know how to write to the display, and that's all debugged can put everything together.
Your program "knows" the brightness of the warm & cool LEDs so you'll just have to figure-out how that relates to color temperature and add that to your code.
For a "knob" you can use a potentiometer or a rotary encoder. A pot is easier to use, but if you want to control color temperature and brightness separately you'll need two pots. A pot only rotates about 270 degrees and it has "mechanical memory"... The position of the pot means something.
If you always want maximum brightness (or constant brightness) a single pot can control can control the mix of warm & cool.
A rotary encoder can turn more than 360 degrees and only the relative position matters. So you could adjust brightness and then switch to color temperature and it won't matter that the knob has moved since you last adjusted the color temperature. (I hope that makes sense.)
P.S.
There are some "weird things" about color perception and I don't know if it's the same with color temperature... I assume so... Your brain can only see one color at a time. For example, you can make the whole spectrum of colors with red, blue, and green LEDs but the perceived color doesn't really exist as a wavelength.
Accurately mapping color temperature and percentage to two channels of PWM will be very dependent on your LEDs' characteristics. You haven't specified your needs nearly well enough for random folks on the internet to pop out the logic behind:
int coolPWM(int kelvin,int percent);
int warmPWM(int kelvin,int percent);
...
analogWrite(channelC, coolPWM(kelvin,percent));
analogWrite(channelW, warmPWM(kelvin,percent));
I'd bet a nickel that the logic in the commercial controllers isn't much different than:
int coolPWM(int kelvin,int percent){
return(map(kelvin,2700,6500,0,percent));
}
int warmPWM(int kelvin,int percent){
return(map(kelvin,2700,6500,percent,0));
}
Are you sure. I can see it could just only use one and two PWMed FETs to control the relative brightness of the two lots of LEDs.
Unlike normal RGB LEDs, white LEDs work by a UV LED exciting a phosphor. That gives a whole spectrum of light for each of your two LED types. The exact spectrum is given by the phosphor which is normally a mixture of rare earth elements.
This is a typical spectrum for the two types of LED.
What you need to do for any accurate measurement of colour temperature is to combine those two spectra at the intensity you are setting them at to derive the joint spectrum. You can find the exact spectrum of each LED if you know the type number of them, they will be in the data sheet.
But I agree with @DaveX in practice they probably don't go to that trouble and just use a ratio of intensities.