0
\$\begingroup\$

I'm using a TLC5916 which is a constant-current LED driver. I want to dim a LED and have setup a simple board with a particle chip. Try as I might I don't get the LED to be dimmer without flickering (to be honest it just flickers and doesn't really dim).

My question is: Can LED dimming be achieved with constant current drivers? If it can be achieved a clue on how would be nice, so I can do a triple (thousand) check on my source-code on what I'm doing wrong.

\$\endgroup\$
  • \$\begingroup\$ Looking at the TI datasheet, there doesn't seem to be a enable or dimming pin so I assume you're modulating the Vdd power to the driver. It cannot respond quick enough to work for dimming. You need a different CC driver chip which directly supports PWM dimming. \$\endgroup\$ – DoxyLover Jan 22 '17 at 20:21
  • 1
    \$\begingroup\$ You have not explained how you are achieving the PWM. One way requiring no additional circuitry would be to rewrite the TLC5916 register repeatedly. The frequency would need to be fast enough. For example, if you want 300Hz refresh rate to avoid flicker and 256 dimming steps, than you would need to update the register at a rate of 300Hz x 256 = 77kHz. \$\endgroup\$ – rioraxe Jan 23 '17 at 0:40
  • \$\begingroup\$ DoxyLover like @rioraxe is saying: I'm writing the register repeatedly. The datasheet says, that I can write the register with 30Mhz, so I think that should be fast enough? \$\endgroup\$ – ma-ver-ick Jan 23 '17 at 13:26
  • \$\begingroup\$ 30MHz is probably the SPI bit rate, that is fast enough, but not what I meant. You have to keep the PWM cycle time to be at least 200 or 300Hz to avoid flicker. That means for each of the LEDs, the on and then off cycle must not be longer than 3-5ms. Coupled with the PWM resolution or steps requirement, the uC must make repeating decisions in the 10's of KHz frequency and write to the TLC5916. \$\endgroup\$ – rioraxe Jan 23 '17 at 22:12
4
\$\begingroup\$

Yes, LED dimming can be done with constant current drivers and can even be done with that particular chip. However, you will need additional circuitry to achieve it.

To imagine what's needed and how, think about how LED PWM control is done professionally.

  1. A constant current driver set to a specific current value in order to provide a 100% brightness level for the LED and operated at 100% duty cycle.
  2. A PWM switch control to modulate the current and provide dimming.

That's it, really. What you have already is only the first half. The TLC5916 is a great chip for what it doing -- setting up and monitoring a constant current sink for some number of LEDs. But it doesn't include a PWM control. So you need to add a PWM control circuit. With both those in hand, you are good to go.

Since the TLC5916 is a low-side current sink controller, you'll need a high side PWM switch. You don't say if you are trying to PWM more than one LED. (What you do say, reading carefully, is that you are trying to PWM one of them.) If you intend on modulating more than one, you might consider using a specialized IC that provides a block of 8 source (high side) drivers like the Allegro 2981 and 2982 or the Toshiba TD62783. You can wire the controls over to your microcontroller device (whatever it is) and control up to 8 LEDs that way. Or you can just wire up your own external circuitry, especially if all you want to do is PWM just one LED.

Try adding this schematic to your existing situation and see if it helps you with just one LED (either left or right schematic):

schematic

simulate this circuit – Schematic created using CircuitLab

The transistors may be fine as a small-signal variety -- whatever you have laying around. But keep in mind that you really do need to consider all of the various power dissipations involved; including that for your TLC5916.

Some of the resistor values are left out because I don't know enough to help there. But I can provide guidance.

Given that you are using the TLC5916, your high side voltage rail probably isn't higher than \$V_{+}=5\:\textrm{V}\$. However, the TLC5916 outputs can support a maximum rail voltage of \$V_{+}=20\:\textrm{V}\$ so there is quite a range here for actual operation of your LED (or series chain of LEDs.) The TLC5916 gets its work done by regulating current on the low side (at the expense of a small working voltage there.) So, let's call the LED rail voltage \$V_{+}\$ and the current setting you've designed to be \$I_{set}\$. Your microcontroller output voltage will be \$V_{io}\$.

Then in the left side schematic, we'll operate both \$Q_1\$ and \$Q_2\$ as switches. So \$Q_1\$'s base current needs to be a tenth, or \$I_{B_1}=\frac{I_{set}}{10}\$ (and this sets the collector current of \$Q_2\$.) \$Q_2\$'s base then will need a tenth of that, so \$I_{B_2}=\frac{I_{set}}{100}\$. Therefore, \$R_3\approx\frac{V_{io}-700\:\textrm{mV}}{I_{B_2}}\$ and \$R_2\approx\frac{V_{+}-1\:\textrm{V}-300\:\textrm{mV}}{I_{B_1}}\$. Don't worry about exact values -- you can use nearby standard values. In this left hand circuit, the I/O pin will have to provide \$I_{B_2}\$ or about a hundredth of whatever you are specifying for the LED's 100% current value, \$I_{set}\$.

In the right side schematic, \$R_5\$ sets the current as \$Q_4\$ is being operated as an emitter follower. (The current loading on your I/O pin will be lower than for the left side circuit, though, since \$Q_4\$ isn't operating as a switch and more of its \$\beta\$ becomes available here.) Here, you compute \$R_5\approx 10\cdot\frac{V_{io}-700\:\textrm{mV}}{I_{set}}\$ and pick a nearby standard resistor value. (To those worried about oscillation, it's unlikely here because a microcontroller output typically has \$100\:\Omega\$ of impedance towards the base of \$Q_4\$.)

Using PWM like this won't hurt the TLC5916 IC. (It may signal an error bit, but you can ignore that.) It's output pins are designed to handle loaded and unloaded cases. So it should just work here.

\$\endgroup\$
  • \$\begingroup\$ Wow, that's an elaborate answer! Thank you very much! I'm using SPI.transfer(byte) to shift the data out and calling that in specific time intervals (which should generate a PWM). The "PWM drivers" you are mentioning are MOSFETs. Ok, so the circuit can work, now back to problem searching. \$\endgroup\$ – ma-ver-ick Jan 23 '17 at 5:13
  • \$\begingroup\$ This is more a question then a solution... can't you apply an external PWM to the OE input of TLC5916 to dimmer all active outputs at once? This way you may be able to discard the high side drivers. Yes, this only works to control all outputs with the same duty. So, does it works? \$\endgroup\$ – Gustavo Vargas Mar 19 at 15:48
  • \$\begingroup\$ @GustavoVargas You cannot discard the high-side drivers. Lay out a matrix on a piece of paper. Mark the rows as On/Off enable switches; mark the columns as the TLC5916. You should be able to see why you cannot just eliminate the high side drivers. That said, you could choose to PWM the OE of the TLC5916 instead of the high side driver for a row, I suppose, keeping the high side driver always on for a fixed period and using the OE instead for dimming. But I'd probably just tie the OE to ground, instead. I have to have control of the rows. May as well PWM them for dimming. Less I/O pins then. \$\endgroup\$ – jonk Mar 19 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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