L.E.D protection resistor value

Thread Starter

Homebrew1964

Joined Nov 22, 2024
173
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,786
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
173
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
271
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,308
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.
 

MrChips

Joined Oct 2, 2009
34,758
Even if your supply voltage were 24V, a 2kΩ series resistor would limit the LED current to a safe 12 mA.
Start with 2kΩ and work your way downwards. No math required.
 

Jon Chandler

Joined Jun 12, 2008
1,586
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
 

MisterBill2

Joined Jan 23, 2018
27,432
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. That is that 20 milliamps is the current at which the light intensity was measured and that "most" of the LEDs will last at least the claimed lifetime, whatever that is. What is interesting now is that a great many LEDs are intended to run at a much greater current. (I have a 3-cell "MAG" brand flashlight and the LED must draw more than 20 Ma based on the shorter life of the three "D" batteries. And shorter LED flashlight that also consumes it's batteries . My point being that 2.50 volts andd 20.00 Ma is no longer the only common "power standard" for LEDs.
 
Last edited:

ThePanMan

Joined Mar 13, 2020
896
Simple. I start with 2k or 1kΩ and decrease it until I get the desired brightness.
Don't get greedy and think the lower the resistance the brighter the LED. While that's true, there is a limit, a point where you'll burn out your LED. If you have them to spare then experiment. If not - as others are telling you - anything less than 20mA will probably work just fine. 15mA is a good target for something nice and bright. 10mA is good for anything not in direct sunlight. 5mA at night can still be bright. And if you use Super Bright LEDs you can go as low on amperage as 2mA and still get good indication.
OK, I got brave and tested my theory. IT WORKS!

So now I have to reassemble the fan and see what kind of air flow I get.
Pretty neat little motor.
What are you talking about?
 

Thread Starter

Homebrew1964

Joined Nov 22, 2024
173
Don't get greedy and think the lower the resistance the brighter the LED. While that's true, there is a limit, a point where you'll burn out your LED. If you have them to spare then experiment. If not - as others are telling you - anything less than 20mA will probably work just fine. 15mA is a good target for something nice and bright. 10mA is good for anything not in direct sunlight. 5mA at night can still be bright. And if you use Super Bright LEDs you can go as low on amperage as 2mA and still get good indication.
I experimented with resistor values untill i got to 17.7mA as measured with my multimeter, at that current if i looked directly into the LED then looked around the room, i had a red dot in my eyesight so i didn't go any brighter , that was with the red LED.:p
 
Top