2
\$\begingroup\$

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?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Can't you light one LED or the other by driving their common return pins from digital outputs? \$\endgroup\$
    – endolith
    Commented Nov 4, 2010 at 3:22

2 Answers 2

3
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ If the PWM pins on the uC can't provide enough current, then a few PMOS/PNP transistors are in order. No biggie! \$\endgroup\$ Commented Nov 4, 2010 at 3:40
  • \$\begingroup\$ yea but that may cut into the "powered from the netduino" bit, or at least as much as just using the external PWM driver would. Both should only require tapping into the netduino's supply lines which shouldn't be hard but at all but....meh... \$\endgroup\$
    – Mark
    Commented Nov 4, 2010 at 3:57
1
\$\begingroup\$

If both LEDs are on are they going to be the same? You could control the common pin with a transistor to totally shut off either or both LEDs.

If you use the TLC5940, you wouldn't even need to use the PWM pins from your micro as it will run all by it self after you send it a command. As far as powering it, it should easily be powered off any sort of dev board, your LEDs are going to be far more power hungry than it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.