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.
For more info, see : https://www.instructables.com/id/Alternating-Analo...
In this instructable i will try to show you how you can make an analog LED fader that has a brightness change that appears to be linear to the human eye. This results in a nice linear fading effect.
To generate the exponential current that is needed to get this linear fading effect, i make use of the FET square law, stating that : the drain current (Id) of a saturated FET has a quadratic (parabolic) relation to the gate voltage (Vgs) minus the threshold voltage (Vth). So Id relates to (Vgs-Vth) ^2.
See the graph for this relation.
In this instructable i use this quadratic relation for the current that is sent through the LED, so the LED brightness appears to fade in and out in a linear way.
Step 1: Circuit
In the schematic you find the circuit using a PUT to generate a rather linear triangular waveform. At node (1) in the circuit, this triangular waveform is present.
R4 charges C1 and R3 discharges C1. So R4 determines the steepness of the positive slope and R3 determines the steepness of the falling slope. Q3 and Q4 form a MOSFET differential amplifier which has a very high input impedance, thus not influencing, while buffering the triangular waveform that is present over C1. The gate of Q4 is set to approximately 2,7V (with R8 and R9) which is around the gate threshold voltage of the MOSFET. Q3 will start conducting as soon as the voltage at node (1) reaches it's gate threshold voltage, which is about 2V. The current through the LED will not increase linear with the triangular input voltage applied, but will follow a square curve due to the FET square law, that defines the relation between the gate threshold voltage and the drain current of the FET. The result is that the fading in and out of the LED intensity will be perceived as a pretty linear. With C1 = 33uF, the period of the triangular waveform will be about 3 seconds, meaning 1,5 sec for fade in and 1,5 sec for fade out. When you want a different frequency, just change C1. Use a high efficiency LED to get enough brightness even with currents below 10mA. Use a decent electrolytic capacitor with a low ESR and leakage for C1. The other components are not critical. The circuit is dimensioned to be used with a power supply of 5V. When using higher supply voltages, R5 and R7 need to be adapted. All resistors are 0.25W/10%.
The first oscilloscope picture shows the voltage at node 1 (voltage over C1).
The second oscilloscope picture shows the voltage over R5 (=1K), that represents the current through the LED.
Step 2: Build the Circuit
* I prototyped the circuit on a breadboard, but i have no PCB layout for it.