Thursday, 26 March 2015

PWM dimming using the TLC5916 current limiting LED driver


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.




Answer



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.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...