# Where to place a resistor.

I feel quite ashamed to ask this question but please tolerate the ramblings of an older fool. I have the starter kit and I've done the so-called Spaceship Interface chapter. There's no need to dwell on the wiring of it except to encapsulate one example from the chapter where pin 5 on the Uno goes into the anode of an LED and from there the cathode goes into a 220 Ohm resistor and the resistor goes into the ground line.

Post-experiment, I wired that LED differently taking pin 5 into the resistor first which goes into the anode and then placing a direct wire from the cathode to the ground line. In short, sort of reversing the construction as it were. I half-expected the circuit should work the same and it did. That got me thinking about where the resistor really needs to go.

What I've read about the LEDs in the starter kit is that they're rated for 3v and 20mA? Further, what I understand about LEDs is that the resistor should go before the anode to protect the LED and not after it. I'd appreciate some comments and feedback.

In a single series circuit, like this, the resistor can go before or after ..

where the resistor really needs to go.

Either position it does not matter, ther is no correct position.

arduino_obc_and_rbc:
... to protect the LED

It will protect the LED, that is true.
But the main reason for using the resistor should be to protect your Arduino.
An Arduino pin is limited in the current it can output (absolute max of 40 mA.)
You should stay away as far as possible if you can, and that's the most important reason to use a current limiting resistor.

MAS3:

arduino_obc_and_rbc:
... to protect the LED

It will protect the LED, that is true.
But the main reason for using the resistor should be to protect your Arduino.
An Arduino pin is limited in the current it can output (absolute max of 40 mA.)
You should stay away as far as possible if you can, and that's the most important reason to use a current limiting resistor.

And you assume he is using an Arduino?

I am.

cjdelphi:

MAS3:

arduino_obc_and_rbc:
... to protect the LED

It will protect the LED, that is true.
But the main reason for using the resistor should be to protect your Arduino.
An Arduino pin is limited in the current it can output (absolute max of 40 mA.)
You should stay away as far as possible if you can, and that's the most important reason to use a current limiting resistor.

And you assume he is using an Arduino?

you should have read the OP

...where pin 5 on the Uno goes...

I don't think he was talking about a Fiat

The resistor limits the current throughout the entire wire. Think of it as a pipe filled with marbles, you stand at the beginning of the pipe and add marbles and I am at the end of the pipe and I use my hand to make it difficult for you to push the marbles in. Even though I am at the end of the pipe resisting the flow of marbles, the marbles at the beginning of the pipe are also resisted.

Current does not only slow down at the resistor. The entire series line the resistor is placed in has reduced current due to resistor.

Thanks for clearing up some misconceptions on my part. I made the assumption that what you did upstream before the LED affected only the downstream from that point only. But applied to the whole line, then yes, I can see what you're getting at.

That is why it is irrelevant as to what direction current actually flows in.