How to control 10 common anode rgb LEDs using only 3 PWM pins

I am wondering how to control 10 LEDs (common anode) using only three PWM pins (for RBG) and the 5v pins.

For more project context, I have written Arduino code that takes rgb color profiles from a relatively complex but fully functional Java program running on a computer and passes them to an Arduino over USB, which then replicates the color over PWM pins on a common anode LED. Now, I want to apply these color profiles to more than the single LED I’m powering at the moment. Each LED should behave exactly as the others do (or at least, should appear to be doing so to the human eye) at all times.

Some quick reading on shift registers reveals that I do not actually need 30 PWM pins to achieve this, but I am not sure how to implement this. My plan is to mirror RGB signals from the PWM RGB trio pins on the Arduino I have set up to some sort of mirroring system that sends those signals to all 10 LEDs. For power, my plan was to turn remaining pins into 5v supplies and power each LED individually. Is it possible, though, to mirror that common anode pin as well to reduce the number of total pins required?

Thanks for your advice. If you haven’t realized yet, I’m very new to this, so I appreciate your patience.

Look at addressable LEDs. They come in all shapes and sizes. https://learn.adafruit.com/adafruit-neopixel-uberguide/overview Leo..

Wawa: Look at addressable LEDs. They come in all shapes and sizes. https://learn.adafruit.com/adafruit-neopixel-uberguide/overview Leo..

Very neat. Unfortunately, my project depends on different LED diodes I have already purchased (bulb form factor). Any idea how to use a shift register or similar device for this?

Wawa's suggestion is probably the easiest way. But on the other hand it is not using the 10 CA leds you may or may not already have.

If you do have them and want to use them, then you are making things much more complicated than you need to given that all 10 are always going to show the same colour. You just need three NPN transistors. BC337 or similar. You will need 30 series resistors, 3 for each led (as you are doing now, aren't you?)

EDIT: just saw your reply. Ask if you need more detailed advice.

OK, so a re-read of your original posting indicates that this is actually a perfectly simple matter.

You want to put 10 RGB LEDs in parallel.

You need three logic-level FETs, controlled by the three PWM outputs. The LEDs have a (separate) 5 V supply to the common anodes and each cathode has a current-limiting resistor to the corresponding FET drain terminal according to colour. Total 30 resistors.

PaulRB:
Wawa’s suggestion is probably the easiest way. But on the other hand it is not using the 10 CA leds you may or may not already have.

If you do have them and want to use them, then you are making things much more complicated than you need to given that all 10 are always going to show the same colour. You just need three NPN transistors. BC337 or similar. You will need 30 series resistors, 3 for each led (as you are doing now, aren’t you?)

EDIT: just saw your reply. Ask if you need more detailed advice.

Yes unfortunately the LED’s need to be inserted each in non-adjacent locations for this project, so a strip would not work.

Is this what you are envisioning with the NPN transistors? http://electronics.stackexchange.com/a/64623

Just came across that in my searches.

Yes, I will add more resistors as I add more RBG channels.

Paul__B: OK, so a re-read of your original posting indicates that this is actually a perfectly simple matter.

You want to put 10 RGB LEDs in parallel.

You need three logic-level FETs, controlled by the three PWM outputs. The LEDs have a (separate) 5 V supply to the common anodes and each cathode has a current-limiting resistor to the corresponding FET drain terminal according to colour. Total 30 resistors.

Thanks for the reply. I am a bit confused as to what the circuit for this solution might look like visually despite your very good description (visual learner). Is there a diagram you could possibly link me to?

If you want to light up all the RGB LEDs with the same colour and brightness:

Connect all anodes to a 5volt source (capable to supply the total LED current). Use three current limiting resistors per LED on the three cathodes.

Connect the other end of all the resistors from the Red colour to the collector of transistor#1. Connect the other end of all the resistors from the Green colour to the collector of transistor#2. Connect the other end of all the resistors from the Blue colour to the collector of transistor#3. Connect the three emitters to ground. Connect the three bases via a ~330ohm resistor to three Arduino PWM pins.

This will give you full control over each LED. https://www.adafruit.com/product/1429

https://www.adafruit.com/products/1938 Leo..

Is this what you are envisioning with the NPN transistors?

Yes, that's the idea. Please start inserting links properly using the link icon so they look like this.This forum does not parse them automatically.