Pages: [1]   Go Down
Author Topic: Component Placement in a circuit  (Read 710 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 26, 2010, 11:58:14 am by Ridd » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26180
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I updated my original post.
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It works, you just don't realize that it works smiley

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are right smiley 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.
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great. Thanks.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5570
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

 smiley
Logged

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

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1383
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
« Last Edit: October 26, 2010, 06:13:19 pm by Osgeld » Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
(besides water is a horrible analogy to electricity)

Yes, because there is a big difference between being electrocuted and drowning.  smiley-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.

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lol.

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

Pages: [1]   Go Up
Jump to: