# LED's and resistors



## noela (May 22, 2008)

I thought I had this down, but in my experimentation, I have come up with a question regarding what resistor I should use for LED's.
I can calculate the value of the resistor needed based on the forward voltage of the LED and the source voltage, but am in a quandary about the power rating of the resistor. I am using LED's in a variety of applications with input voltages varying from 6 vdc to 24 vdc. Calculating the resistance was easy, but my question is how can I accurately determine the amount of power I need in the resistor (watts)?
As an example, I have been able to determine that most of my LEDs running at 12 vdc will need a 470 ohm resistor. How can I figure the power rating? If it is to low will it burn out? If it is to high will it draw too much current? Quite a few of my applications use battery power, and I would prefer not to drain the batteries through the resistors being wrong.
Needless to say, any help and/or direction is greatly appreciated.


----------



## krs (Feb 29, 2008)

Noela, 

The 470 ohm resistor you calculated seems to be a bit on the high side to drive a single LED. 
For a single LED that will give you a current around 20ma which tends to be the maximum rated current of the typical LEDs we use - running LEDs at their maximum rating is fine but if you drop the current to 15ma or even 10ma you still get lots of light output and it's easier on your battery. 

As to the power rating of the resistor, power equals the voltage drop across the resistor times the current flowing through it, ie P=EI 
So for your example, the power would be roughly 10 volts x 20ma or 200 mw. You can also calculate power using the formula P=I^2*R, this will give you 0.02 * 0.02 * 470 or 188 mw. 
The answer would normally be the same, it's slightly different because I was just estimating the voltage drop across the resistor and the current through it in the first example. 
So in this example, a 1/4 watt resistor would actually do if it is mounted so that heat from it can dissipate well. Most people in the hobby would use a 1/2 watt resistor. 
The rated wattage of the resistor you use does not affect how fast you drain the batteries, the value and thus the current draw, does. 

If you use a lot of LEDs for a specific battery powered loco and the current to drive them becomes an issue, you can always look at the low current LEDs that provide full light output at 2ma rather than 20ma like the garden-variety LED. 

Knut


----------



## Greg Elmassian (Jan 3, 2008)

I have a page that will help you:

*http://www.elmassian.com/trains/dcc...ing-basics*

Look at the 3rd section, there are links for 3 LED calculators.

It will calculate the wattage for you... It will also recommend a value that won't overload the wattage of the resistor.

Rule of thumb, double the wattage of the resistor from the calculated value of P=I squared R, (power equals the square of the current times resistance) or as Knut states, P = VI (power equals the voltage times the current)

A 1/4 watt resistor running at 1/4 watt will burn your fingers and melt plastic.

No one really heat sinks resistors, and it's sort of beyond me why they rate them in a manner that you really cannot use them from a practical standpoint.

Whenever in doubt, use the next higher value of wattage.

Greg


----------



## Dan Pierce (Jan 2, 2008)

I agree with Greg that a resistor needs to be double in wattage value. For the few cents they cost, it is not worth melting plastic in your engine!!!


----------



## Dick Friedman (Aug 19, 2008)

LED drivers eliminate the need for calculating resistors. One drive in the circuit will allow many many (at least a dozen, as few as one) to be powered.


----------



## Dan Pierce (Jan 2, 2008)

Even with a led driver, one must watch for the heat/wattage ratings. 

And for battery operation, place leds in series to lower current draw.


----------



## Greg Elmassian (Jan 3, 2008)

While I "found" the CL2 LED driver, it's a fixed 20 ma and more expensive than a resistor.. I use them, but they are more expensive and less flexible than a resistor, so the poor old resistor still has uses! 

Greg


----------



## noela (May 22, 2008)

Hi Greg,

I agree. I just built a prototype for a LED circuit, based on the CL2 so I could determine polarity, etc. on intersecting rails. I put 4 locos on the circuit, and I fried the LED. Just did the same circuit with a 1K/1W resistor, and the resistor barely got warm. This circuit will have nothing but this resistor in it, and it will be much cheaper to produce. My source is 20 vdc, 25 amp. Using bi-polar, 2 lead red/green LED from All Electronics. I chose the 1 watt just to insure that I didn't get excessive heat, but I could probably go to a lower wattage, but, since I have a bunch of them, I won't do so unless it becomes a necessity.

Noel


----------



## Greg Elmassian (Jan 3, 2008)

Where I find the CL2 helpful is where I am using the full DCC track voltage (fixed) and using as many LEDs in serial to reduce overall system current consumption. 

It's also easy to put the CL2 in backwards (by not paying attention) and then it's a diode and passes everything... no current regulation... I know, sloppy on my part, but I've done it. 

So there's still pros and cons of each method. 

Greg


----------



## noela (May 22, 2008)

Hi Greg,

I constantly learn new things from you. How do you put the CL2 in backwards? More importantly, how do I determine the correct way? Perhaps this is what I did. Dummy me just trimmed out the center pole and attached one lead to the anode of the LED.

Noel


----------



## dbodnar (Jan 2, 2008)

Posted By noela on 02 Jul 2012 02:45 PM 
Hi Greg,

I constantly learn new things from you. How do you put the CL2 in backwards? More importantly, how do I determine the correct way? Perhaps this is what I did. Dummy me just trimmed out the center pole and attached one lead to the anode of the LED.

Noel 

Noel - I have details on how to use these devices and diagrams that show which pin is which in an article on my web page. See:

http://www.trainelectronics.com/LED_Articles_2007/LED_104/index.htm 

dave


----------



## krs (Feb 29, 2008)

I find 20ma a bit on the high side for most LEDs. 
We used to use constant current diodes which don't seem to be that popular any more or a JFET with the gate connected to the source. 
There were some that limited the current to 15ma which was just right. 

Where I use these types of devices rather than just a resistor to limit the LED current is for circuits that need to work in both, DCC and DC powered layouts. 

Knut


----------



## Greg Elmassian (Jan 3, 2008)

I agree Knut, many modern LEDs are fine at 10 ma. In my Accucraft locos, they came from the factory running at 6 ma. 

If there was a wider range of current values available in the CL2 line, or perhaps the spare lead could switch from 20 ma to 10 ma it would be a much more universal product. 

Case in point: many people want to reduce the current consumption in passenger cars, but the pre-made light boards or strip lighting is made to run at 12 volts and 20 ma per led... way overkill, and with a string of 10 cars, the current used by the train can still exceed that of the locos. 

By cutting down to more in series and 10 ma, it really makes a difference in total current. 

Greg


----------



## krs (Feb 29, 2008)

We used to use the BF256C FET which limited the current to about 14ma, the "B" version current was 6.5ma 
But that FET has been discontinued. 
The replacement listed is the BF 245C but I haven't tried that yet as a constant current source. 

Knut


----------



## Dick Friedman (Aug 19, 2008)

It's really easy if you're not paying attention (DON'T ask me how I know this)! Dave's hint's are gold. I find the LED driver idea best if you do not know how many LED's you're going to be powering at any given time, for example, in a passenger train. I usually use four or five LED's in a car, and can connect two to six cars into a train. I use the LED driver circuit to collect power from the track, rectify it (so it's alway going in the same direction, regardless of the train direction) and send it, via mu cables from car to car. The LED's are in parallel (not series) with as many as half a dozen cars being powered from the circuit.

Now that I have PC Boards for the LED power supplies, I don't get the driver in backward, and they work fine. Right now, I've got one attached to my track to show dead joints. I've got about a dozen LED's on the circuit, they all glow brightly when the joints are good. Not at all where I've got work to do!

Greg is right about cost. A resistor is just a few cents. A CL2 is about $.40 from Mouser. Buy a lot at once; the shipping is as much as a dozen CL2's. And for powering a single LED, the driver doesn't make much sense.


----------



## Greg Elmassian (Jan 3, 2008)

Knut: What circuit and components did you use with the FET to make a current source? 

By the way, I found 1,500 of them in stock the first place I looked... 

http://www.mouser.com/Search/ProductDetail.aspx?qs=ljbEvF4DwOO6iYiszHiZxA== 

Greg


----------



## krs (Feb 29, 2008)

For the current source we just used that particular FET, no additional components.

This is basically how constant current diodes are "created" - except trying to find an inexpensive one that provides somewhere between 12 and 15 ma is not that easy and they tend to be a bit expensive.
This JFET used to be dirt cheap.










The other option we used was an LM 317 regulator and one resistor wired as a constant current source.
With that arrangement, one can choose the resistor value to provide the constant current one wants.

Also pretty cheap if you get the 100 ma version of the LM317

I actually saw the Mouser page and decided the component was too expensive.
Then with a bit more checking I found out that it was a discontinued item which explains the high price.
We only paid about 7 cents in quantities of 25 or so.
The BF 256 replacement might be a better choice today, but someone would have to test it in this configuration.

Regards,

Knut


----------



## toddalin (Jan 4, 2008)

OK, this is slightly off-topic but, I have to share.

I was redoing my mine and wanted red flashing 12 volt LEDs. I order 10 with resistors for 12 volts from a Chinese seller on the 'bay. Eventually they arrived and I looked at the resistors and they were only 5.6 ohms. Seems a bit low, but hey, maybe their flashing LEDs are different than all the rest. So I tried one and as expected it instantly fried.

I let them know and they sent out 10 replacement resistors and an LED. This time they were 5.7 ohms so no sense in burning up another LED.

I let them know and they said their guy had made a mistake, but things have been corrected and they promised to 24 hour them (we are now over two months into this). This was the week before last.

So today I receive the replacement resistors..., ten 220K ohm (yes 220 THOUSAND ohm) 1-watt resistors. The LEDs don't even give a faint glow on 12 volts.

Guess I'll ask for another set tomorrow. While my parts bin is getting stocked, they are not values that I typically would use.


----------



## Madman (Jan 5, 2008)

That's odd. I have ordered numerous LED/resistor sets, prewired, from those Chinese guys without ever an issue.


----------



## toddalin (Jan 4, 2008)

Posted By Madman on 04 Jul 2012 04:47 AM 
That's odd. I have ordered numerous LED/resistor sets, prewired, from those Chinese guys without ever an issue. 

These are not prewired and the resistors are in a separate bag. They asked me how to make this right and I said "Send the right value resistors. Do you know what they are?" And the guy replied, 470 ohm, 1/4 watt. So hopefully they will get it right next time.


----------



## GrizzlyFlatsFan (Jan 5, 2008)

Posted By toddalin on 04 Jul 2012 11:05 AM 
Posted By Madman on 04 Jul 2012 04:47 AM 
That's odd. I have ordered numerous LED/resistor sets, prewired, from those Chinese guys without ever an issue. 

These are not prewired and the resistors are in a separate bag. They asked me how to make this right and I said "Send the right value resistors. Do you know what they are?" And the guy replied, 470 ohm, 1/4 watt. So hopefully they will get it right next time. 
You had better send them a color code guide. They don't know how to read the resistor code. There may also be other 'problems'.


----------



## Michael W (Oct 10, 2012)

Well if as long as you get the resistors for fre, I would gladly take them till you get the right one, after all you get free stuff.... I usually just go down to the local electronic shop and buy the bits i need, mostly the price difference is just cents anyway... 
Kind regards michael


----------



## Dick413 (Jan 7, 2008)

I have ? if your runing a batt. what voltage do you use? do you use say 14.8 or the full chg. voltage over 16.5 to cal. the resistor. 
thanks dick


----------



## Greg Elmassian (Jan 3, 2008)

nominal voltage.... there's enough "play" in the components to "withstand" the 16.5 volts that does not last long anyway. 

Greg


----------



## astrayelmgod (Jan 2, 2008)

LEDs aren't even remotely that critical. Just keep the current between 3 and 20 mA, depending on the LED and how bright you want them and what your power budget is, and everything will be fine.


----------



## Dick413 (Jan 7, 2008)

Thank you for the answers 
dick


----------



## Greg Elmassian (Jan 3, 2008)

Actually, 2 volts of difference could be a lot if your supply voltage was lower... try the calculator with 5 volts and then put that same resistor in a circuit with 7 volts and see the difference in current. 

The best and easiest thing to do is use the calculator and see what values you get. 

Rather than argue, try it yourself... 5 volt supply, 20 ma to the led... then put that resistor in a 7 volt circuit. 

Advice: use the calculator (or of course Ohms law) when in doubt. 

Greg


----------

