L.E.D protection resistor value

Thread Starter

Homebrew1964

Joined Nov 22, 2024
136
I just received an order of l.e.d's to play with and it appears they are two different voltage ratings, how do i calculate the resistor value for R1 ?

I am pulsing the l.e.d with a 5V square wave so when calculating the value of R1, i don't know whether to use 5V or the voltage rating of the l.e.d in the formula.....2V or 3V depending on colour.

e.g:

5V divided by .02A or

2V divided by .02A
 

Attachments

WBahn

Joined Mar 31, 2012
32,736
I just received an order of l.e.d's to play with and it appears they are two different voltage ratings, how do i calculate the resistor value for R1 ?

I am pulsing the l.e.d with a 5V square wave so when calculating the value of R1, i don't know whether to use 5V or the voltage rating of the l.e.d in the formula.....2V or 3V depending on colour.

e.g:

5V divided by .02A or

2V divided by .02A
Neither!

The answer comes in going back to the fundamentals of what Ohm's Law is ... and is not.

It relates the current through a resistor to the voltage across that same resistor.

It does NOT relate the current through a resistor to the voltage across some other device, such as and LED.

So you need to analyze your circuit to determine the voltage that will appear across the resistor.

You are implying (we are having to guess, because you didn't supply a schematic, which is the language of electronics) that you will have 5 V appearing across the series combination of your current limiting resistor and the LED.

This means that:

V_cc = V_led + V_resistor

By Ohm's Law, the voltage across the resistor and the current through it, which is also the current through the LED since they are in series, is given by:

V_resistor = I_resistor * R = I_led * R

Therefore:

V_cc = V_led + (I_led * R)

Now just solve for R:

(I_led * R) = V_cc - V_led

R = (V_cc - V_led) / I_led
 

Thread Starter

Homebrew1964

Joined Nov 22, 2024
136
Neither!

The answer comes in going back to the fundamentals of what Ohm's Law is ... and is not.

It relates the current through a resistor to the voltage across that same resistor.

It does NOT relate the current through a resistor to the voltage across some other device, such as and LED.

So you need to analyze your circuit to determine the voltage that will appear across the resistor.

You are implying (we are having to guess, because you didn't supply a schematic, which is the language of electronics) that you will have 5 V appearing across the series combination of your current limiting resistor and the LED.

This means that:

V_cc = V_led + V_resistor

By Ohm's Law, the voltage across the resistor and the current through it, which is also the current through the LED since they are in series, is given by:

V_resistor = I_resistor * R = I_led * R

Therefore:

V_cc = V_led + (I_led * R)

Now just solve for R:

(I_led * R) = V_cc - V_led

R = (V_cc - V_led) / I_led
Thank you .. the schematic I DID supply in my initial post #1
 

B-JoJo-S

Joined Jan 3, 2026
229
Don't know why everyone is making this so difficult.
The resistor value can be calculated as followed:
R = (V_supply - V_led) / I_led
In case of the red led :
R = (5 - 2) / 0.02 = 150
And I agree with this.
To further simplify this:
Supply voltage minus LED forward voltage drop.
If using 5V supply with a Vf (forward voltage) LED that has a 2Vf you start by subtracting the Vf from the supply.
5V - 2Vf = 3V
Divide 3V by the desired amperage of the LED. In Bertus' post he chose 20mA (0.02A).
Divide 3V by 0.02A and you get the resistance. This case 150Ω.

So you need to know the Vf of the LED you wish to use. You need to decide what amperage you wish to run it at. Then you have enough information to solve the problem for yourself. Note: running an LED at its max current will have its shortest lifespan. Cut the amperage in half and you extend the lifespan by 4X.
 

dl324

Joined Mar 30, 2015
18,236
I just received an order of l.e.d's to play with and it appears they are two different voltage ratings, how do i calculate the resistor value for R1 ?
I know you have ADHD and dislike math, but there's no getting around it.

What everyone has implied but not stated explicitly is that you use Kirchhoff's Voltage Law (KVL) and Ohm's Law to determine the resistor value.

To simplify things, I replaced the 5V signal with a battery:
1777902419315.png
Writing the loop equation:
\( \large 5V = V_{R1} + V_{LED1} \)
or
\( \large V_{R1} = 5V - V_{LED1} \)

Using Ohm's Law to calculate resistor value for a given current:
\( \large R1 = \frac{V_{R1}}{I_{R1}} = \frac{5V-V_{LED1}}{0.02A} = \frac{5V-2V}{0.02A} = 150\Omega \)

Note that the current specification is likely a maximum, or absolute maximum, and you don't need to operate at that current.

Also, LED is an acronym, so it's all caps with no periods. Not L.E.D, l.e.d, or l.e.d's. Plural is sometimes written as LED's, but the apostrophe isn't as common as LEDs.
 
I do think it's important to understand some of the simple math stuff like Ohm's Law, how to calculate LED current and current-limiting resistors (NOT "protection resistors"), RC frequencies, etc., etc., etc., but math isn't everybody's thing.

If you have an Android phone, I recommend the ElectroDoc application. There's a free version, but the pro version is definitely worth the one time price of around 5 bucks. It gives you calculators for Ohm's Law, LED resistors, RC filters, voltage dividers and much more.

It also gives pinouts for many common and not-so-common connectors, standard resistor and capacitor values and other stuff that I use all the time.

Screenshot_20260504_090846_Electrodoc Pro.jpg
Screenshot_20260504_090951_Electrodoc Pro.jpg
Screenshot_20260504_091010_Electrodoc Pro.jpg
 
Also understand that the specified 20 milliamps current is for the claimed LED lifr and the specified light output. MOST LEDs will produce light at 10 milliamps, and last a while at 30 milliamps. so you do have a range of currents available to utilize.
 
Top