LED current limit resistor

I wonder if I can eliminate the resistors by using the PWM at low values.
Thanks

No, that will overload the LED and the Arduino and risk burning both out.

PWM doesn't reduce current, it reduces the proportion of time for which the current flows. The absolute limit on
Arduino output pins of 40mA is an absolute limit with no mention of duration. And because its an absolute limit
you won't even go near it in normal operation - treat it as an 25mA upper limit and all will work well without
issue.

If your power supply was a feeble coin cell then it might provide current limiting for you, but otherwise you
have to prevent overloads from happening if you want your circuit to be reliable and here that means the LED
series resistor(s).

martin_80x:
I wonder if I can eliminate the resistors by using the PWM at low values.
Thanks

No.

martin_80x:
I wonder if I can eliminate the resistors by using the PWM at low values.
Thanks

You have to have something to limit the current thru the LED. You could use an inductor.

Will the ports burn out if I connect them to another device without a resistor? lets say a guitar pedal effect.
The port is connected straight to the effect and it works fine, but if I use a resistor bigger than 30 ohms the effect pedal would not work, so I decided to take it out.

martin_80x:
Will the ports burn out if I connect them to another device without a resistor? lets say a guitar pedal effect.
The port is connected straight to the effect and it works fine, but if I use a resistor bigger than 30 ohms the effect pedal would not work, so I decided to take it out.

That's all going to depend upon the device you hook them to. Before hooking it to a foreign circuit, you should measure the voltage that it will be exposed to and the current required if you are trying to switch something.

martin_80x:
I wonder if I can eliminate the resistors by using the PWM at low values.
Thanks

Yes you can. That's a common technique.

MarkT:
No, that will overload the LED and the Arduino and risk burning both out.

PWM doesn't reduce current, it reduces the proportion of time for which the current flows. The absolute limit on
Arduino output pins of 40mA is an absolute limit with no mention of duration. And because its an absolute limit
you won't even go near it in normal operation - treat it as an 25mA upper limit and all will work well without
issue.

If your power supply was a feeble coin cell then it might provide current limiting for you, but otherwise you
have to prevent overloads from happening if you want your circuit to be reliable and here that means the LED
series resistor(s).

Why do you say that? Using PWM with LED's (without resistors) is a common technique.

Krupski:

martin_80x:
I wonder if I can eliminate the resistors by using the PWM at low values.
Thanks

Yes you can. That's a common technique.

From an Arduino pin? No you absolutely cannot. It will destroy the LED and the IO pin.

Current MUST be limited.

Don't confuse implementations with a chip like the TLC5940. Yes it is using PWM, but that is a CONSTANT CURRENT source, not a constant voltage source like an Arduino pin.

DO NOT use PWM on an Arduino pin without a current limiting resistor!

Krupski:
Why do you say that? Using PWM with LED's (without resistors) is a common technique.

Not studying electronics theory is also 'common'. I wonder if there's a correlation...?

I've never thought about this LED resistor thing deeply, although I know they need to be there. I know if an LED has Vf of say 2V and my supply is 5V, I need to lose the other 3V with a resistor that is spec'd to limit the current to that which suits the LED, say 20mA.

BUT..... thinking a bit further, this means that if I happen to have 2xAA batteries which are a bit flat, and which happen to be at 2V in series, I can't use them to run an LED with Vf=2 with no resistor although that "seems" to be the right value? Vs=Vf so R=0/i = 0 ohms.... Seems I have to use a higher voltage (Vs>Vf) purely to give me some to lose in the resistor, thereby limiting the current?

Is that right?

JimboZA:
BUT..... thinking a bit further, this means that if I happen to have 2xAA batteries which are a bit flat, and which happen to be at 2V in series, I can't use them to run an LED with Vf=2 with no resistor although that "seems" to be the right value?

You can do it in theory but real-life LEDs are imperfect, the LED forward voltage is only a guideline. Trying to run it at the forward voltage with no resistor is very risky.

You're probably OK trying to run your 2V LED at 1.5V with no resistor. Even so... Vf is a bell curve, you might get a LED on the outer limit and it will die. Adding a resistor prevents runaway current so it's still a good idea.

Krupski:

martin_80x:
I wonder if I can eliminate the resistors by using the PWM at low values.
Thanks

Yes you can. That's a common technique.

Only if you confuse the word technique with stupid mistake, sure it is common.