Go Down

Topic: Component Placement in a circuit (Read 771 times) previous topic - next topic

Ridd

Oct 26, 2010, 06:40 pm Last Edit: Oct 26, 2010, 06:58 pm by Ridd Reason: 1
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)

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

4. (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.

AWOL

There is no reason, except perhaps the orientation of the diode, which you haven't shown.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Ridd


RuggedCircuits

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

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

Ridd

You are right :) 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.

RuggedCircuits

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


cr0sh

Quote
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...

:)
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

jackrae

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.

Jack

Osgeld

#9
Oct 27, 2010, 01:11 am Last Edit: Oct 27, 2010, 01:13 am by Osgeld Reason: 1
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)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

retrolefty

Quote
(besides water is a horrible analogy to electricity)


Yes, because there is a big difference between being electrocuted and drowning.  ;)

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

Lefty

Ridd

Lol.

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

Go Up