Project 02 - led and resistor connection question


I'm new to electronics and have a question about the wiring for project 02

Pins 3,4 and 5 are set to OUTPUT and connect directly to the anodes of 3 LEDs. The cathodes of each then lead to a 220-ohm resistor, which then connect to earth

I'm confused by this because in project 01 a 220-ohm resistor sat in between live and the anode of a LED apparently to protect it from burning out (it mentioned that 23 milliamps was the maximum that could safely flow through the LED).

In project 02 it seems that the resistors are connected at a point after the current has entered the LED so I don't understand how they are protecting the LEDs (which they obviously are because nothing's melting : )

It seems that I'm missing some fundamental understanding about the flow of current. Can someone correct my thinking please?


Pin-LED-Resistor-GND and Pin-Resistor-LED-GND are the same electrically, just 1 series circuit. Order of LED/Resistor does not matter. Each LED needs a resistor tho, unless your code will ensure that only 1 at a time will be on. Otherwise brightness will vary as you 1, 2, or 3 on.

OK that's great.

I wondered if that might be the case. Thanks for adjusting my thinking :)

I had this same question, and it's helpful to know. However, does anyone know why the order of resistor and LED doesn't matter in a simple circuit? When does it matter?

Current thru both parts is the same - thus, it never matters.

My first post! Maybe this will help to clarify about the position of the Led and Resistor. Think about plumbing and imagine the current flowing through your circuit is water. Its easy to see how water is restricted to flow only as fast as the smallest pipe will let it. The small pipe is the resistor in your circuit and the effect is that current slows on both sides of it. The current behaves like water would. So your LED is not going to over heat no matter what side of the resistor it is on. This analogy helped me grasp the current concept better and I hope it helps everyone.


I just registered to ask this exact same question. It was a little strange to see someone else asked it.

I thought from project 1 that the resistor needed to be before the LED in order to prevent the LED from burning out. Then, in project 2 the resistor is on the other side of the LED, and the book really didn't explain why this was the case.

Thanks for the explanation!

Hello all, I'm new in Arduino and eletronic, what is the correct way to connect the led?

The Led there is two connections anodes and cathodes where, anodes = '+' and cathodes = '-' right?

Arduino has GND and Pin 13 (in my case I'm using Pin 13), where I have to connect GND and Pin 13 in my Led? Does GND = anode and Pin 13 in cathode?


Cathode to GND.