Barefoot Electronics

LED Mysteries Explained

Posted by Tom on Jan 11, 2013

Well, Ok, I'm not going to explain ALL mysteries of LEDs, that would take a big book
and be so boring you'd never care to read it. Instead, I'll explain how to use them.

Remember back when "Solid State" tv sets first appeared? Nobody knew much about them, but they
were smaller, didn't get as hot, and you didn't have to call the repairman to bring his
tube (valve) tester and replace the tubes that had gone bad. Well, an LED is nothing but a
solid state light bulb.

Ohm, what's up doc?

To understand LEDs, you'll have to know a little about electricity. About 1827, a fellow named George Simon Ohm
figured out that there is always a fixed relation between the force moving electricity, the resistance to that flow and the amount of electricity flowing. His theory of how it worked was a little off, but his observations and calculations
were spot on, so we honor him by misusing his name as our unit of resistance.

Your duty to volt?

You can think of Voltage as "electric pressure" that pushes a current through a resistance. Rather like this straw. If I blow harder, air, current, goes through the straw faster.

Of course, if I pinch the straw and increase its resistance, less air, or current, flows. I can still blow hard or soft to change the flow, but less flows than if I wasn't pinching the straw.

So we talk about pressure in "Volts," resistance in "Ohms," and current in "Amps."

Believe it or not, Volt and Ampere were more nineteenth century experimentors.

Got amps in your pants?

Now, an Ampere (Amp for short) is a specific number of electrons moving per second. The number is 6.241 × 1018, but who cares. This large number of electrons is called a "coulomb." (say cool-ohm)

An Ohm is the resistance that permits 1 amp to flow when 1 volt is applied.

Metrification?

Wouldn't you know. Volts, amps and ohms, are metric!

Actually, that's pretty handy. If they weren't metric, then we'd have volts related to cups of flour, amps the weight of an egg
and an Ohm the thickness of the leaf of a Linden tree, or something equally nonsensical. Just try figuring with these kind of units! Think I'm kidding? Until they defined an inch to be 25.4 millimeters, an inch was "Three times the length of a barlycorn, mature and well rounded," and the standard inch was a block of stirling on a desk in London.

Since they're metric, we can talk about kilovolts (thousands of volts), milliamps (thousandths of an amp) and megaohms (millions of ohms). For the purposes of LEDs, we're usually talking about volts, milliamps and ohms, or sometimes kiloohms.

How Big? A volt isn't very much. A little battery is around 1 1/2 volts. An amp is actually quite a bit. The motors in our bigger
locomotives use 1 or 2 amps pulling a longish train. Since an ohm lets an amp through at a volt, an ohm isn't very big either. The kid is 3 ft 6
inchs, without standing on his toes, and the ruler is a meter. (The kid doesn't really exist. He's just data.)

Watts all this here?

We measure electric power in "Watts." To find the number of watts, you just multiply the volts times the amps. So how much is a watt? Not really very much. One horsepower is a little more than 746 watts but less than 747 watts. Why such a silly number? I don't know. You would have to ask James Watt, but you can't because he's dead.

Anybody want some ohmslaw?

No, Ohm's law is not finely chopped resistors served with mayo.

Ohm's Law So, back about 1827, this fellow named Ohm figured out that there's a fixed relationship between Electromotive Force, Resistance and current. 1 Formula describes the behavior of electricity. Using Algebra, yes, some of us did pay attention, we have 3 simple formulas. These are very useful and I'll give you a trick so you can always remember them whenever you want. With Ohm's law and a calculator, you can conquer the world! Well, maybe not.

Now, if all this makes too much sense, don't worry, I'll goof it up for you now. You see, just to be contrary, we electronics guys always
use E when we're talking about voltage, I when we're talking about current, and R when we're talking about resistance. Well, R for Resistance
makes sense. E for Electromotive Force might be reasonable, but I don't know why I is current. I am current? Just take my word for it.

And now you'll never forget!

Using the letters E, I and R that engineering types use, the late Prof. Eric S. Ruby (my dad) burned Ohm's Law into my mind in a moment by showing a single picture
on the overhead. I've reproduced it here using DAZ Studio.

The Eagle sees the Indian and the Rabbit. E = IR

The Rabbit sees the Eagle over the Indian. R = E/I

The Indian sees the Eagle over the Rabbit. I = E/R

Yes, it may be more appropriate to describe him as an idiot than an indian.

One rule to rule them all: E = IR

(Yes, I know that's really a hare. I don't have a rabbit model.)
Dad's graphic was pencil and watercolor made for him by an art teacher at the college.

The World Series.

In the diagram here, the parallel lines are how we draw a battery. The longer line is the + end. The zigzags are how we draw a resistor.

Connected this way, the current flows from the battery, through the 2 Ohm resistor, through the 1 Ohm resistor, and
back to the battery. Engineering students will recognize this as an infamous "do nothing" circuit. Actually, it's a heater,
though not a very big one.

Since the current through one resistor must flow through both, the circuit has a combined resistance of 2 + 1 = 3 Ohms.
Since our battery is marked 1 Volt, Ohm's law tells us that the current is 1/3 Amp (1 divided by 3 is 1/3).

You might, at first, think that the Voltage on each resistor would be 1/2 volt, splitting the 1 volt battery evenly, but
what does Mr. Ohm have to say about it? 1/3 of an amp through a 2 ohm resistor is 1/3*2 or 2/3 volt! And 1/3 of an amp through a 1
ohm resistor is 1/3 volt.

Engineering students suffer whole courses about calculating volts, amps and watts on useless circuits like this. But all that is boring
and barely applies to making an LED light up, so we'll skip all the rest of that.

Get the LED out.

Usually we connect an LED this way.

Since an LED is a diode, it only lets current flow one direction. The tiny arrows are the light coming out. The other arrow points the direction the current flows. Well, almost. You see, the electrons REALLY flow from - to +. We call the end they flow into + because somebody made a mistake and now, by convention, we always make the same mistake. I'm not going to say who made this mistake, but his initials are Thomas Edison. So, knowing that electrons are REALLY negative, we just pretend current flows from + to -.

So, what's with the resistor?

And now we come to the reason LED's are a bit mysterious. You see, any given LED works at a specific voltage. This voltage depends on the weird stuff the LED is made of; conditions at the time of manufacture; something about
quantum mechanics that nobody really understands; temperature; light shining on it and many other factors just too crazy to try to keep track of.

Now this voltage is pretty low. Typically between 1 1/2 and 3 volts. Some of the oldest white ones, the kind that shine bluish white, need 4 or even 4.1v.

All this combines to make an LED a rather strange thing. You see, it changes its resistance to get the voltage it wants!

So if you connect your 3v LED to a 12v battery with a wire, that is, 0 ohms resistance, what does Mr. Ohm's formula tell you the current will be? Let's see, 12 - 3 is 9 volts. 9 volts divided by 0 ohms is... Oh dear, infinite. (Not really, a wire is never really 0 ohms, an LED does have
a few ohms 'cause it's not perfect, and so does the battery because it's not perfect either.)

If you put an infinite current through an LED designed for 20 milliamps (0.02 amps), you will be using your LED as a fuse and it will very quickly become what we call a "Dark Emitting Diode" (DED). What ever else they may be, DED's are very efficient, using no power at all to remain dark.

What resistor do I use?

But here, Mr. Ohm comes to our rescue! We don't have to guess. Just take out your handy pocket calculator, subtract and divide.

So we want to use our 3v LED designed for 20 milliamps (mA) in a 12v system. Let's punch some buttons! 12 minus 3 is 9, and 9 divided by .02 is (Rabbit sees Eagle over Indian) 450 ohms.

So we'll send the kid to Radio Shack to get us some Ohms. He pedals his trike all the way and surprise! They don't have any 450 ohm resistors. They have 430 and 470 ohms, and some 470K ohms. Now, what do we do? (Alas, poor Radio Shack. He pedaled all that way and now they're closed. Oh well, kids have energy to burn. Builds character.)

Since ohms are metric, K means thousand, so skip that one, we don't need 470000 ohms. Let's figure what our current will be if we use these 430 ohm resistors instead of 450. Get the calculator and 12 - 3 is 9, and the Indian sees the Eagle over the Rabbit so 9 divided by 430 is 0.0209, and that extra milliamp isn't going to bother a thing. Indeed, our LED will be running at 0.0009 * 3 or .0027 too many watts, and that's not enough to even think about. Remember a watt is a pretty small amount of power.

We would thank Mr. Ohm for helping us figure this out, but I don't have his email address.

Radio Shack was great! You could walk in and get things like resistors any time they're open, but if you're looking for something like 50 resistors and don't know where to find that many, let me know and I'll add them to my next parts order. For an alternative, see http://allelectronics.com

Top Secret!

Now here's a secret. I'll whisper so nobody hears.

LED's aren't all that critical!

Your LED will work fine at 25mA. 30mA. At 50mA, you can probably feel it getting warm, but it likely won't get warm enough to harm anything even at 50 mA! Of course, if you live in Arizona and want to run your trains in the mid summer sun, you'll need to pay more attention to the current rating, but for the rest of us, it doesn't matter all that much, and JJ's overdriven LED's aren't going to set his loco on fire, even in July.

So can I..

...just connect my 3v LED to 2 AA batteries?

Brace yourself: The answer is. YES.

Why?

Two factors conspire to make this work for us. First of all, your batteries aren't perfect. A battery always has some resistance inside it. Second, your LED isn't that critical. On fresh batteries straight out of the package, it will be getting a little too much current, but it won't be getting too warm to touch. How hot is too hot? If it's not comfortable to hold on to, it's too hot.

So, on 2 AA batteries, how long will my LED shine?

Plain alkaline AA batteries that you find in a store are good for about 2 "amp hours." Some more and some less. That means, if you draw 2 amps from them, they'll run down in about an hour. Actually a little less than an hour because they're better at providing low currents and 2 amps is quite a bit of current. At 1 amp, they'll last about 2 hours. So, at say 30mA that our overdriven LED is suffering under, they'll last, 2 divided by 0.03 is 66 hours. And that's just till they start to run down and the LED goes dimmer. As a battery runs down, the voltage actually stays the same, but the internal resistance increases, so all that happens is your LED glows dimmer when the batteries are running down, but will go for a long time yet. If you get the newer lithium type batteries, they'll run your LED a LOT longer.

Now a D cell battery is good for around 15 amp hours. How long will two of these light an LED? About 21 days before it starts to get dim, and perhaps all summer out in the garden before it goes out.

The unknown LED.

But I don't know anything about this LED.

All you need is a resistor, one of these extra 430 ohm resistors will do nicely; and an adjustable
voltage source. Now where might you get an adjustable voltage source? How 'bout a train throttle? If you don't have one connected to your track anymore, you probably have one in a junk drawer somewhere.

Just connect your LED and resistor to your adjustable voltage source and turn it up till the led is shining nicely. The LED doesn't turn on? Try the reverse switch. Remember, an LED only works one way. There, now it's on. Those little clip leads Radio Shack used to have in packs of 5 are very handy.

Use your volt meter. Put the red probe on the + side of the LED, and the black probe on the - side and turn the dial to say the 20 volt scale. The meter now tells you the voltage of your LED. Play with it a little. You'll find as you increase and decrease the voltage, the LED gets brighter and dimmer, but keeps about the same voltage. It will vary a few tenths of a volt between too dim to see and too bright. Why doesn't the LED voltage vary more as you change the throttle? Remember, the LED changes its resistance to get whatever voltage IT wants, so all your throttle adjusts is the current through the LED.

Now we need to find the current. Unhook one end of your LED and connect your meter so the current goes through the resistor, through the LED and through the meter. Now turn the dial to something like the 200mA scale. The LED turns back on, and the meter tells you what the current is. Play with it a little and see what current makes the LED shine nicely. You'll find a point where more current doesn't make the LED any brighter, but starts to warm it instead. This is probably about the max current you want to use. No point making heat when you want light.

What's this about watts?

There are big resistors, great big resistors, gigantic resistors, small resistors and teeny tiny resistors. The difference is the number of watts they can deal with before they get too hot, split open, stink and go to infinite ohms.

So let's figure the watts for our 20mA LED in a 12v system. The resistor has 9v, and conducts 20mA, so 9 times 0.02 is 0.18 watts.

Most of the resistors you'll find at Radio Shack are of the "Quarter Watt" variety and will do. You might find some itty bitty ones that say 1/8 watt. 1/8 watt is 0.125 watts, so if you use one of these, you might find it gets uncomfortably hot, so you don't want that one. For lower voltages, the 1/8 watt resistor will do fine. Since 0.18 watts is less than a quarter watt, a quarter watt resistor will do fine. How 'bout a 1/2 watt resistor? No problem, it's just bigger than you need, but that won't hurt a thing. How 'bout a 25 watt resistor? If you have the space, it will do the job. A common practice is not to exceed 1/2 of a resistor's rated power. Why? At the maximum rated power, a resistor is rather hot. Additionally, the rating assumes the resistor is in the open with air free to move around it, and that isn't always the case.

Suppose we want to use our 3v LED in a 5v circuit? Again, subtract and divide. 5 - 3 is 2, and 2 / 0.02 is 100 ohms. And the watts are 2 * 0.02 or 0.04 watts, and Radio Shack didn't have a resistor too small to handle that.

More LEDs than 1

If you have more than 1 led you want to light together, there are a few different ways you might do it.

One obvious solution is to wire the two leds in parallel and figure the resistor for the current of one led times 2. For a number of reasons, this is not recommended. If your LEDS are exactly the same, you can get away with this, but other ways are better.

Better is to put the 2 LEDs in series with a resistor. To calculate this, just add the voltages of the 2 LEDs together, subtract that from the system voltage, and divide by the led current. This operates both leds at the same current and doesn't let you adjust the relative intensity. To make this work, the voltage has to be at least the voltage of the 2 leds combined.

This is actually how your new set of LED Christmas lights is wired. In USA, we have say 110VAC, which is about 180v "peak to peak" or about 90v peak. 32 2.6v leds would be 83 volts so the resistor would be (90-83)/.02 or 340 ohms. Does it frighen you to put LEDs in a mains circuit?

If you don't have enough volts to operate the leds in series, or you want to use different currents in the leds, then just put a resistor for each.

Summary

So LED's are real easy to figure. You do more complicated things all the time without much thought. All you need to remember:

Subtract the LED voltage from your intended voltage to find the resistor voltage.

Divide this resistor voltage by the LED current to get the resistor's ohm value.

Don't worry if the resistor value isn't exact.

Multiply the LED current by the resistor voltage just to be sure your resistor can handle the watts.

What's this?

What's an "LED Driver" or a "CL2"?

What won't they think of next? It's an automatic adjustable resistor! Whatever your input voltage and led voltage is, the LED driver will adjust its resistance to give you 20mA of current.