# Electronic – Correct formula for LED current-limiting resistor

current-limitingledresistance

I'm trying to work out what value resistor to use in a LED circuit. The equation I'd use to do this is:

$$R = \frac{V_{cc} – V_f}{I_f}$$

Seems logical, and makes complete sense. The answers to the question How do I calculate the resistor value for a simple LED circuit? confirm this too.

I have the following LEDs:

• \$V_f = 3.3V \$
• \$I_{f_{typ}} = 20mA \$

Using a 5V power supply:

• \$V_{cc} = 5V \$

Plugging these into the above equation gives:

$$\begin{eqnarray} R & = & \frac{V_{cc} – V_f}{I_f} \\ & = & \frac{5V – 3.3V}{20mA} \\ & = & 85\Omega \end{eqnarray}$$

All good so far.

However, if I use the calculator at http://led.linear1.org/1led.wiz, that gives me 100Ω. If I use the ElectroDroid app on my phone, that gives me 85Ω.

So, I assume that the linear1 calculator is using a different method of calculating this resistor value; is there some better way of doing this?

Your calculation is correct. linear1 rounds up to the next E12 value, which happens to be 100\$\Omega\$. The nearest E12 value would have been 82\$\Omega\$, and that would still be safe, because, even if the current will be higher, the difference will be small, within the 10% tolerance of the E12 series.