Go Down

Topic: What does someone do when 15 PWM pins are not enough? (Read 1 time) previous topic - next topic

meltz

Brief description of project:
I have multiple RGB leds that I want to control the brightness of each color of each led individually. Currently my project is limited to 5 RGB leds because I have a Arduino Mega 2560 and using all 15 PWM pins.

Question:
What is the best way extend the number of RGB leds that I can control the color of each led individually?

Possible solutions:
-have two arduino mega 2560s and somehow have one of them programmed to control the PWM pins of the other one. I'm not too familiar with how Arduinos can be linked together.
-set up a multiplex. Are multiplexes strictly off and on? is there a way that I could use this as PWM.
-Is there a way to make all of the digital pins PWM? I've looked into this, but not sure if it is the best solution.
-Is there something on the market similar to arduino that has can control more PWMs

Grumpy_Mike

Quote
have two arduino mega 2560s
No - silly solution, no need.

Quote
-set up a multiplex.
No even sillier solution for outputting.

Quote
Is there a way to make all of the digital pins PWM?
Software PWM library but not the best solution.

Quote
Is there something on the market similar to arduino that has can control more PWMs
No.

Use an external chip. The TLC5940 is a common one, this has 16 PWM outputs of 12 bit resoloution. You can chain sevral together to get as many LEDs as you want. I would use one for all the red, one for the blue and one for the green, which means you can have 16 RGB LEDs with just 3 chips.

The other way is to use AdaFruit's neopixels and chain as many as you like, this is by far the simplest option.

Riva

Don't PM me for help as I will ignore it.

Go Up