====== LED Resistor Calculation ======
If the supply voltage is higher than the LED's voltage, the resistor has to be included in the circuit in series. The resistor limits the current and produces the required voltage drop. To find the correct value for the resistor, the following equation is derived from Ohm's law:
[{{ :images:electronics:led_resistor:led_resistor_schematics.png?180|LED with series resistor}}]
R = (Uin - Uf) / If\\
Ur = Uin - Uf\\
Pr = Ur ⋅ If\\
where:
* R is resistance.
* Uin is supply voltage.
* Uf is LED voltage.
* If is LED current.
* Ur is voltage drop on the resistor.
* Pr is power of the resistor that is transformed into heat.
The current limiting resistor of an LED has to be not smaller than R, and at least with the power of Pr.