Which opamp to use and how to use ? Constant current source led driver. - Page 1
Forum section: electronics / beginners

author: Heisen
author_rank: Contributor
timestamp: August 06, 2020, 07:32:39 pm
content: Hello everyone,Recently I was looking at a dual NPN transistor constant current source driver, dropped it due to it's high thermal sensitivity. Found an opamp driven constant current source which doesn't have this problem. I want to use this circuit to drive bunch of car taillights.Circuit :-I simulated this circuit in LTspice, also I am using micro controller to PWM the LEDs, 3000hz frequency :-And this is the current through the leds, which is set at about 70mA, duty cycle set at 50% :-Due to my limited knowledge of how opamps work, I have few questions :-1. What kind of opamp to use for this specific application? Do these general opamps will work fine ? LM741 , LM358 ?2. Can I drive the Non inverting input of the opamp directly from the GPIO of the micro controller? Or do I need something in between?3. Can we connect V+ of opamp to the supply of the load. Like to 12v as shown.4. Can we connect V- of opamp to GND in the above scenario.5. The current is not completely zero when the pulse is low as shown in the waveform. How to make it zero?6. Do values of C1 and R2 looks right?Thanks.

author: Dabbot
author_rank: Regular Contributor
timestamp: August 07, 2020, 07:36:19 am
content: Quote from: Heisen on August 06, 2020, 07:32:39 pmIn this configuration, you need an op amp that can operate at the negative rail, which the LM358 can do.Quote from: Heisen on August 06, 2020, 07:32:39 pmYes, but this is not what the op amp is designed for. Why not filter the input with a low pass RC? Say 10K and 0.1uF.Quote from: Heisen on August 06, 2020, 07:32:39 pmYes, as long as the op amp is rated for the supply voltage.Quote from: Heisen on August 06, 2020, 07:32:39 pmYes.Quote from: Heisen on August 06, 2020, 07:32:39 pmConnect a 10K resistor between +12 and the negative input. This will maintain a small quiescent current so that your PWM can drive the positive input below the negative input, saturating the output low and turning the MOSFET completely off.Quote from: Heisen on August 06, 2020, 07:32:39 pmI'm not sure. If you select a MOSFET with low enough gate capacitance, which can still comfortably drive the LEDs, you may be able to get rid of R2 and C1, connecting the negative input directly to R3.

author: Vovk_Z
author_rank: Super Contributor
timestamp: August 07, 2020, 08:02:28 am
content: +1 to LM358, it is usual there. More precision ones are AD820, AD822, AD823 - all of them can work with input near ground. To use "usual" precision opamps like OP07 you need a dual power rails (plus and minus 12 V, for example).Rgate (R1) about 47 R, R to shunt (R2) about 1k. A capacitor (C1) in opamp feedback has to be 2000 pF or more (1.5 nF...4.7nF), withot PWM. With PWM it may be larger, but as was said it is better to put RC-filter before the opamp input.

author: tomoram
author_rank: Contributor
timestamp: August 14, 2020, 08:16:00 am
content: Quote from: Dabbot on August 07, 2020, 07:36:19 amWould you mind explaining why this filter is a good idea (i.e. what's it filtering out)?

author: Dabbot
author_rank: Regular Contributor
timestamp: August 14, 2020, 09:10:10 am
content: Quote from: tomoram on August 14, 2020, 08:16:00 amIn this case, it turns the PWM signal into a steady voltage. This eliminates problems introduced by the op amp's bandwidth and slew rate.

author: TimFox
author_rank: Super Contributor
timestamp: August 14, 2020, 03:34:01 pm
content: Corrected from an earlier mistaken reply.Note that in this circuit, to maintain a constant current drive to the LEDs, the MOSFET is in its active region (with PWM waveform or filtered DC at the amplifier input), and will dissipate power.

author: Heisen
author_rank: Contributor
timestamp: August 15, 2020, 06:28:40 am
content: Quote from: tomoram on August 14, 2020, 08:16:00 amQuote from: TimFox on August 14, 2020, 03:34:01 pmHere is the next problem -https://www.eevblog.com/forum/projects/temperature-independent-constant-current-with-fast-transient-response-to-pwm/

author: ledtester
author_rank: Super Contributor
timestamp: August 15, 2020, 12:43:21 pm
content: A recent thread on building a constant current DC load - lots of good practical info:https://www.eevblog.com/forum/projects/constant-current-dummy-load-ran-a-gutter/

author: tooki
author_rank: Super Contributor
timestamp: August 15, 2020, 01:57:17 pm
content: Quote from: Heisen on August 06, 2020, 07:32:39 pmWhile your choice of 3KHz is better than the horrific <1KHz used by so many cars now (which ishighlydistracting to flicker-sensitive people like me), if you only need two brightness levels, why not just divide the LEDs into two strands, and then only turn one of them on for low brightness, and both for high? It’s a simpler circuit and eliminates flicker completely. (For what it’s worth, I run my LED lights at home with a homemade dimmer at 20KHz — higher than the ~10KHz where all flicker went away. In a car, since it’s moving and so are other drivers, higher frequencies are actually needed, and 10KHz might not actually be enough in all cases.)

author: RJSV
author_rank: Super Contributor
timestamp: August 15, 2020, 08:43:45 pm
content: Often my pick is 358 OP amp, and 324 usually, 4 to a pack. I believe the LM324 has some rail limit, of max output.For basics, the LED current causes equiv voltage, that is the 'concern' of the OP amp, using controller analogy. But also, you have to control widely, as the 'eye' is non-linCan also try LM339, a comparitor