Resistance and LED: on the anode or on the cathode?

Hi guys, newbie here :slight_smile:

I've read in some well-respected tutorials (like the one from the sparkfun starter kit) that you should put the resistor on the short (-) lead; some others put it on the long (+) one (like this one).

If I understand correctly, a diode only allows current to flow in one direction. So, if the aim is to protect the LED, it would make more sense to put the resistor before current flows through it, i.e. where the long lead is.

Why do some tutorials suggest to do just the opposite?

Thanks!

It is REALLY the same.
i will post some drawings for you in a few.

arkypita:
It is REALLY the same.

Thanks a lot for the prompt answer, but care to elaborate why?

Is the current not flowing into the + lead and out of the - one? How can it be the same?

The resistor and LED are in series, and the same current will flow through both of them.

Say you had a common anode RGB LED; resistor go on the cathodes.
Say you had a common cathode RGB LED; resistor go on the anodes.
No difference in functionality.
So why would it matter which side on a single LED? Answer: it doesn't.

The role of resistance in a circuit powersource/resistance/LED/ground is essentially limiting the current that flows through the LED.
To work properly a LED needs a current of about 15-20mA (or more if it is a high brightness LED).

Without a resistance the LED would tend to absorb all of the current that the source (in our case the arduino pin which feeds it) can provide. The LED might burn if the source can provide a lot of current (i.e. a battery car) or the generator could be damaged.

Because the LED has a fixed voltage drop of 1.5V (it is a common value, but different LED could have different voltage drop) the resistance value to be used is calculated as [R = (Vcc - 1.5) / I] as ohm laws tell.

In a simple case as a 5v power from the resistance value is suitable: (5 - 1.5) V / 0.015A = 233ohm.
The commercial value of 220ohm would be fine.

Like Leon Heller say resistor and led are series-connected, both if you connect source/resistor/led/ground or source/led/resistor/ground, so the current flow will be the same.

If you have a digital/analog multimeter try to build the first 2 circuit in attachment (use 220ohm as resistor) and measure the current flow: It will be the same. Try to measure voltage on resistor, and voltage on diode: it will be the same. Try to use an higher resistor (i.e. 470ohm) and you will measure a lower current flow and, of course, your LED look less bright. Try to remove resistor as in third circuit if you want to burn your LED!

aaa.bmp (24 KB)

What you must remember is that current has to flow round all the circuit or else it dosn't flow at all.
The same current is flowing through both components so it matters not which way round the components are.