I'm new to electronics and working on a hobby project that will have an arduino board running 5 separate strings of RGB LED's. I'll be using a PWM chip (TLC 5940) so I can independently control tho color's of each of the 5 strings of lights. My question is how do I power the LED's. I know they can't be powered from the arduino pins and I highly suspect that they can't be powered from the PWM chip.

I think what I'll have to do is run the PWM output to the base of a transistor and have the string of LED's powered through the transistor with an appropriate power source. Can someone please confirm that and if it is incorrect correct my mistake in layman's terms?

A couple other questions related to this:

1) Is there any "lag" with transistors? i.e. if I run PWM to the base of a transistor will the emitter of the transistor produce an identical source (but amplified)?

2) I saw in an answer to a previous question than I need to look into constant current for the LED's. I still need to do that research but what does a constant current device look like? Is it just an IC you can buy? Can someone provide a part number or link to a page that has one so I can more effectively research how to use them.


1 Answer 1


Simply power the LED driver (i.e., its VCC pin) with a battery (or other higher-current-capable source), since the Arduino pins are only capable of sourcing 50 mA.

  1. First of all, you won't even need a transistor, if you use a battery as I mentioned above. But to answer your question, if you were using a transistor: while there is lag, lag won't be significant enough to affect your application here.

  2. And secondly, the TLC5940 is a constant-current driver, so you're fine. A constant current source/sink is exactly that -- it ensures a constant current flows independent of power supply fluctuations/other conditions. Thus your LEDs will light up with constant brightness.

Finally, a clarification regarding PWM with the TLC5940: You don't use PWM of the Arduino pin to directly create PWM on the TLC5940 I/O pins; that's NOT how it works. Instead, the TLC5940 uses serial communication with Arduino -- so you would send it instructions from the Arduino (via SPI or bit-banging, for example; see this TLC5940 Arduino library), and the TLC5940 reads those instructions and performs PWM on the desired I/O pins as instructed.

  • \$\begingroup\$ I have read that arduino playground article on the TLC driver so I get how the TLC works with Arduino. It specifies that you need Common Anode LED's for it to work. Looking at the image it seems that the TLC is connected to the negative terminal of the LED so the TLC completing the circuit to ground correct? Hence I just connect my battery to the Annode (as you said). Will the TLC still act as a constant current driver in that case; it does so if it's anywhere in the chain? What is the current and how can I adjust it? \$\endgroup\$
    – William
    Sep 25, 2012 at 22:54
  • \$\begingroup\$ Answers to all of your questions can be found on the TLC5940 Arduino library page that I mentioned above. Please read this section as well as this one, and look at this schematic. \$\endgroup\$
    – boardbite
    Sep 26, 2012 at 8:45
  • \$\begingroup\$ The TLC5940 is a constant-current SINK driver, so LED Cathodes are connected to TLC5940 I/O pins. LED Anodes are connected to VCC (again, 5V or 3.3V, whatever you're working with). Get VCC = 5V or 3.3V via a regulator from a battery, and connect that to TLC5940's VCC pin. Connect Grounds of everything \$\endgroup\$
    – boardbite
    Sep 26, 2012 at 10:06
  • 1
    \$\begingroup\$ Yes, you can connect the top end of a chain of LEDs to +5 V or +3.3 or +12 V; and the bottom end of the chain to an output pin of the TLC, which completes the circuit to ground. The TLC works at the bottom end of the chain, not anywhere else in the chain. The TLC5940 datasheet specifies how to adjust the current on page 14. With 2 kOhm or 2.2 kOhm resistor between GND and IREF pin 20, you will get about 20 mA through every LED in a chain of LEDs connected to an output pin of the TLC whenever the Arduino tells it to turn on that chain. \$\endgroup\$
    – davidcary
    Sep 26, 2012 at 11:01
  • \$\begingroup\$ I see. Thank you both very much for your help. I'll read the links you provided boardbite. My apologies if my electronics newb-ness is frustrating. \$\endgroup\$
    – William
    Sep 26, 2012 at 15:49

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.