SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By the_julle

I'm using the TLC5940 breakout board to supply some LEDs.

But at times, I need to turn off the LEDs to use as little power as possible. This includes cutting off the power to the TLC5940. However, that is not as easy as it may sounds.

When cutting the power to the TLC5940, the LEDs will actually light up (not as bright as when actually turned on). How can I cut the power to the TLC5940, and make sure the LEDs are off?

This is my setup:
I'm using an external 9V power source, connected to the on-board regulator of the Pro Micro board, which then feeds the TLC5940 chip with a regulated 5V supply.

When I want to use as little power as possible, I do this:
Code: Select all
But I also want to remove power (i.e. set 0V to the TLC5940 Vcc pin). But when I do this, the LEDs are turning on.... I guess I need a pull up/down? I have tried a 10k between +5V and BLANK, but they still turn on when I remove Vcc.

Any help is much appreciated.
You do not have the required permissions to view the files attached to this post.
By the_julle
Okay, so an idea is to use a transistor on the 9V wire between the source and the first diode. Then connect an Arudio I/O to the base of the transistor. Would this work? Then I can cut the Vcc voltage to the TLC5940 chip, and then cut the LED voltage. This should cut the power to the chip and make sure the LEDs are off? Which transistor to use for that?
By Piquan
To turn on an LED, the TLC5940 pretends to be a ground connection. When you have Vcc connected, the logic can decide whether or not it wants to behave that way. When you have Vcc disconnected, it can't control what it does (because the logic isn't working right), but it can still pretend to be a ground, because your ground pin is connected.

Even if your ground pin wasn't connected, the chip can get its Vcc and ground connections through the other pins! (There's a great video about that at So cutting Vcc isn't really the best way to shut off a chip.

When BLANK is turned on, the TLC5940 draws about 1mA. You talked about using an Arduino for this project: an Arduino typically will use about 25mA. So if you're already going to spend 25mA to keep the Arduino on, you might as well leave the TLC5940 connected and just use the BLANK line to turn off the LEDs. If you have a way to turn off power to the Arduino, you might be able to leverage that to also isolate your TLC5940 board.

Really, if you're designing something with enough LEDs to need a TLC5940, and has an Arduino running even in hot-standby mode, but can't provide 1mA in standby mode, your circuit might need some design changes.

It is possible to use a transistor to control power to the LEDs, as you suggested, and the rest of this reply will talk about the design of that circuit. But you may be able to find a better design to your overall circuit, rather than focusing on this particular switch.

This will be a high-side switch, meaning that you're turning on and off the current at the positive voltage supply. Most circuits use low-side switches, which cut off the current at ground instead; these are generally easier to design, especially if you're trying to control something with a different voltage than the microcontroller. But in your case, the TLC5940 acts as your ground connection, so you'd have to put a separate transistor on each of the 12 LED connections, rather than a single transistor at the top.

Now, let's decide which. You probably would rather use a BJT (that is, an NPN or PNP transistor) instead of a MOSFET; there are lots of tutorials about BJTs for hobbyists, and BJTs are a lot more durable. If you need a refresher on transistors, read

So, do you use an NPN or a PNP? Well, if you use an NPN between the 9V battery and the LEDs, you'd never be able to turn it on! That's because an NPN turns on when the base is at a higher voltage than the emitter. But you'll have 9V at the collector, and if the transistor is on, you'd have a little less than 9V at the emitter. Since your Arduino can only put out a 5V signal, then it can't get higher than the emitter! So, you'll need to use a PNP.

A PNP turns on when the base is at a lower voltage than the emitter. There's two ways you could drive it with an Arduino. The one I'd suggest is the circuit at ... 0+144+0%0A. That uses an NPN transistor (on the left) to control whether or not current can flow through the PNP's base (on the right). Then, I have a couple of current-limiting resistors on the bases.

I use a large current-limiting resistor (47k) between the Arduino and the NPN base because we don't need a lot of current there, so may as well use a large resistor to limit how much current we use. You could use a smaller resistor, down to 220 ohms or so, but I'd probably stick with the 4.7k-100k range. For the PNP's base resistor, I needed something smaller: I want the PNP's base to have a decent amount of current (2mA or so), so that it lets plenty of current through to the LEDs. I went with a 4.7k resistor; that will let nearly any PNP transistor pass 100mA to the LEDs, or more depending on the transistor. You can make the PNP base resistor smaller if you need more current for the LEDs, but if you do then you'll be using more current just to feed the base: the lowest I'd probably use is about 1k (which would use up 8mA for the base current alone).

As for which transistors: you can use nearly any transistor for that NPN; I'd probably use a 2N3904 for it, which you are likely to have on hand already, since it's included in a lot of packs like the one at; a 2N2222, PN2222, BC548, or similar would also work just as well. As for the PNP, that depends on how much current you need for your LEDs. The 2N3906 is a common PNP transistor, and can handle about 200mA. If you're working from a 9V battery, you're probably planning on using less than that anyway!

If you do need more current, then you could use a higher-power PNP transistor like the 2N2907 ( or TIP105 (, but for over 500 mA or so, you'd probably be better off going to a MOSFET circuit like ... +33+3+2%0A. I made the MOSFET version with a FQP27P06 ( in mind. You could use a NDP6020P (, which might be better to have on hand because it's easier to use with a Raspberry Pi, but it might be destroyed if you accidentally put 9V across its gate.