Ranging Light Sensor Feedback Loop

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would be really dubious of that circuit. Why? Because most FETs are not made to be small signal DC stable, especially with temperature or from unit to unit.. Depending on the FET, there can be a 25% variation in gate threshold voltage between units.

Better is to use an NPN transistor with an emitter resistor. Use an op-amp to sense the emitter-ground voltage and compere that to the filtered PWM voltage. Use the op-amp output to control the base voltage. This will give you a very stable and repeatable current transfer function.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was given the task of eliminating an analogue multiplier circuit ( Gilbert cell LM1495 ) with all the trim pots and tweaks in an application where it was used in one quadrant only.

The outcome was a design based on a dual JFET used in a similar configuration above.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim, MOSFETs are out then, based on accuracy.
What your suggesting is a voltage controlled current sink using a sense resistor, like the attached circuit?

I'm not against using an op amp if it's the best solution but I have failed to state my objectives, mostly being cheap, fast and decently accurate, along with a little bit of size and small power consumption. Yes, that's asking a lot, I want my cake too...

Comparatively, off the shelf is the MAX44009 which satisfies everything but cost and speed..

Ignoramus, based on the above with respect to Jim's suggestion?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, that is exactly the circuit I was suggesting. You may need to add a resistor in series with the base, and a small cap across the resistor to stabilize the local feedback loop.

Well, accuracy is out with any phototransistor. They, like FETs, have a huge range of characteristics. If the photodevice is linear, you may be able to correct for gain and offset in the post-ADC processing.

I am, however, a bit concerned about the basic circuit premise. You have two current sources in series. The transistor-opamp circuit is actually a rather good current source. So, I do not know what defines the voltage at the ADC input. It might work to add two large resistors (say, 100K to 1Meg range). one ADC input to ground and one, ADC input to Vcc.

There is a second problem. The ADC is designed to work with source resistances of 10K or less. Your 2 current source circuit will violate that. How the ADC will behave is up for grabs. You COULD help it with a capacitor (say 1nf) from ADC input to ground.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course is the op-amp is a dual op-amp package one could also use the second op-amp as a voltage follower to buffer the ADC signal which drives the ADC input.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim,

The phototransistor I'm using is the TEPT4400: http://www.vishay.com/docs/81341...
On a log-log plot it's current vs lux is linear over the charted area (1000 lux) where y=2x^1. What happens outside the charted area I have no idea, as well, temperature puts it all over the place.

Even with the FET I've been operating well outside the recommended input impedance of the AVR while dark. I was initially thinking about using both a P and an N (top and bottom) driven independently based on operating area but then the circuit and software gets a bit hairy. As I'm looking for sub 10us timings from light event to output pin toggle, a cap to match impedance is out.

From perusing interwebs, it appears the norm is photo diode and transconductance amplifier. Oddly visible light photodiodes are rather expensive.

Given the costs and challenges I may just use an off the shelf light to voltage type device that includes some form of gain control.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JC, a voltage follower would certainly fix the input impedance.

Rohm has some nice parts with a price so low it's hard to justify spending time on an alternate solution. Though the feedback loop is highly intriguing to me, it may become a side project...