-1
\$\begingroup\$

I wonder if anyone can help me, a complete beginner, with a very basic question? I currently have a red LED connected to a GPIO pin on a Raspberry Pi, and a green LED attached to a different GPIO pin. Both pins output 3.3v, and I have a 330 resistor on the anode of each LED. Ground is shared, as in the diagram below:

Diagram 1

I want to fit this onto as as small a PCB as possible. From my (very) basic understanding, I think I can get away with a single 330 resistor on the between the two LEDs and ground, as in this diagram:

enter image description here

Am I correct in this? Many thanks.

Edit: It seems that I have asked a question that has been raised multiple times. As a complete novice, I wasn't aware that this is regarded as the LEDs being in parallel (I thought that two power sources differentiated this from the other parallel LED questions I saw posted). Anyway, I thank those who took the time to help, and I will attempt to digest the responses.

\$\endgroup\$
  • \$\begingroup\$ Sounds like you may want to get used to handling 0603 components. \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 30 '15 at 15:37
  • 1
    \$\begingroup\$ This question is popping up here every few days. \$\endgroup\$ – Eugene Sh. Jun 30 '15 at 15:44
2
\$\begingroup\$

The RED LED will typically hog most of the current if you do that, and the GREEN one will get less current.

The reason is that at the forward voltage where the RED LED is fully illuminated, the GREEN LED will draw little current, and hence will emit little light.

In fact the pin output voltages will change a bit with lower current and if the LED is a red super-bright or HE type it might be almost acceptable.

If you drive only one on at a time, then it's definitely okay to use a single resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

Here's a simulation assuming the output pins of the micro look like 50 ohm resistors.

The currents are not all that bad. 2.8mA for the RED and 1.7mA for the GREEN.

If you assume the outputs look like 0.1 ohm resistors, the currents go to 3.4mA and 1.5mA.

It should be noted that this is highly dependent on the type of LEDs and similar types made with different technology may not work as well. As well, the current in (say) the GREEN LED will change greatly when the RED one is illuminated. Although your eye responds logarithmically so the absolute brightness won't look radically different, the change will be very visible.

\$\endgroup\$
0
\$\begingroup\$

Sure, you could do that. But then the single resistor will be used to sink current from both LEDs. This means that when both are on, each will have approximately (for a certain definition of "approximately") half the current than it would if it were on alone, resulting in a different brightness. So to clarify, you could do this, but you probably don't want to.

\$\endgroup\$
  • \$\begingroup\$ They will only share current if their forward voltage is very well matched. \$\endgroup\$ – Nick Johnson Jun 30 '15 at 15:37
0
\$\begingroup\$

This will work, but it is not best practice. Two diodes in parallel with a single resistor run the risk of one taking more current than the other. At worst case one led will eventually blow and then the other will as well. Typically, you will see both leds at half brightness when both are on.

If you want smaller, try doing with a bi color led, it has both colors in a single led case.

\$\endgroup\$
0
\$\begingroup\$

You can only do this if at most one LED will be powered on at a time. If they're both powered on, the bulk of the power will flow through whichever has the lower forward voltage, leaving the other one unlit unless they have very similar forward voltages.

Here's an example using the built in schematic editor:

schematic

simulate this circuit – Schematic created using CircuitLab

D1 has a forward voltage of 1.6 volts, and conducts twice the current of D2, with a forward voltage of 1.7 volts. The exact ratio will depend on the tolerances of the parts, and their I/V curve.

\$\endgroup\$

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