I'm playing with a ranging light sensor where the lower leg of the divider resistance is provided by a logic level N MOSFET.
The MOSFET gate is controlled by a filtered 13 bit PWM and the divider output is sensed by 10bit ADC.
This is giving great range as a single bump on the PWM equates to about 50 ADC counts. For a total sensor value I'm multiplying the PWM by 50 and adding in the ADC.
The current control loop works to drive the ADC to 511 by adjusting the PWM. And while I've googled around quite a bit I haven't found much information regarding the control loop or even the optimum choice of components.
Has anyone suggestions on components (JFET?) or the method of control loop (PI?) that would best serve this?
Thanks!