Electronic – How to switch control between 2 RGB LEDs with PWM from a Netduino

microcontrollernetduinopwm

I'm building a project where I will be lighting up 2 RGB LEDs using PWM. Since the Netduino only has 4 PWM pins (of which I will only use 3 – one pin each for the R, G, and B values respectively), I need a way to be able send the signal to either LED or both. Something like the following: Netduino PWM

What component(s) do I need for that black box? I considered something like a TLC 5940 PWM Driver, but I want to be able to power this off of the Netduino itself (i.e. no external power source). Do I just use a bunch of AND gates?

Best Answer

Assuming your PWM output can supply enough current for both LED's then put a FET between the cathode and ground for each LED. Control each FET's gate with an I/O line from the microcontroller. This way you can turn either on, both off, or both on by controlling the I/O lines.

Just make sure the PWM pins on the uC can actually provide enough current to drive the LED and that the current is properly limited.