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
simulate this circuit – Schematic created using CircuitLab
Figure 1. The non-ideal but probably best solution given space constraints.
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.
I'll leave the calculation to the reader.