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:

R = (U_{in} - U_{f}) / I_{f}

U_{r} = U_{in} - U_{f}

P_{r} = U_{r} ⋅ I_{f}

where:

- R is resistance.
- U
_{in}is supply voltage. - U
_{f}is LED voltage. - I
_{f}is LED current. - U
_{r}is voltage drop on the resistor. - P
_{r}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 P_{r}.