how to generate a 0-120uA current (with a microcontroller) to adjust IC

Hi to all, I need to generate a variable current, in the range 0-120uA sourcing it into an IC to dim LEDs. I also need to read the LEDs current, that is different from 0-120 uA (LEDs current will be in the range 0-2,5A).

I'll use an IC that features a buck-boost controller to drive LEDs. Then I'll read current flowing into LEDs with a shunt (through microcontroller's ADC). After reading current, I need to adjust it: the buck-boost controller can be analog dimmed through a current sourced into a pin.

Now, how can I generate this current with a microcontroller?

Thank you Andrea

Reply to
andrea.phoenix
Loading thread data ...

PWM into a low-pass filter into a resistor.

--
For a good time: install ntp 

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Reply to
Jasen Betts

Run a search on "addressable D/A converter" to find possible solutions.

Reply to
bloggs.fredbloggs.fred

A DAC and a resistor.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

On a sunny day (Sat, 2 Nov 2013 16:23:39 -0700 (PDT)) it happened snipped-for-privacy@gmail.com wrote in :

PWM pin -> lowpass -> series resistor?

Reply to
Jan Panteltje

On a sunny day (Sun, 03 Nov 2013 06:52:13 GMT) it happened Jan Panteltje wrote in :

Actually if you do it that way may you as well drive the PWM ino a transitor with inductor and control the LED directly.

Reply to
Jan Panteltje

So, you'd want a sense resistor (I'd pick about 20k ohms) and sense the voltage across it (with 20 k ohms, 0-120 uA gets you a range of 0 to 2.4 volts).

I'm assuming the current will be terminated into some node that is held more than 2.4V plus a diode drop below an available (+) power supply. Take a matched pair of PNP transistors, with 20k ohm (also matched) emitter resistors. Pull those emitter resistors up to some (+) supply that's within the output range of an op amp. Wire the op amp to drive the base of both transistors, and balance when the collector current of the first (call it I_c1) and the micro controller's DAC output voltage (call it V_p) obey

V_p = R_x I_c1

(this is a VERY simple thing to arrange). Then, the second transistor will deliver, as its collector current, the 0 to 120 uA range of values when you set V_p *20k/R_x to values in the range of 0 to 2.4 volts.

There's lots of other ways to arrange a high-side current source, but this one is well behaved for low currents (where transistor self-heating can be ignored).

Reply to
whit3rd

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.