3
\$\begingroup\$

for my project, I am using a photodiode, that I connected to the AD822 OpAmp. This OpAmp should then be connected to the MCP3008 ADC. I am reading the data from the MCP3008 with a RaspberryPi. I am however getting weird readings from the ADC. I guess that this is because there is some sort of fluctuations in the voltage coming out of the OpAmp. Below there is a diagram of my wiring as it currently is (I am using the negative side of the 9V battery as ground):

Wiring of the OpAmp to ADC

I use single supply voltage for the OpAmp, as I do not have the possibility of dual supply.

If I try to measure the Voltage across the 10kOhm resistor with an multimeter, I get a value of 0V. However, according to my ADC the Voltage input Voltage fluctuates between 0 and 1.7V.

Now, if I disconnect the ADC and remove the 10µF capacitor and connect the 10kOhm resistor directly to ground, I get readings with my multimeter of 0.04V with ambient light and about 05.V if I put my flashlight over the Photodiode. So it seems to be working like that

Am I wiring something wrong? Are my capacitors or resistors wrong / at the wrong place?

Here are the datasheets: Datasheet Op Amp; Datasheet ADC

Thank you in advance!

EDIT after jusaca response:

enter image description here

EDIT with Solution:

Jusaca, thank you for the decoupling advice and the relation between Rf and Cf.

I have worked on it more and finally realised what the last error was: I had to connect the negative side of the 9V battery to the ground of the MCP3008 and to the ground of the RaspberryPi. So connecting the entire "ground" side (the bottom line in my diagram) to both the negative side of the battery and the ground of the RaspberryPi and both grounds of the MCP3008! :)

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Where is your power supply decoupling capacitor needed for the op-amp? \$\endgroup\$
    – Andy aka
    Commented Mar 12, 2021 at 11:25

2 Answers 2

2
\$\begingroup\$

The voltage over the 10k will always be practically 0V, because no current is flowing in the ADC input. You have to measure the voltage over the capacitor (meaning from ADC input to ground) to see the same voltage the ADC is seeing.

The fluctuations you see in the ADC signal indicate that the OpAmp is not in stable operating conditions. As Andy mentions in the comment: You need to decouple the supply voltage with something like 100nF between V+ and V- as close as possible to the supply pins of the OpAmp. This gives a low impedance path for the supply current.


Another common cause of instability with transimpedance amplifiers is a lagging phase due to the capcaitance of the photodiode. If the phase lag approaches 180° the negative feedback becomes positiv feedback and the amplifier may start oscillating.
To compensate for that a feedback capacitance \$C_f\$ is placed in parallel to \$R_f\$. In your case that is the 1300pF. How did you get that value? You need to know the capacitance of the diode as well as the GBW of the OpAmp to calculate a matching \$C_f\$. You can read the details in this TI paper Compensate Transimpedance Amplifiers Intuitively, but the short form is:

\$ C_f = \frac{1}{4 \cdot \pi \cdot R_f \cdot GBW}[1 + \sqrt{1+8 \cdot \pi \cdot R_f \cdot C_D \cdot GBW}] \$

So if your feedback capacitance varys to much from the ideal value that might be the cause of the instabilities you see.

\$\endgroup\$
6
  • \$\begingroup\$ Thank you for the info about the Voltage. If I understand you correctly, I should connect the decoupling as I showed in my edited post? Because if that is the case, I still get a lot of fluctuations on my ADC \$\endgroup\$
    – Samboff
    Commented Mar 12, 2021 at 13:07
  • \$\begingroup\$ I extended the answer by a another problem that may result in the fluctuations you see. \$\endgroup\$
    – jusaca
    Commented Mar 12, 2021 at 13:48
  • \$\begingroup\$ Hi! Thanks for the comment. I got the value from the Analog Devices Photodiode Wizard. For my usage, as I should get high intensities of Light, Rf = 178 Ohm, and Cf = 1300pF. I changed the Rf to a higher value to test it with ambient light and flashlights. I changed everything back, so Rf = 178 Ohm. However I still get similar fluctuations in my MCP3008. Often getting 0V as output \$\endgroup\$
    – Samboff
    Commented Mar 12, 2021 at 14:39
  • \$\begingroup\$ But to be honest I have no further ideas where the problem might be... \$\endgroup\$
    – jusaca
    Commented Mar 12, 2021 at 16:47
  • \$\begingroup\$ Out of curiosity: What kind of diode do you use to get such low resistor values? With 178 Ohm you need more than 5mA of photo current to get 1V at the ADC. \$\endgroup\$
    – jusaca
    Commented Mar 12, 2021 at 16:48
0
\$\begingroup\$

Since I can't post a comment with an image, this is just a "heads up". I assume the ADC is being powered with the same reference, but different voltage, right? You should protect the input (a 1N4148 diode with the 10k resistor already present is fine):

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ The ADC is being powered from the 3.3V fom the RaspberryPi. Vdd and Vref are both 3.3V \$\endgroup\$
    – Samboff
    Commented Mar 12, 2021 at 12:08
  • 1
    \$\begingroup\$ @Samboff This is fine. The IC has internal protection diodes. The problem is that when we can't guarantee the current that the internal diodes can handle from the datasheet, and since you are prototyping and can accidentally connect the input to 9V (don't...) or even the opamp output, the clamp diode is a simple measure that can save your ADC. \$\endgroup\$
    – devnull
    Commented Mar 12, 2021 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.