Electrical – Connect multiple, non-independent, RGB LEDs

arduinoled

I’m trying to build a Lego Technic panel with some RGB LEDs (do you know they fit perfectly in Technic’s holes?) driven by an Arduino.

Anyway, my question is: how do I connect multiple (say, 9) RGB LEDs to be driven simultaneously? I want to use RGB LEDs because, although they all have to show the same color, this color may vary. There are tons of info about how to drive them independently but I’d like to light them up all the same, like they are a single one.

The LEDs I'm going to use are Elegoo 5mm common anode (datasheet) or common cathode (datasheet).

I know I have to use an external power supply, probably transistors activated by Arduino to power the LEDs and resistors but I have no idea about the whole circuit, what goes where. I don't have a power source yet but best thing would be to use USB from PC, if it would suffice.

LEDs need to be driven from an Arduino UNO which decides what color and luminosity to display; this is going to be some kind of semaphore on my desk.

I know the question is a bit broad but worth a shot. Any help would be really appreciated.

Best Answer

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. The non-ideal but probably best solution given space constraints.

  • LEDs' current consumption rises exponentially with voltage. i.e., A small increase in voltage can result in a large current and this can damage the LED.
  • Looking at Figure 2 we can see that at 20 mA (2/3 of the rated maximum) the voltage varies quite a bit. For this reason it is usually recommended that LEDs are not connected directly in parallel because the one with the lowest forward voltage will pass a disproportionally large current with possible failure as a result.
  • In your scheme you don't have room for individual current limiting resistors and, due to the common anode, can't series connect the LEDs so we'll have to deal with parallel LEDs in a safe manner.

enter image description here

Figure 2. Extract from the datasheet. Notice the wide variation in forward voltage within each LED colour.

Using the scheme of Figure 1 we can parallel the nine LEDs. We now need to calculate the resistor values. We'll limit the current to an average of 10 mA per LED giving 90 mA max per channel when it's switching transistor is on. We'll also use the mid-range forward voltage for each colour LED and we'll ignore the small voltage drop between the collector and emitter of the transistors when on. Finally, I'll assume a 5 V supply.

Colour     V LED      I         Voltage across R     R = V / I
R          2.05 V     90 mA     5 - 2.05 = 2.95 V    _______ Ω
G          3.15 V     90 mA     5 - 3.15 = 1.85 V    _______ Ω
B          3.15 V     90 mA              = 1.85 V    _______ Ω

I'll leave the calculation to the reader.