Costant current Led Driver with OpAmp and Mosfet - Page 1
Forum section: electronics / projects

author: dimix
author_rank: Newbie
timestamp: January 23, 2024, 06:35:47 pm
content: I'm developing an aquarium lamp with 5 led channels(RGB+CW+WW) and 24V supply; Each channel will be linearly regulated because the voltage drop for each channel it's not enough to justify the use of 5 buck converters. I would like to use the same schematic on two aquarium, in the first the led pcb will be near the controller pcb while in the second the controller pcb will be at a meter of distance from the leds(this will be relevant later).From now on I will consider only the green channel, the same will be almost identically applicable to each other channel.I think to use L128-GRN1003500000 leds from Lumileds and drive them at 150mA, below are the features.For the constant current driver I design the circuit below.A chain of 7 leds will drop 23.1V, while the shunt resistor will drop 0.5V; The mosfet so will drop 0.4V, that is a power dissipation of only 0.06W, enough to be dissipated by a little sot-23(like AO3400).Now the part on which I'm insecure, how to drive the op-amp, considering that I will manage all from a stm32? Below are my proposals.1) Low pass filter:I can easily generate PWM signals, in the order of 10KHz, and convert them to an analog voltage from 0 to 0.5V.Pros:Low EMC noise(low pass filter adjacent to the uC).Gentle on the power supply.No problem on driving the mosfet.Cons:Decreasing the duty cycle will initially increase the mosfet power dissipation(at 33% we have I=50mA, Vleds=19.25V, Vshunt=0.15V, Vds=4.6V => so 0.23W)2) Direct PWM drive:In this case I think of reducing the pwm frequency to about 1kHz.Pros:Constant power dissipation for the mosfet(I can use smaller fet).Cons:More EMC noise(all the cable to the leds).Harsh to the power supply(i will try to offset the PWM “ramps” of the various channels to don't have big spike).Maybe, problems in driving the mosfet if the frequency is too high.I personally think that the best solution for my use case will be the low pass filter with a bigger mosfet, but I hope you can guide me on a more accurate decision!!Ps. for the op-amp I think that a classic LM358 would be enough, I'm wrong?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: January 23, 2024, 07:00:26 pm
content: Your mosfet drop is very optimistic.The load line and thermal effects and even variations in 24V mean you could be out by a factor of ten.Since you are not making many, just buy the cheapest ‘big’ mosfet you can find.With 5 channels, you can try both pwm and dc control.You can also slow the pwm edges, and trade some mW for less emc.Your circuit looks to have some leds backwards.

author: dimix
author_rank: Newbie
timestamp: January 24, 2024, 08:55:27 am
content: Thanks for the reply!I considered that, with a possible increase of 5x, in fatct for a small sot 23 the ideal condition was 0.06W that in the worst is 0.3W, an increase of temperature over ambient of around 40Celsius.With "big" mosfet it worries me the gate capacitance in the case of pwm control.I would like to have an unified solution for all the channel and not 2 different ones.I didn't know of the possibility of slowing the pwm edges, i will do some research in that regards.Sorry for the backwards leds.

author: MathWizard
author_rank: Super Contributor
timestamp: January 24, 2024, 10:25:48 am
content: So why do you want to use PWM? Even if it's meant to be adjustable current, why not just set a fixed voltage directly ?I'm not sure how much the current would change from cold to normal operation, but with negative feedback, that should be fine still.

author: MarkT
author_rank: Frequent Contributor
timestamp: January 24, 2024, 10:49:20 am
content: LEDs 4,5,6 are the wrong polarity. You have no gate-protection zener on the FET - the supply voltage needed to drive 10 of those LEDs is 30V or more, above the MOSFET gate breakdown voltage.

author: liteyear
author_rank: Regular Contributor
timestamp: January 24, 2024, 11:07:42 am
content: Can you locate the MOSFETandthe Opamp with the LEDs? If so, drive it with smoothed PWM to get best of both worlds - low power switching and low EMI.If you can't locate the opamp near the LEDs, then I definitely support your gut feel - far fewer potential dramas with a bigger MOSFET than with PWM transmitted over a distance.But seriously, can you locate the switching stuff near the LEDs?