[Techtalk] matching LEDs to resistors

John Clarke johnc+linuxchix at kirriwa.net
Mon Dec 5 04:25:59 UTC 2011


On Sun, Dec 04, 2011 at 04:19:39PM -0800, Carla Schroder wrote:

Hi Carla,

> OK electronics gurus-- how do I know which resistors go with LEDs? Other than 
> asking the vendor. Like this one 
> http://search.digikey.com/us/en/products/WP7113SRD%2FE/754-1276-ND/1747675

There are a few things you need to know.  You may already know some or all
of these things, but just in case (and for the benefit of anyone else
reading) I'll start with the basics.

If you put two electronic components in series, the current through each
will be the same, but the voltage across them may be different.  This means
that the current through your LED will be the same as the current through
your resistor.

Resistors are known as linear devices because there's a linear relationship
between the current flowing through the resistor and the voltage measured
across it.  This is Ohm's law, usually written as V (voltage) = I (current)
* R (resistance).  Resistors also have a power rating, which is the maximum
power they can dissipate without damage.  Power dissipation is given by
Joule's first law: P (power) = V (voltage) * I (current), which you might also
see written as P = I^2 * R (replacing V with I * R as per Ohm's law).

LEDs are non-linear devices because there is a non-linear relationship
between current and voltage.  The voltage across the LED will be constant
regardless of the current flowing through (note, this is not strictly true
but it's a good enough approximation when the LED is operated to spec).
Also, the LED will conduct current in one direction only, so you need to
connect it the right way around or it won't produce any light.

You'll need a couple of specs for your LED: typical forward voltage and
typical current draw.  The one you've given as an example is rated at 1.85V,
Although a typical or maximum current isn't given, the specs do list a test
current of 20mA, so let's use that.

You need one more value: the power supply voltage.  The difference between
this and the LED forward voltage is the voltage you need across your resistor.

Let's assume a 5V power supply, giving a voltage drop across you resistor of
5 - 1.85 = 3.15V.  Ohm's law tells us that we therefore need a resistance of
3.15V / 0.02A = 157.5 ohms.

Now, it is possible to get this exact value by combining suitable resistors
in series & parallel, but there's no need to go this far.  LEDs are fairly
forgiving so a little more or less current won't hurt.  Choose a value from
the E12 (+/-10% tolerance) or E24 (+/-5% tolerance) range that's close to
what you want.  Suitable E12 values are 150 or 180 ohms, E24 values are 150,
160 or 180 ohms.

Now, using the resistor value you've chosen, work out what the actual
current will be, using Ohm's law again.  If you choose 180 ohms, you get
3.15V / 180 ohms = 17.5mA.  If maximum brightness is your aim, go for 160 or
even 150 ohms instead and adjust the calculations accordingly.

Using this current, you can now work out the power dissipation as 3.15V *
0.0175A = 0.055W (55mW).  Always add a safety margin to allow for the
resistor being at the low end of its tolerance, and a little more to allow
for a slightly higher than expected power supply voltage.

In this case, it doesn't matter, because it's well below 1/4W, which is the
cheapest & most readily available rating here (often sold in bulk packs, and
*much* cheaper to buy that way).


Note that if you're using an unregulated plug pack, its output voltage will
be *much* higher than its rating if lightly loaded, so you'll need to allow
for that in your calculations.  In my experience, it's not unusual for an
unregulated supply to be 50% higher than spec with little or no load.


Of course, if you don't want to work all this out the hard way, you can use
something like this LED wizard to do it for you:

    http://led.linear1.org/led.wiz

You might also enjoy Dan Rutter's comments on the subject :-)

    http://www.dansdata.com/danletters207.htm#1



Cheers,

John


-- 
It's called the APC MasterSwitch (or similar peoduct by alternate vendor).
Reboot machines over the network.  Takes the place of 64.2% of all people
employed with the word microsoft in their title.
            -- Brian Hechinger


More information about the Techtalk mailing list