Author Topic: LED current explained  (Read 4736 times)

0 Members and 1 Guest are viewing this topic.

Offline tehtehtehTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
LED current explained
« on: January 05, 2017, 04:08:27 pm »
hello

I understand ohms law, and I understand how to calculate the resistor for an LED, but there is something I can't find an explanation for no matter how hard I search

say I have a 5v microcontroller that supports 20mA output, I would put a 250ohm resistor on the output pin to control a mosfet or something, but say I want an LED directly on that pin, that would only require 100ohms to limit it to 20mA

so like where is the rest of the resistance coming from? does the LED make up the rest? I thought they were supposed to have virtually no resistance hence them needing a series resistor in the first place
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: gb
Re: LED current explained
« Reply #1 on: January 05, 2017, 04:16:08 pm »
The LED has a voltage drop across it. E.g. it could be 2 volts across the LED.
It is not an exact value, because it varies between different LEDs of identical types.
It also varies a bit with colour, current level and specific LED.

So 5 volts minus the 2 volts (varies), only leaves 3 volts across the current limiting resistor.

It is similar to a normal diode, so the voltage does not vary too much with differing currents.

Best to refer to the datasheet of the part(s) you are using, to get more information about the forward voltage drop of LEDs.
 

Offline Len

  • Frequent Contributor
  • **
  • Posts: 547
  • Country: ca
Re: LED current explained
« Reply #2 on: January 05, 2017, 05:31:12 pm »
so like where is the rest of the resistance coming from?

The thing is, a diode does not act like a resistor. Below its forward voltage it passes virtually no current. Above its forward voltage it conducts almost like a short circuit, but it always has that forward voltage drop.

So you don’t use Ohm's law with a diode (or LED). For an approximation, you take the LED's "typical" forward voltage and just say that is the voltage across it. It's almost constant.

Example of an LED with a current-limiting resistor in series: If you have 5V supply and the LED's forward voltage is 1.8V, that leaves 3.2V across the resistor. If you want 20mA of current, Ohm's law says the resistor should be 160 ohms.
DIY Eurorack Synth: https://lenp.net/synth/
 

Offline shteii01

  • Frequent Contributor
  • **
  • Posts: 266
  • Country: us
Re: LED current explained
« Reply #3 on: January 06, 2017, 02:05:29 am »
I understand how to calculate the resistor for an LED
Not true.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: LED current explained
« Reply #4 on: January 06, 2017, 02:15:12 am »
say I have a 5v microcontroller that supports 20mA output ...... but say I want an LED directly on that pin, that would only require 100ohms to limit it to 20mA

I have to ask - How did you get the value of 100 ohms?
 

Offline pitagoras

  • Regular Contributor
  • *
  • Posts: 116
  • Country: fr
Re: LED current explained
« Reply #5 on: January 06, 2017, 02:26:50 am »

You need to calculate the led drop voltage.
Vout - Vled = 5V-2V = 3V.
So what is the voltage if you measure on the resistor terminals? (do it) should be near 3V
Which resistor you need for 20ma current over 3V?
150R.

100R would not make 20ma unless diode drop is 3V.
I know no led of 3V drop voltage. White/blue are ~3.5V, the rest are ~2V
 
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: LED current explained
« Reply #6 on: January 06, 2017, 02:27:48 am »
That is the basic equation to use

I = ( Vdd - Vled ) / R


 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: LED current explained
« Reply #7 on: January 06, 2017, 02:34:58 am »
so like where is the rest of the resistance coming from? does the LED make up the rest? I thought they were supposed to have virtually no resistance hence them needing a series resistor in the first place

This is the best response so far:
1. The thing is, a diode does not act like a resistor.
2. Below its forward voltage it passes virtually no current.
3. Above its forward voltage it conducts almost like a short circuit, but it always has that forward voltage drop.

So you don’t use Ohm's law with a diode (or LED).
:-+

Quote
For an approximation, you take the LED's "typical" forward voltage and just say that is the voltage across it. It's almost constant.
It can get a little more complicated if you start getting into Vf verses current - but for the sake of basic calculations, this is quite good enough.


This is a textbook example of the basic calculation for a current limiting resistor:
Quote

Example of an LED with a current-limiting resistor in series: If you have 5V supply and the LED's forward voltage is 1.8V, that leaves 3.2V across the resistor. If you want 20mA of current, Ohm's law says the resistor should be 160 ohms.


You can also calculate the power dissipated through the LED, by using the voltage drop across the LED and the current flowing through it.  While you might think AHA! This is looking like a resistor! - don't be fooled.  Yes, the power dissipation from the LED will be the same as a resistor with the same voltage and current, but that is for those specific values.  If you change something, then they each respond differently.  The resistor will do so in a linear fashion - the LED will not.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: LED current explained
« Reply #8 on: January 06, 2017, 02:50:39 am »
There is a further complication, are you turning on LED by driving
the output pin low or high ? The Output is quite different in its drive
characteristics sourcing or sinking in the output (PMOS vs NMOS
transistors in output).

Then you have the very sloppy device to device Vf variation, as well as
the processor drive device to device variation.

This might help - http://www.nxp.com/documents/application_note/AN11496.pdf


Regards, Dana.

Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 4982
  • Country: ro
  • .
Re: LED current explained
« Reply #9 on: January 06, 2017, 03:02:32 am »
The forward voltage depends on what chemistry is used to create the LED.  Not all LEDs of same color are made from same chemicals.
Also keep in mind that some colors can be created indirectly using phosphorus layer over the actual led die...

Also note that the forward voltage varies with the temperature of the dide ... another reason why you can't really use just a resistor to limit the led to a very exact/accurate current value .. as the led heats up, the forward voltage will change, and the amount of current flowing through the led will also change.

From wikipedia : https://en.wikipedia.org/wiki/Light-emitting_diode#Colors_and_materials


 

Offline tehtehtehTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: LED current explained
« Reply #10 on: January 06, 2017, 11:59:57 am »
I understand how to calculate the resistor for an LED
Not true.
it would be more helpful if you could tell me what I'm doing wrong, wise master
 

Offline tehtehtehTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: LED current explained
« Reply #11 on: January 06, 2017, 12:02:31 pm »
say I have a 5v microcontroller that supports 20mA output ...... but say I want an LED directly on that pin, that would only require 100ohms to limit it to 20mA

I have to ask - How did you get the value of 100 ohms?
I was just using an LED with a 3v voltage drop as an example
 

Offline tehtehtehTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: LED current explained
« Reply #12 on: January 06, 2017, 12:12:34 pm »
thank you for all your replies

I know LEDs have different voltage drops and all that, and I know you can take the voltage drop into account to calculate an approximate value for the resistor, so maybe I should rephrase my question

imagine the LED and series resistor hidden in a box with the 5v and ground wires coming out, if I was to connect it up and measure the current going through it at 20ma, ohms law would tell me the resistance of that box is 250ohms yes? but yet the resistor in that box is actually 160 ohms for example, so what's the deal? does the LED make up the other 90 ohms?

or am I getting the wrong end of the stick completely?
« Last Edit: January 06, 2017, 12:18:37 pm by tehtehteh »
 

Offline pitagoras

  • Regular Contributor
  • *
  • Posts: 116
  • Country: fr
Re: LED current explained
« Reply #13 on: January 06, 2017, 12:29:02 pm »
If the led had a "resistance" you would have the same V/I ratio for any voltage you feed to your box. But it does not happen.
if you were to feed 10V you would expect 40ma (assuming the led does not blow). But you get (10-2)/160= 50 ma.
Thus the diode does not act as a resistance. It has a forward voltage drop.
 

Offline tehtehtehTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: LED current explained
« Reply #14 on: January 06, 2017, 12:34:57 pm »
If the led had a "resistance" you would have the same V/I ratio for any voltage you feed to your box. But it does not happen.
if you were to feed 10V you would expect 40ma (assuming the led does not blow). But you get (10-2)/160= 50 ma.
Thus the diode does not act as a resistance. It has a forward voltage drop.
so I can't think of it in the way I have been so far

this is fine, I just wanted to gain a better understanding of what was happening, rather than just using a formula and blindly accepting it like I had been

thanks for all the help
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12288
  • Country: au
Re: LED current explained
« Reply #15 on: January 06, 2017, 02:01:36 pm »
If the led had a "resistance" you would have the same V/I ratio for any voltage you feed to your box. But it does not happen.
if you were to feed 10V you would expect 40ma (assuming the led does not blow). But you get (10-2)/160= 50 ma.
Thus the diode does not act as a resistance. It has a forward voltage drop.
so I can't think of it in the way I have been so far

this is fine, I just wanted to gain a better understanding of what was happening, rather than just using a formula and blindly accepting it like I had been

thanks for all the help
If you were to do a single measurement, then your observation would be misleading.

This was the reason I added the following to my post:
You can also calculate the power dissipated through the LED, by using the voltage drop across the LED and the current flowing through it.  While you might think AHA! This is looking like a resistor! - don't be fooled.  Yes, the power dissipation from the LED will be the same as a resistor with the same voltage and current, but that is for those specific values.  If you change something, then they each respond differently.  The resistor will do so in a linear fashion - the LED will not.

pitagoras spelled it out with the example given.  To accurately assess what is in the "black box" you need to do multiple measurements under different conditions.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf