I'm very new to electronics and raspberry pi and trying to follow this tutorial.

When I check the circuit the resistor is connected between the ground and the LED to limit the amount of current that is passed to the LED.

Is it safe to assume the flow of current is from negative to positive in the raspberry pi?

  • That is not a simple question (google traditional current flow vs. electron flow). However, what I think is behind your question is the placement of the resistor; the circuit would work the same if you placed the resistor between the positive rail of the breadboard and the anode of the LED (longer leg), and connect the other side of the LED directly to ground. Oct 14, 2017 at 11:54
  • Yes, that's correct..My question is more related to where I place the resistor.? What would be the right convention to follow? Oct 14, 2017 at 12:05

1 Answer 1


Current ALWAYS flows in a circuit.

In this simple example the current flows from the Power Supply -> Pi -> GPIO pin -> LED -> resistor -> Ground (and thus back to the Power Supply).

In a series circuit it makes no difference which order the components are connected (although with polarised components, such as the LED, they need to be connected the right way round).

I should point out that while the article you linked is a good beginners description, it contains a number of factual errors, in particular the resistor colour code.

From an purist engineering point of view the best connection would be +3.3V -> resistor -> LED -> GPIO pin (just to be clear the GPIO pin then needs to be LOW to light the LED).

  • thanks much..The LED needs less amps, if the more current flows from GPIO pin to LED won't it be affected..How does the series circuit manages it to allow only less current to LED even though its not in the right order? Oct 14, 2017 at 12:17
  • From an purist engineering point of view the best connection would be +3.3V -> resistor -> LED -> GPIO pin...This really makes sense..:)..thanks Oct 14, 2017 at 12:23
  • To calculate current you need to know which kind of LED. A red LED would typically be ~1.8V so the current would be (3.3 - 1.8) / 330 -> ~4.5mA Orange and especially Blue LEDs need higher voltage. NOTE the Pi can safely supply up to 16mA
    – Milliways
    Oct 14, 2017 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.