3
\$\begingroup\$

I am going to install an Analog RGB (non adressable) LED strip in my room and need to make a driver for it.

The LED strip specs are:

  • 10 cm segment
  • 12V @ 60mA max per segment

I would be using 330cm of the strip (33 segments => 2A max => 0.7A max per channel)

My initial thought was to use a microcontroller with 3 PWM channels for red, green and blue. But then I realized I could probably get away with using 3 variable resistance to provide variable voltage to the 3 channels and the color can then simply be changed by altering these resistors.

Would this way be okay ? After all PWM does the same thing ... generate analog voltage levels from digital.

The only thing i can think of is that the variable resistors need to be able to handle that much current (vs PWM solution where a mosfet/bjt would take care of it).

Any thoughts ?

\$\endgroup\$
1
\$\begingroup\$

Using variable resistors would work, but could be tricky to implement. For example, each segment has say a 130 ohm resistor per channel. So for 33 segments in parallel this is effectively a resistance of 130 / 33 ~= 4 ohms. So to halve the current for that channel you would need a single 4 ohm resistor, able to dissipate 0.7 * 4 = 2.8W. In a quick search on element14 I couldn't find a cheap potentiometer with this kind of power rating. You could use a pot to control a power transistor, but why not just go to PWM for that effort. :)

PWM is more power efficient. Here is a tutorial on getting is running using an Arduino and PWM. RGB LED Strip - Variable Voltage Vs. PWM

\$\endgroup\$
  • \$\begingroup\$ I agree. After reading the responses I think it would be better to go along the PWM route. I haven't had muc experience with PWM .. only used it once before ages ago to control a single LED brightness. back to reading timers on AVR .. fun ! \$\endgroup\$ – Ankit Nov 4 '12 at 8:17
9
\$\begingroup\$

First: LEDs are current-driven devices, not voltage driven.

An LED is a semiconductor diode, with a voltage to current relation like this:

Diode V-I graph from Wikipedia (from Wikipedia)

The light output of an LED is related to the current driven through it, while the voltage remains more or less constant at the junction voltage Vf of the specific LED. (Note: For RGB LEDs, each of the R, G and B junctions has a different Vf).

They exhibit a sharp "knee" in their voltage to current graph. This is unlike incandescent lights which have a more linear V:I graph once they heat up (where brightness is more or less proportional to voltage).


Why this matters in current context:
Changing the variable resistance does not change the light output in an easily managed manner as you sweep the variable resistance:

  • Until Vf for the relevant LED is reached across the LED leads, zero or a really small amount of light is emitted. Forward "resistance" of the LED is extremely high. Most of the supply voltage is across the variable resistor.
  • As the resistance is reduced, at a point the voltage across the LED reaches Vf, and the LED lights up. Forward "resistance" of the LED becomes very low, so current flow increases very rapidly. The resistance of the variable resistor works as the current limiter of this circuit.
    Vf appears across the LED
    (Vsupp - Vf) appears across the resistor. Current I = (Vsupp - Vf) / R
  • When the variable resistance is reduced marginally further, the current flow goes beyond the LED's capacity without appreciable voltage increase, and the magic smoke comes out. Goodbye, LED.

See this answer to another LED question, for a better explanation.


Why PWM works:
In a PWM driven circuit when the PWM signal is in the "on" part of the cycle, the current is usually externally limited to a fixed amount (using a resistor, current regulator IC, whatever you like). In the "off" part of the cycle, the LED is simply off.

Thus, as the duty cycle of the PWM is changed, the LED is fully lit for part of the cycle, and off for the rest, as per the PWM ratio. Our eye blends this on/off combination (by persistence of vision) to arrive at the perceived light intensity.

PWM does not generate analog voltage levels from digital, our eyes (or external devices e.g. a capacitor) do the analog averaging.

So PWM will give you smooth control over intensity for each of R, G and B, a variable resistor will not. Smooth, but not linear...


A minor note to be aware of:
Our visual perception of luminous intensity is not linear. We perceive a small change in a low intensity light much more strongly, than a similar change of a higher intensity light. The Weber-Fechner Law provides more insight into this.

Also, this differs between colors, and between males and females (that's connected to how more men are colorblind than women).

Why this matters:
If you vary your PWM duty cycle linearly, the perceived light transition will not be linear. An exponential function of around x^2.5 is recommended for perceived linear intensity increase.


Summary

  • Variable resistors won't give you the control you require.
  • Even with PWM, linear variation of duty cycle is not ideal, exponential is better.
  • For R, G and B of the LEDs, slightly different PWM transition curves would help.

\$\endgroup\$
  • \$\begingroup\$ comment removed \$\endgroup\$ – geometrikal Nov 4 '12 at 7:43
  • \$\begingroup\$ @geometrikal Yes, note that I said "more men are colorblind than women", not "men are more colorblind than women" \$\endgroup\$ – Anindo Ghosh Nov 4 '12 at 7:44
  • \$\begingroup\$ It seems I can't read! My apologies. :) \$\endgroup\$ – geometrikal Nov 4 '12 at 7:47
  • 1
    \$\begingroup\$ @m.Alin The Stellar Magnitude System as used for perceived magnitude of celestial bodies, in relation to their relative actual brightness. Formalized by Sir Norman Robert Pogson as Pogson's Ratio. Difference in magnitude approximates ratio of brightness to the power 2.512. The "2.5" value is my own simplification. \$\endgroup\$ – Anindo Ghosh Nov 4 '12 at 12:21
  • 1
    \$\begingroup\$ I see others having used the same value (see "PWM and LEDs" section), though apparently arrived at differently. My derivation it seems is incorrect, the correct value is 2.5. The inverse relationship power law constant is 2.512, not applicable in this case. \$\endgroup\$ – Anindo Ghosh Nov 4 '12 at 12:27
0
\$\begingroup\$

Personally, I too would use PWM. Add a rotary encoder with a knob-switch to select between adjusting R, G, or B and an RGB led to indicate the color component being changed.

However, I would like to point out that:
-A potentiometer is a fixed resistor with a variable center-tap; it functions as a variable voltage divider.
-A rheostat is the exact same device with one outer terminal disconnected; with only one path for current to flow, it functions as any normal current limiting resistor, except that it is variable.
-If rheostat input is 12V, rheostat output is 12V at variable current.
-Rheostats can be selected with a linear or audio taper between outer terminals. -Rheostat's minimum resistance is approximately 0ohms (not an issue since the strips have resistors).
-Rheostat's maximum resistance can be selected to provide the "brightness-to-knob-position" ratio that you desire.
-At maximum resistance, a rheostat will still ground some voltage from the strip. Rheostats are available that have an integrated on/off switch at one of their outer terminals. In some, the rotary, click-type on/off switch is replaced with a push button switch planted at the base of the rotary shaft; pushing the knob toward the device pushes the button. The button can be momentary or the push-in-push-out type.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.