user353: I'm designing an Arduino style board with built-in LEDs for several of the pins. To simplify assembly of the board and save on components, I was wondering whether it would be safe for those LEDs to share a single resistor, as in this diagram:

Obviously, the power dissipated through the resistor (3mA per pin @ 3V) is not a real problem. The reason I was hesitating is that LEDs in a parallel configuration should not share resistors, but is it safe to think that separate microcontroller pins don't count as a common anode, even if both pins are high?

user3607: 
Can two LEDs attached to different pins share their resistor?


can : yes
should : probably not

Your resistor act here as a current limiter, say to 3mA
If you light one LED at a time, you give 3mA to that LED
If you light 2 LEDs, you give 3mA for both of them (more of less 1.5mA each)
If you light 3 LEDs, you give 3mA for all of them (on average 1mA each)
Things are even a little bit more subtle, as different LED might have different forward voltage, so one LED might very well drain 10% more current than an other.
As "Amps made LED bright", less Amp is less light. On LED light with that setup will give "full light on", and more LED you add, less would bright each one.

As an edit to that answer, there is one case I might consider that arrangement for "multi-LED lighting". This is if you are multiplexing your LEDs
That is lighting only one at a time, but cycling fast enough from one LED to the next so that the human eye would see them all lit at once.

user881: Your circuit is safe from the electronic viewpoint, so long as the LEDs used can withstand a back-emf of 4v or so. 
If only one LED is on at a time, all will be sweet. But if two or more are on, the brightness will drop and the brightness between LEDS will probably be inconsistent. The forward voltage drop of individual LEDS tend to vary a little, so one is likely to hog most of the available current. 
A separate resistor per LED is probably best.

353: <p>I'm designing an Arduino style board with built-in LEDs for several of the pins. To simplify assembly of the board and save on components, I was wondering whether it would be safe for those LEDs to share a single resistor, as in this diagram:</p>

<p><img src="https://i.stack.imgur.com/jWXVT.png" alt="schematic"></p>

<p>Obviously, the power dissipated through the resistor (3mA per pin @ 3V) is not a real problem. The reason I was hesitating is that LEDs in a parallel configuration should not share resistors, but is it safe to think that separate microcontroller pins don't count as a common anode, even if both pins are high?</p>
 3607: <blockquote>
  <p><strong>Can</strong> two LEDs attached to different pins share their resistor?</p>
</blockquote>

<ul>
<li><strong>can</strong> : yes</li>
<li><strong>should</strong> : probably not</li>
</ul>

<p>Your resistor act here as a current limiter, say to <em>3mA</em></p>

<p>If you light one LED at a time, you give 3mA to <em>that</em> LED
If you light 2 LEDs, you give 3mA for both of them (more of less 1.5mA each)
If you light 3 LEDs, you give 3mA for all of them (<em>on average</em> 1mA each)
<br><sub>Things are even a little bit more subtle, as different LED might have different forward voltage, so one LED might very well drain 10% more current than an other.</sub></p>

<p>As "Amps made LED bright", less Amp is less light. On LED light with that setup will give "full light on", and more LED you add, less would bright each one.</p>

<hr>

<p>As an edit to that answer, there is one case I might consider that arrangement for "multi-LED lighting". This is if you are <a href="http://en.wikipedia.org/wiki/Multiplexed_display">multiplexing your LEDs</a></p>

<p>That is lighting only one at a time, but cycling fast enough from one LED to the next so that the human eye would <em>see</em> them all lit at once.</p>
 881: <p>Your circuit is safe from the electronic viewpoint, so long as the LEDs used can withstand a back-emf of 4v or so. </p>

<p>If only one LED is on at a time, all will be sweet. But if two or more are on, the brightness will drop and the brightness between LEDS will probably be inconsistent. The forward voltage drop of individual LEDS tend to vary a little, so one is likely to hog most of the available current. </p>

<p>A separate resistor per LED is probably best.</p>
