I was reading the MAKE AVR programming. One of the chapters suggests to solder resistor to the cathode side of an LED.

But in our uni labs it's said to connect the resistor "before" the LED; that is connect the resistor to the anode.

Does the positioning of the resistor matter at all? In case of accidentally burning out the LED? If so, how?


No, it does not matter. There are several cases:

  • The LED works: in this case the resistor will limit the current flow, and does not matter if it is before or after, since it is connected serial.
  • The LED does not work:
    • Electricity flows through the LED: it would go through the resistor anyway, either if it is before or after the LED.
    • Electricity does not flow through the LED: current will not flow anyway through the resistor because the circuit is not closed.
  • \$\begingroup\$ I read up on some other forums about this. Does the following explaination hold no water then? "I've developed a preference of having the resistors on the anode side of the LED where possible, as accidentally shorting the LED's anode or cathode to ground won't hurt either the LED or the resistor. If the LEDs are on the more positive side of the resistor, accidentally shorting the cathode of the LED to ground will result in a fried LED." \$\endgroup\$ – Yasha Dec 21 '18 at 10:37
  • 4
    \$\begingroup\$ @Yasha That is true, however, you can say the same about accidentally connecting the the anode directly to VCC instead of going through the resistor. If the resistor would be after the LED, it would be protected. It's just the 'inverse' example. \$\endgroup\$ – Michel Keijzers Dec 21 '18 at 10:42

To light the LED, using the resistor to define the current, it doesn't matter which order they go in.

There may be some other non-electrical reasons for preferring one over the other in specific circumstances.

For instance, if you connect the LED directly to the PSU +ve, then accidentally shorting the LED to ground, as you might do with an untidy breadboard, will kill the LED. Resistor to PSU will be safer. This situation is asymmetric because shorts to ground are more common than shorts to PSU live when you're clowning around on a breadboard. This may be significant in your lab instructions.

There are other situations where multiplexing LEDs, or running them at various currents, is made easier by one or the other connection. This is asymmetric because of the popularity of low side switches, things like ULN280x and their ilk, which people tend to use for driving LEDs.

  • \$\begingroup\$ your example of shorting it accidentally to GND, isn't that the same when accidentally connecting it to GND on the other side? This is just the inverse example. \$\endgroup\$ – Michel Keijzers Dec 21 '18 at 10:46
  • 4
    \$\begingroup\$ @MichelKeijzers if you have (+)-R-L-(-) and you accidentally short the node between R and L to ground, the R will just let some more current flow; if you have (+)-L-R-(-) and short the inner node to ground the LED will see all the voltage and fry. Shorting the node with (+) to ground will always result in a short circuit. In the first example (+RL-) the led will fry if you connect the middle node to Vcc, but this happens more rarely than a short to ground \$\endgroup\$ – frarugi87 Dec 21 '18 at 13:17
  • \$\begingroup\$ @frarugi87 Thanks for the explanation (especially the last remark, that it happens more rarely. \$\endgroup\$ – Michel Keijzers Dec 21 '18 at 13:50

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