Monday, 8 September 2014

lm317 - Controlling high output LED's with a microcontroller


I'd like to build a circuit to precisely control the current through a couple of (LED and laser) diodes. I would like to minimize the number of components if possible. Power consumption is not a primary concern, so linear regulators and dissipating resistors are fine.


I am looking at a LM317-based circuit and this will serve fine for a constant or potentiometer-tuned current, but I want my current to be controllable by a microcontroller. How might I achieve this?


If it is possible to do this without an additional op-amp, BJT, or FET, please explain.... Actually, please explain no matter what. :)


Looking to drive LED's individually (or in series) at up to not much more than 1A. (Vf < 4V)



Answer



Okay, so the TL4242 is too expensive. No problem, you can still make a current source using more common components.


enter image description here


The current is defined by the input voltage as \$ I_{LOAD} = \frac{V_{IN}}{R_{SENSE}} \$. Choose \$R_{SENSE}\$ in function of the microcontroller's \$V_{DD}\$. If you supply \$V_{IN}\$ with the PWM signal the current will switch between \$I_{LOAD}\$ and zero.



edit
I hadn't looked at the price for the TL4242, but Federico is right: the price is very reasonable. You would spend more if you want to PWM control the LM317.


edit: driving 2A
One thing to keep in mind when selecting components is that the transistor replaces your series resistor which usually controls the LED current.
If the transistor were to be purely a switch you would want it to be as efficient as possible, i.e. dissipate very little power. In that case a MOSFET would be the best option, there are lots of them which have \$R_{DS(ON)}\$ of less than \$100m\Omega\$.
Now that the switching element is a current limiting device this is not that important. You can use a BJT here. Power transistors for 2A \$I_{C}\$ don't have high \$H_{FE}\$, which means that the opamp would need to supply a rather high current into the base, and this may be beyond the opamp's capabilities. A Darlington transistor like the TIP110 is the solution.


No comments:

Post a Comment

arduino - Can I use TI&#39;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...