Also see : PUT linear LED fader for the FET square law circuit
LEDs are nonlinear devices, just like other diodes, and show an exponential relation between forward voltage and forward current when increasing the voltage above the forward voltage drop of the junction.
In the figure below, you can see the voltage-current relationship for a red, green or blue LED, which have a different forward voltage.
Most of the circuits to fade/dim a LED are digital circuits using a PWM output of a microcontroller.
The brightness of the LED is controlled by changing the duty cycle of the PWM signal. Soon you discover that when linearly changing the duty cycle, the LED brightness does not change linear.
The brightness will follow a logarithmic curve, meaning that the intensity changes fast when increasing the duty cycle from 0 to lets say 70% and changes very slow when increasing the duty cycle from lets say 70% to 100%.
The exact same effect is also visible when using a constant current source and increasing the current linear f.e. by charging a capacitor with a constant current.
In the figure below, you can see that the brightness perception of a LED has a logarithmic curve due to the Weber-Fechner law, telling that the human eye, just like the other senses, has a logarithmic curve.
When the LED just starts "conducting" the perceived brightness increases fast with increasing current. But once "conducting", the perceived brightness increases slow with increasing current.
In order to linearize the LED brightness, we need to apply an exponential changing current through the LED, as shown in the figure below :
When taking a close look at LDR (cadmium sulphide) cell specifications, you will see that the LDR resistance is drawn as a straight line on a logarithmic scale. So the LDR resistance changes logarithmic.
Furthermore, the logarithmic resistance curve of an LDR seems to match the logarithmic brightness perception of the human eye pretty close. That is why the LDR is a perfect candidate to linearize the brightness perception of a LED.
When the LDR is used as part of a voltage divider, together with a fixed resistor, this will cause an extra non-linear effect. This effect is because in that kind of voltage divider, not only the voltage over the fixed resistor changes, but also the
current. When using an LDR to compensate for the logarithmic perception, the human eye will be pleased by the nice linear brightness variation.
In the sub-pages you find some circuits that use different approaches to compensate the logarithmic brightness curve of the LED.