How to calculate what resistor a LED requires

I have a LED which was advertised as 5V and 1W.

How do I know what size resistor I would need for it?

The key spec to look for on LEDs is the current rating (350mA is what it's spec'ed at, so that's the most you should put through it.

They should (but sometimes don't) specify the forward voltage at that current. That one doesn't seem to; you can assume ~3.2v for a blue/white/green LED (reds are more like 2v, yellows inbetween).

Then use Ohm's Law - if powering with 5v, you need to drop 1.8v (let's call it 2) at 350mA so you need 5.7 ohms. 2 volts at 0.350mA is 0.7W, so you need at least a 1W resistor. When using resistors on high power LEDs, you should give it some extra margin, since the forward voltage drop of the LED falls a little as it gets hot, leading to more current.

OR you can use a constant current driver - I like the AMC7135 for 350mA LEDs; they're a simple 3-terminal linear constant current regulator, and they're cheap as dirt. The AMC7140 is good for higher current LEDs - there are also oodles of parts available that are meant to drive LEDs at constant current using buck or boost converters. These do a much better job at providing the appropriate current to the load than resistors do.

For a 200mA LED like this, I’d not use a resistor. Instead, I’d use a switch mode constant current regulator. There are many out there designed specifically to drive LEDs like this.

Oh, yeah, those do specify the forward voltage drop, 3.15 to 3.4v.
Somehow missed that first time around.

Also - pro tip with those LEDs: Use the 3W ones and run em at 350mA (like they were a 1W one*). You’ll get a little more light with a slightly lower Vf, since the 3W ones have a bigger die. The price on the 3W ones is barely higher than the 1W ones (at least via eBay - that vendor you linked above is way overpriced; you can get 5 1W ones with the star PCB for 99 cents with free shipping, search for “led bead” along with whatever other qualifiers you want)

• The 3W ones are normally run at 700mA and 3.4-3.8v, which doesn’t actually add up to 3W. The “1W” red ones are also rated for 350mA - despite running at ~2.1-2.3v, which works out to 700-800mW. Gotta love the specs on imports, eh?

Ok what is the difference between using a resistor vs constant current regulator? Ive seen that in a few posts now.

I seem to understand that LM317 and LM7805 are both voltage regulators which basically bring the voltage down to 5V, but the LM317 is variable whereas the LM7805 is a fixed 5V regulator. I want to understand what will happen a bit more so that I can consider if I could use the LM7805 because I dont have an LM317.

Im looking at this tut: http://www.electrodragon.com/w/index.php?title=High_Power_LED

The 7805 brings the voltage down to 5v. The 317 is adjustable - effectively, it's a 1.25v regulator. Thus, they use a large "sense" resistor that will have that voltage drop at the desired current, and you need to feed it with enough voltage headroom to cover the regulator's dropout plus that 1.25v sense.

To do that with a 7805, you would need a resistor that had a 5v voltage drop at that current - and it would need to be beefy enough to sink all that power without melting (most resistors are 1/2 watt or 1/4 watt, you'd need a 2w minimum, preferably a 3W), and you'd need to supply it with at least like 10v (because you need 5v + dropout + led voltage), at the full 350mA (so about 70% of the power you put in is being wasted to heat up the resistor and regulator)...

You should purchase an appropriate regulator, rather than trying to bully a 7805 into doing this (I again reiterate my support for AMC7135's - they're dirt cheap, and literally made specifically for driving these LEDs - they have very, very low dropout, less than half a volt, and require no external components except maybe a decoupling cap - which I've routinely omitted without issue while using them)

Yeah, its not so much a matter of cost, but accessibility. Im not in the US, I cant just go into a store and ask for something like that, we barely have stores that sell buttons and switches and pots.

I guess ill just have to tear apart some old electronics or something until I can get some from ebay.

Marciokoko:
I have a LED which was advertised as 5V and 1W.

How do I know what size resistor I would need for it?

The “5volt” part is the maximum reverse voltage (if you connect it the wrong way round) before it dies.
It has nothing to do with the working voltage.

The “1watt” part is the maximum power dissipation allowed.
3watt LEDs on a star base are about the same price, and give you a bit more safety margin.

White/Green/Blue LEDs have a forward working voltage (Vf) of ~3.3volt. Red ones ~2.4volt.

If you have e.g. 5volt available, and want to use a white LED with a current limiting resistor, then the resistor has to drop 5-3.3 = 1.7volt.
You can work out the value of the resistor at the LED current you want with Ohm’s law.
1watt LEDs have to stay under ~300mA (3.3volt x 300mA = 1watt).
So the minimum value would be 1.7volt/0.3Amp = 5.6ohm

You will soon find out that the resistors gets hot. 1.7volt * 0.3Amp = 0.5watt

Switching constant current LED drivers do not use resistors to regulate current.
They use fets/inductors and are >90% efficient (no heat).

The circuit you linked to uses an LM317 as variable resistor.
Bad, because like a fixed resistor all the power is turned into heat.
That circuit also needs at least 3volts to work, so you need at least 6.3volt to drive a single LED.
The only advantage of an active circuit like that is that LED current is independent of supply voltage.

Yes, you can use the 7805 as constant current source (Google it).
The resistor between out and ground has to be 5 / 0.3 = 16.66ohm for 300mA, and would burn 5 * 0.3 = 1.5watt.
You would have to use a 12volt supply, and the 7805 would burn an additional 12 - 5 - 3.3 = 3.7 * 0.3 = 1.1watt.
3.6 watt to power a 1watt LED!!

A switching CC LED driver could do the same, and use ~1.1watt (<100mA) from the 12volt supply. No heat.
Leo…

Ok, I already put a few AMC7135 in the amazon cart.

Wawa,

This:

That circuit also needs at least 3volts to work, so you need at least 6.3volt to drive a single LED.

is because we need 3V as Vf for the led, so if the LM317 has a 3v drop, we need 3 more left over to power our LED? Is that 3V drop a spec on the LM317 datasheet?

and where does the 12V power supply figure in here:

Yes, you can use the 7805 as constant current source (Google it).
The resistor between out and ground has to be 5 / 0.3 = 16.66ohm for 300mA, and would burn 5 * 0.3 = 1.5watt.
You would have to use a 12volt supply, and the 7805 would burn an additional 12 - 5 - 3.3 = 3.7 * 0.3 = 1.1watt.
3.6 watt to power a 1watt LED!!

Thanks

The LM317 (and 78xx) regulators) all need at least ~1.7volt across to work properly.
You can find that dropout voltage in the datasheet.
Plus the 1.25volt drop across the current sense resistor (5volt for the 7805).

The example would at least need 3.3volt(LED) + ~2volt(7805) + 5volt(current sense resistor) = 10.3volt.

The AMC7135 is a LINEAIR regulator, like the resistor and the LM317.
It converts excess voltage into heat.
Only ok if you power e.g. a 3.3volt LED from a 3.7volt LiPo battery or a 5volt power source.
Or three 3.3volt LEDs in series from 12volt.
These chips have a much lower dropout voltage than the LM317 (0.12volt), but keep the voltage across <3volt.
Leo…

The AMC7135 is a LINEAIR regulator, like the resistor and the LM317.
It converts excess voltage into heat.

Yes but that is why we have heat sinks.

Marciokoko:
Ok what is the difference between using a resistor vs constant current regulator? Ive seen that in a few posts now.

The resistor wastes power as heat. The constant-current switch-mode regulator doesn't waste voltage, it
tracks the voltage to just that needed to make the programmed current flow in the load - less waste,
less heat to get rid of.

Ok im looking at the LM7805 datasheet:

and I can see the 2V dropout voltage. But when looking at the LM317 datasheet I cant find it:

Im guessing since its a transistor in nature, that 2V min is like the Vthreshold?

And then there is a 1.25V drop across the current sense resistor in the LM317 and a 5V drop across the current sense resistor in the LM7805. What are those values called in the datasheet?

317 is similar to the 7805. It's the same era - I think similar dropout voltage.

It's called the output voltage Look at how you hook the 317 up as current regulator (or how you'd hook it up for the 7805) - The ADJ pin is tied to the load instead of ground - so it tries to drive Vout (tied to one end of the sense resistor) to it's-output-voltage higher than the ADJ pin...

Marciokoko:
...the 2V dropout voltage. But when looking at the LM317 datasheet I cant find it

There is a dropout voltage graph on Page4.
Leo..

Ok so I've been looking thru youtube videos on voltage regulators and specifically lm317 and lm7805.

First, looking back to why I need this instead of a resistor, I understand that a resistor is a fixed value regulator, because the voltage drop across the resistor is a fixed value. The reason why you don't use fixed voltage regulator (like a resistor) with a LED is because they waste too much heat?

So instead we use a linear voltage regulator like lm7805 or lm317. The difference is 7805 is a fixed output value regulator which is very similar in terms of 'wasted energy as heat' as the resistor in that if you put in 12V, it'll waste 7V as heat to give you 5V. I guess there is a limit to how much input V you can feed an LM7805 (which seems to be between 35-40V).

An LM317 is adjustable and thus instead of having Vin, Vout and Ground, you get Vin, Vout and Adjustable. Now Ive seen a few videos where they use a POT at the ADJ pin of the LM317 but I understand you can control that using different value resistors as well. My lingering doubt is, when they mean "ADJUSTABLE" that means it can be adjusted from 0 to Vin? In other words, its adjustable between 0 up to whatever the maximum Voltage input from the power source (minus some V drop due to internals or something like that)?

Marciokoko:
Ok so I've been looking thru youtube videos on voltage regulators and specifically lm317 and lm7805.

I thought we were talking about current regulators.

Marciokoko:
First, looking back to why I need this instead of a resistor, I understand that a resistor is a fixed value regulator, because the voltage drop across the resistor is a fixed value.

The reason why you don't use fixed voltage regulator (like a resistor) with a LED is because they waste too much heat?

1. Yes. A resistor is fine if e.g. the supply voltage stays the same.
You would use a resistor if you have to limit the current for a LED on a regulated 5volt supply or Arduino output.

2. No. A current regulator can cope with a varying voltage source, e.g. a 9volt battery.
The active current regulator and the passive resistor would waste the same. Same heat.

Marciokoko:
An LM317 is adjustable and thus instead of having Vin, Vout and Ground, you get Vin, Vout and Adjustable. Now Ive seen a few videos where they use a POT at the ADJ pin of the LM317 but I understand you can control that using different value resistors as well. My lingering doubt is, when they mean "ADJUSTABLE" that means it can be adjusted from 0 to Vin? In other words, its adjustable between 0 up to whatever the maximum Voltage input from the power source (minus some V drop due to internals or something like that)?

The LM317 is a fixed 1.25volt regulator. An external voltage divider could turn it into a variable voltage regulator.
An single external resistor could turn it into a current source.
Same difference for the 7805, except it's 5volt instead of 1.25volt.
Leo..

You use a regulator because they actively control the output.
The voltage across a resistor varies with current. A resistor divider is thus not a good idea unless the current thru the 2 resistors is ~ 10x the current being used by the load.

With a small LED where the current is like 10-20mA, a resistor is fine.
(Vs - Vf of LED)/current = resistor value. Assume 5V and 3.2V LED and you want 10mA:
(5V - 3.2V)/.01A = 180 ohm.
If you have a 1W LED, you need an active current controlled part because the current thru the LED will increase as the LED heats up and you will get into a runaway condition and burn out the LED. So a part like this is used:
https://www.fairchildsemi.com/datasheets/FA/FAN5331.pdf
You select the components for the current you want and the part acts like a little switching regulator to allow the selected current to flow and keep the LED from burning up.
They can usually handle a string of LEDs, so 5 or 6 LEDs with Vf of 3V for example and a 20V supply could be used.

If you have a 1W LED, you need an active current controlled part because the current thru the LED will increase as the LED heats up and you will get into a runaway condition and burn out the LED.

I think that's not a real problem with enough overhead voltage for the current limiting resisor.
A 1watt LED I measured had a Vf difference of ~0.2volt between cold and very hot.
You always calculate the resistor for the "hot" condition.

And yes, I always use switching CC drivers for power LEDs.
A cheap-as-chips one is the PT4115.
Leo..

Marciokoko:
Ok so I've been looking thru youtube videos on voltage regulators and specifically lm317 and lm7805.

First, looking back to why I need this instead of a resistor, I understand that a resistor is a fixed value regulator, because the voltage drop across the resistor is a fixed value. The reason why you don't use fixed voltage regulator (like a resistor) with a LED is because they waste too much heat?

You are completely misunderstanding a resistor - the voltage drop across a resistor is dependent on the current through the resistor and can be calculated with basic ohms law where V=IR where "V" is the voltage, "I" is the current and "R" is the resistance in ohms. The resistance stays the same for a fixed resistor (well for all practical purposes) but the drop across the resistor (V) is a function of the current - the drop is only a constant if the current through the resistor remains the same. So, while a resistor does provide a constant drop for a constant current, anything that changes the current (or voltage supplied to the circuit for example) will change the drop across that resistor which is why it can't be used as a "fixed voltage regulator" - it is a fixed voltage drop across the resistor for a given current, but that is not the same as a "voltage regulator".