Project 02 - why 220ohm resistor is needed?

Two questions regarding Project 02 - spaceship interface
Please bear with me electronics is a new concept to me :slight_smile:

  • Why there is 220ohm resistor on the ground of each led diode? They are anyway connected to arduino otput, so why it's needed to pull down the current? It works the same if resistor is replaced with a wire.
  • Also why 220ohm? If I understood correctly digital output is 40mA so I would expect greater value resistor if we want to level it to zero?

All LEDs on any circuit require a current limiting resistor to limit the current to typical 20 mA level which is why we picked 220 ohm for a 5 volt supply. If we use 12 or 24 volts we need a higher value resistor. Also different color LEDs have different current levels. If you use just a plain wire the LED will come on briefly but soon burn out think of it being current hungry. The 40 mA rating is how much current the Arduino can safely supply before it burns out. Therefore we can't drive a 10 Amp motor directly with an Arduino.

Thanks Rogertee,

I also did my research on how circuits and electricity works at all. I'ts more like belt than a flow, as explained by user endolith here, I was somehow imagining power "comes" from + side, so was confused why resistor is on ground.

That resistor has one purpose to limit the LED current you could put it on the other side of the LED to do the same. It's conventional to put it on ground. Check out how LEDs work and it will become clear