using a buck converter as constant current source

I understand how to use a linear voltage regulator as a current source, by burning a nice amount of power in a resistor and the other part inside the LM317, for example.

There are switching regulators with much better performance and less heat issues, but they are all advertised as voltage regulators.
Now I found this LM2596 based module with this advertising text.

I have used it for controlling brightness of LEDs, controlling charge rate of batteries ... Note that the input voltage must be at least about 1.5v greater than the desired output!

That text sounds like some current regulation, but the module has just one trim pot. ( Probably for the desired voltage )
Can one do current regulation with such a module ?

Regarding the price, LED drivers seem more complicated than such voltage regulators ?
Can't it be done with a little modification of such a converter?

Sure it's hardly Arduino related, but I know there are electronics experts reading here :wink:

I've been thinking of using the MC34063 in buck mode as a current regulator, by using the correct value of current limit resistor. That is a peak current limit resistor, though.

The LM2596 circuit needs to be modded similar to how you add current limiting to a 780x regulator.

Thanks. Looks interesting.

And yes: an extra opamp with its own power reulator 78L15 adds some complexity, but modding a given regulator seems an interesting experiment, at least.

The shunt (0.01 Ohms * 0.5W) annoted by "may just be a track on the PCB as well"
puzzles me: Is it really a significant level above GND for the opamp + Input ?
What, if one replaces it by a 0 Ohm line?

The open loop gain of the LM358, in V/mV, is 25 minimum, 100 typical. So Av is 25000 to 100000.

Page 4:

There is no such thing as a 0 ohm line. Even a short chunk of wide PCB track has resistance.

Since it is using that track as a current shunt to measure load current, you must pay careful attention to where everything is wired to ground.

Constant current buck and boost regulators are often described as "LED constant-current
driver chips"!

The principal use is for powering LED strings, so that's how the devices are usually categorized. There are linear as well as switch-mode ones.

Theres very little differance in design between a normal buck converter which provides a constant voltage
and one which provides a constant current.
All you need to do is add 2 extra components to make a constant current source.
One is a low value sense resistor which goes in series with the leds , and the other is an op amp
to amplify the voltage across the current sense resistor, which is then fed back into the switcher chips
voltage ref input.
If you use a chip like a ua78s40 which is very similar to a MC34063, but includes a catch diode and a spare op amp
you dont need any extra components.

Look up with LM358, output are bipolar and output can not be lower than about 1 volt over GND.
Check input voltage of the switchregulator feedback.

Pelle

michael_x:
Regarding the price, LED drivers seem more complicated than such voltage regulators ?

They need a few more components and they tend to have a higher power rating.

michael_x:
Can't it be done with a little modification of such a converter?

Not economically. Between the cost parts and labor you might as well pay the extra $1.50 and get a pre-built one.

mauried:
Theres very little differance in design between a normal buck converter which provides a constant voltage
and one which provides a constant current.
All you need to do is add 2 extra components to make a constant current source.
One is a low value sense resistor which goes in series with the leds , and the other is an op amp

But how do you ensure loop stability? That takes some analysis of the existing
feedback network surely?

Look up with LM358, output are bipolar and output can not be lower than about 1 volt over GND.

Page 4 of the PDF above says that the output can go down to 5mV typical, 20mV max. But that doesn't really matter, we aren't asking the output to go that low.

The inputs are rated to go down to the negative rail, ground in the case of a single supply.

Both inputs and outputs can't go within about 1.5V of the positive rail.

In any case, simpler to use a purpose-built constant current switch mode LED driver, unless you have the other parts and can't easily get such an IC.