2

I've composed a schematic for measuring ambient light intensity using a BPW34 photo diode (Osram brand) and a TLC271ACP opamp. The output will be read using an ADC entrance of an MCU, so VDD = 5V here. Being a digital engineer, I have a hard time understanding the workings of the opamp, but this is what I came up with after googling my way through internet (I understand it's called an inverting amplifier):

enter image description here

I've built the circuit on a breadboard and it almost works: I'm seeing the voltage on IN- change from 0 to 400mV when increasing light intensity, but the OUT signal remains at 0V. Until I remove the resistor and capacitor that is, after which the output reads 2.25V in the dark and moves to 0V when turning up the light. Shouldn't the voltage go up to 3.8V (for a non-rail-to-rail opamp)? (I tried using a 100k and a 10k resistor instead, but I only get a non-0V output when leaving the resistor out)

Instead of a light sensor the circuit now behaves more like a darkness sensor: the voltage starts to go up only when it's starting to get dark, but independent of the light intensity being medium or bright, it always reads 0V when there is a minimal amount of light. How to fix this?

And I don't know what to do with the BIAS_SELECT and OFFSET pins: bias is now low (by connecting BIAS to 5V, but switching it to GND doesn't make a difference that I see. And I don't think I need the OFFSET (nulling) function, so I left them open for now. Or should I connect them both to GND using 12k resistors (putting the "pot-meter" in the middle, so to say)?

Update: turns out the diode indeed was switched: I read 'cathode marked' in the datasheet and assumed it was the little dot on top, while it actually was on the pin.

After that I did some dimensioning on the resistor (I'm sure there is a formula for that) and it turns out that 200k works best, giving a response from 0V for very dark up to 4.2V for very bright light. All set! Tnx all!

enter image description here

Adrian
  • 35
  • 3
  • 1
    The output remains at 0V because there's no real feedback loop to stop it. I would suggest you use a non-inverting configuration with a gain of about 7 because you can't guarantee an output of more than 3.2V with a 5V supply. Low bias mode is fine. – Finbarr May 05 '22 at 10:01
  • The answers to this question (https://electronics.stackexchange.com/questions/36086/does-this-photodiode-circuit-work) provide more information about this circuit. This AD app. note is also very helpful (https://www.analog.com/media/en/technical-documentation/tech-articles/Optimizing-Precision-Photodiode-Sensor-Circuit-Design-MS-2624.pdf). – devnull May 05 '22 at 11:23

2 Answers2

4

If the IN- pin is varying from 0 to +400mV the photodiode is probably connected backwards.

The circuit seems correct.

The input current from the photodiode should be such that the input goes negative. The output of the amplifier will then go positive. The current through the 1Megohm feedback resistor will then cancel the photodiode current to bring the input voltage very close to ground with the output proportional to the current generated by the photodiode.

For that opamp the input should always be within +/-5mV of ground when the circuit is operating correctly.

Kevin White
  • 32,097
  • 1
  • 47
  • 74
2

If you look at the data sheet you'll see that for a 5-volt supply, the maximum output is rated at 3.8 volts - just like you are seeing. At the same time, your input is rising to 400 mV, which indicates the output is not high enough to provide the feedback current needed to keep the - input near ground.

So, it's pretty clear that your 1 M feedback resistor is too big. Try reducing it to 100k or 10k.

devnull
  • 8,447
  • 2
  • 15
  • 38
WhatRoughBeast
  • 59,978
  • 2
  • 37
  • 97