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
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.
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?
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.
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.