Project 2 - Resistor from Cathode?

I'm confused by why in project 2, the resistor is behind the LED? And not before the LED to protect it from burning out? Or am i getting this wrong?


Order does not matter. Current will be limited by the resistor both ways.

CrossRoads: Order does not matter. Current will be limited by the resistor both ways.

Thank you very much! Is there a best practice? Or the way most people do it or does it really not matter? Oh and for the digital outs, do you need a resistor? Or will the led not be destroyed from digital out?


Best practice, I don't think so. LED will not be destroyed from digital out if you are using a current limit resistor.

So many people ask this same question. I wish the book would have explained why they did this. It's not instantly obvious when you are just starting out that you can put the resistor on either side.

So I'm wondering why doesn't this work at other times?

Sorry about the bad pictures, but I think you can get the point...

On one picture. I put the power into one side of the switch, and the resistor on the other side, then a green wire to Arduino on the side with the resistor. This works fine.

On the other picture I plug the resistor before the switch, a black wire to ground and the green to Arduino. This does nothing. Arduino is never informed when the switch is pushed.

If I try another hookup, putting a red wire from power, and a 10k ohm resistor on one side of the switch, and ground and green to Arduino on the other side, the Arduino craps out and turns off when I press the switch... So that's clearly wrong.

I don't understand what makes a difference. Why can't I put the resistor after the switch, like I can with an LED, and why does hooking both power and resistor to the same side make the Arduino crap out?

Top picture nothing happens (resistor from power to switch, green Arduino, black ground). Middle picture works fine (resistor going to ground, green Arduino). Bottom picture, resistor going to power, Arduino craps out.




Does this make sense?