# Resistor before or after LED?

I just published a new video where I answer the question:

“Does the resistor go before or after the LED?”

If you don’t want to watch the video, I’ve attached the script below so you can read it instead:

—————————-
[VIDEO SCRIPT]:

This is an LED.

If the LED gets too much current flowing through it, it will burn out and die.

So it always needs a resistor to protect it.

But, in which order?

Here’s the thing…

It doesn’t matter!

The resistor can go before – or after – the LED, and it will still protect it.

You see…

the current that flows out of a battery is always equal to the current that flows back into the battery.

So in a circuit like this – with only one path for the current to flow – the current is the same everywhere in the circuit.

The current through the resistor is the same as the current through the LED.

Now, you might wonder – what controls the current then?

An LED has something called a “forward voltage”.

That’s the voltage drop the LED will have under normal conditions.

A typical forward voltage is 2V.

In a circuit with a 9V battery, an LED, and a resistor, you will have 2V across your LED.

The rest of the voltage – 7V – will be across the resistor.

Ohm’s law tells you that current equals voltage divided by resistance.

So if you have a 1000 Ohms resistor, you would get 7 divided by 1000 equals 0.007 – which is 7 mA.

Since the current is the same everywhere in the circuit, you’ll also get 7 mA through the LED – no matter if the resistor is before or after the LED.

What matters is the size of the resistor.

Keep On Soldering!
Oyvind @ build-electronic-circuits.com

## More Mail Archive Tutorials

### 14 thoughts on “Resistor before or after LED?”

1. what is the procedure to convert 15v dc to 5v dc

• The most common way is to use a voltage regulator.

2. That is the best write-up I’ve ever come across, but I still have unanswered basics. “Same current everywhere” with “the LED has a forward voltage”: Why hasn’t it typically been called “voltage drop”? It is so much more clear and standard talk. I find “forward voltage” very, very confusing. Concurrent with my question and the example, if it has a voltage drop of 2V, why isn’t that effecting the circuit’s total resistance? 0.007A was only figured on the resistor, but each gives a voltage drop. Is this the reason “forward voltage” is used because there is no resistance yet a v. drop? (Also it’s forward voltage would be much more intuitive if that were the voltage TO BE SUPPLIED). What do I care that the downstream voltage is 2V after normal conditions (of the LED)? It’s the supply to it that is important. Besides all that, it’s said they’re “current operated” (while voltage and current are related, and voltage is what creates the current anyway). This just baffles me. Please, please clear this up for me.

3. LouF, if you come across this again hopefully I can help clear things up.

LEDs, the D stands for diode. Diodes have an interesting property that they allow current to flow one way but not the other, which is why if you put your LED pins in the wrong way with respect to power and ground you won’t see any light. This makes them different from resistors which don’t care what order the pins are in, they resist current flow either way.

This makes diodes analogous to a hydraulic check valve, which is basically a hinged flap in a pipe. If water in the pipe is flowing one way, the flap will open and the water will keep flowing. If it’s flowing the other way, well the flap doesn’t open that way so it will block the flow. In both cases the pressure of water flow matters, which is analogous to voltage. If you are blowing into the pipe hard enough, the flap opens and all the water can get through. But if you don’t blow hard enough you won’t overcome the bit of resistance needed for the flap to open fully.

So the forward voltage is the minimum ‘pressure’ for current to flow and the light to activate. Or as you put it, minimum “voltage to be supplied”. Why the “forward” then? Because there’s also a “reverse voltage”, aka peak inverse voltage, which is the max voltage applied against the diode before it will break down. For the flap this might mean water pushing against it the wrong way with enough pressure to rip the flap off the hinges, or explode the surrounding pipe, or whatever, depending.

The analogy with water breaks down a bit in that with water a flap might be opened half-way with a certain pressure and still let some water flow, but with a diode the minimum voltage must be reached for any current to flow. Additionally the minimum voltage is technically dependent on several physical variables including temperature and the passing current, though for most purposes we ignore that and treat it as constant since the effects are small.

The difference in constancy is part of why we might not want to call it a ‘voltage drop’… A 100 ohm resistor is 100 ohms no matter the circuit, but the voltage drop over it depends on the current. An LED with a forward voltage of 2 volts is going to have that minimum no matter the circuit, no matter the current or source voltage. You subtract it like a voltage drop but you don’t have to compute it first from something else.

One thing this page doesn’t mention is that LED datasheets usually give a forward current too that was used in their test condition in determining the forward voltage. That current is usually the ‘optimal brightness’ for the LED and is commonly 20mA. This helps determine the size of the resistor to use in the current loop to help control the brightness while also avoiding burning out the LED.

• Yes, I have kept this active, and thank you for explaining. I didn’t know if the phrase meant pre- or post-component. “Trigger” may have been a more intuitive name for the industry to select.

The abstractness and sheer variety of semiconductor components is daunting.

Thank you again.

4. Reading it again, I can now understand why “forward” is used (along with “reverse”).

I’m completely good with understanding until the additional “forward current” is mentioned. I’m going to guess this is the specification usually used after it is known to be working above the forward voltage.

Also, (I apologise), forward voltage is to be used as a voltage drop past the LED e.g. LEDs in series?

5. Thanks Oyvind. Great explanation. Please explain how an LED works since it’s a diode but what makes the colors work. Also explain how does the flashing diodes work

Regarding Loufs understanding of forward and reverse bias concept he may need to understand that like charges repel and unlike charges attract each other (protons attract electron,) diode working concept relies on forward bias, that is when positive battery is connected to anode( Protons,) and negative of battery is connected to the Cathode (“electrons). Oyvind as per my query is this what prevents the diode from burning up as the cathode, (electron side) is connected directly to the battery negative side without a resistor. Now you confirmed that a resistor anywhere in that circuit will slowdown the electron speed through the LED.

6. If you are putting several (say 14) LED’s that are all the same and are rated for 3 volts, all in parallel on a circuit with a 3 volt power supply, do you need to add any resistors? One resistor for the whole circuit? One resistor for each LED? No resistors at all because the voltages match? I’ve found various sources/sites saying LED’s “always” need a resistor (because of variances in manufacturing) and others saying you don’t because the voltages match up. Can you help me with this? If all the similar LED’s are 3V and the power is 3V I wouldn’t even know what resistor(s) to use.

• Most likely, it would work – the LEDs would light up. But you don’t have any way of controlling the current through the LEDs. It’s up to the internal resistance of the battery to decide the current. It could be high, it could be low.

So it’s better to use a higher voltage and a resistor so that you take control of the current.

7. DOES THE RESISTOR COME BEFORE OR AFTER THE SWITCH?