Hi!
I'm working on a design where we have to control the intensity of nIR LEDs by controlling the current in the 5-50mA range, in 1 mA steps. We choosed a simple current source circuit (see circuit below). We learned that the LEDs' internal resistances slightly differ thus there is no way to have universal voltage values to put on the opamp's non inverting input. We ended up with the idea to measure the current back via a low-ohmic shunt resistor using an inamp. This way we have the chance to find the 45 current steps by systematically changing the opamp's voltage (using a plain simple interval halving method).
Below is the circuit which performs pretty good at both SPICE and breadboard level however I'm not quite sure that it has no design flaws, so any comment would be great. Thank you.
Explanation:
R_DAC subcircuit is for simulating the control voltage coming from an mcu's dac output. The shunt resistor value is probably a bit high, we should have go down to the mOhm range.