Electronic – get constant current at the output of a buck convertor (to drive a LED)

buckconstant-currentdriverled

I want to drive a LED with a buck converter circuit as shown in the schematic below. In order to keep the circuit simple, the system will run open-loop (i.e.; there won't be any voltage or current feed-back). Is it possible to set the LED current to a fixed value by means of calculating the appropriate \$D\$ (duty cycle) value? Or, in this circuit model, will the LED current theoretically approach to infinity because of lack of a resistive element in the path?

enter image description here

Best Answer

Yes, it is possible to calculate the duty cycle to acheive a specific LED current, given a specific set of conditions. If you know the 12 V supply will stay fixed, know the LED forward voltage, and use a reasonable forward drop accross the diode, then this can be done.

I actually did something like this in a commercial product, except that the power voltage was from a battery and could vary. The formula from battery voltage to PWM duty cycle is non-linear and not easy to solve in real time in a small micro. However, this was done with a table. I set up the table to take the raw 8 bit A/D reading directly and produce the value to write into the PWM duty cycle register. All the conversions and calculations (which included a divide and a square root) were performed by the preprocessor using floating point math, and the result loaded into the table at build time. It worked quite nicely. The LED current stayed within 10% of the target over the full battery voltage range.

Related Topic