Component Placement in a circuit

Hi guys

This is a very beginner question that I couldn't seem to get a definitive answer to. So here goes...

I setup the following circuits with my Arduino... please could you explain to me why the one marked 'doesn't work' doesn't work.

  1. (5V) ----- resistor ------ (+)LED(-) ------ GND (works)

2 . (5V) ----- (+)LED(-) ------ resistor(-) ------ GND (works)

  1. (Pin D9) ------- resistor -----(+)LED(-) ---- GND (doesn't work)

  2. (Pin D9) -------(+)LED(-) ----- resistor ---- GND (works)

(Note. I programmed the microcontroller to put pin digital 9 to HIGH.)

I'm confused as to where I need to place the resistor in circuits and other components. Also why does 1. work but not 3. seeing that the only difference is that the positive charge is coming from the digital pin 9?

Thanks in advance.

There is no reason, except perhaps the orientation of the diode, which you haven't shown.

I updated my original post.

It works, you just don't realize that it works :slight_smile:

Really, there is no reason why if 4 works then 3 doesn't. Just check everything reaaallllly carefully and try again.

The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

You are right :slight_smile: there must have been some connection issue somewhere. Interesting. But just in general... should the resistor go before or after the LED, in the above circuits? i.e. which is best practice and why.

It doesn't matter....I'd go 51% with the resistor closer to the Arduino pin. Just for safety's sake, if you mistakenly short something out the resistor has a better chance of protecting the pin from overcurrent. Suppose you mistakenly short out the LED anode to GND. In configuration (4) that you drew you'd be shorting out the Arduino pin and quite possibly damaging the microcontroller. In configuration (3) the pin is protected by the resistor. Of course, you could always short the "wrong" end of the resistor to ground too, so it's no guarantee of anything.....

The Quick Shield: breakout all 28 pins to quick-connect terminals

Great. Thanks.

But just in general... should the resistor go before or after the LED, in the above circuits? i.e. which is best practice and why

My take on this is 1 or 3 - here's why:

It is common "sense" to envision current as flowing from high potential (voltage) to ground (ie, from positive to negative). In reality, this isn't true at all (and nothing really "flows" anyhow), but the visualization is easy to see.

Resistors are used to decrease current in a circuit (thus lowering the current through the LED in this case), so from the "flow" perspective above, it makes more sense that the current flows out the pin, goes thru the resistor (and lowering current), then thru the LED, then to ground.

Once again, in reality this isn't how it actually works, and it ultimately doesn't matter which side the resistor is on, as RuggedCircuits has already noted...


One of the analogies for electrical systems is plumbing, where we have pipe (wire), water(current), reservoirs, tanks or rivers (batteries or capacitors) and taps or faucets (resistors).

To control flow of water you always have the tap in the line before the appliance. Hence resistor goes before LED.


but again it does not really matter, to use plumbing if you have a restrictive area (ie resistor) anywhere in the line the end result will be less flow

(besides water is a horrible analogy to electricity)

(besides water is a horrible analogy to electricity)

Yes, because there is a big difference between being electrocuted and drowning. :wink:

No difference where you put the resistor in a series circuit. One of Kirchhoff's law says so. Probably a friend of Dr. Ohm.



Thanks guys. I would also agree that logically 1 & 3 are best practice.