LEDs have a constant voltage drop while conducting, and in order to operate effectively, they need to be supplied with a constant current source. If the current is to high, the component would burn; If it’s too low, it would be unnecessarily dimmed.
The problem with the serial resistor and alternatives
The simplest way of making a current source is using a resistor as current limiter. The problem in this set-up is that you must have information of the voltage drop of the LED, and sometimes it’s not so accurate. Also, using different power supplies and stacking LEDs require different resistances and power specs.
- discrete with transistors;
- linear regulator;
- switching regulator and specialized circuits.
Discrete current source
In this circuit, Q2 is the power transistor that controls the current, and R2 +Q1 are the feedback loop that controls Q2.
- R1 100KΩ (1/4 W) resistor;
- Q1 small transistor;
- Q2 large transistor;
- R2 large resistor.
- R2 = V_base / I_diode
- P_R2 = V_base² / I_diode
pros: fewer parts; inexpensive
cons: low efficiency in low voltages (depends on the regulator dropout voltage)
Switching regulators and specialized circuits
The most expensive, but the best in efficiency and flexibility. A good product example is this mini buckpuck.
 mini buckpuck