I am loving the Arduio kit, and am almost done with all the projects. My brother-in-law wanted to learn a little as well, and so we started back at the beginning again. He is a little younger than me and wanted me to explain how everything worked. I am by no means an electronics expert, but I read through the book and thought I 'got' most everything.
I did hit a snag, though, as something the kit books says doesn't quite make sense to me in practice: according to the project book (and I guess electrical theory in general) a resistor is designed to 'eat up' some energy so that it allows components like an LED to not just take in the full 5v. That makes total sense! It specifically says that "You use a resistor in series with the LED to keep it from receiving too much voltage. Without the resistor, the LED would be brier for a few moments, but quickly burn out!" (p. 25).
This is totally in-line with the first diagram:
As you can see, the 5v from the board is being resisted by a 220ohm resistor. Keep the LED safe. Got it.
However, if you take a look at the first major project (the spaceship) the resistor placement seems backwards:
My guess is that there is a full 5v coming out from the board via the digital PWM pin outputs--why is there not resistor between the pin output and the LED? In addition, why is a resistor needed when going to the ground wire--that does not makes sense to me, as my understanding is that the electricity has already gone through the LED--why would the ground need resisted electricity?
Any insights or explanations would be awesome. I tried to look this up, but don't think I understood enough about the question to find an answer.
the resistor limits the current going through the LED and the current needs a path from the plus and minus/gnd to flow through. You can put your resistor on either side of the LED. For 5 volts a 220 ohm resistor is common but go up to 12 volts you need bigger resistor. I max = 5v/220 ohm =22.7 mA without the LED. As long as your current is less than the safe max for the LED nothing burns. Also we don't want to exceed the Arduino max current output see page 30. And get a multimeter .