Electronic – arduino – Photodiode almost no mV at analog port

5vanalogarduinophotodiode

So I have bought a photodiode, which I intend to hook up to the analog port of my Arduino, so that I can measure differences in the light that the photodiode picks up.

I realized, that when I don't ground the photodiode, I get a lot of mV spanning from 2600mV to 5400mV when I measure with my multimeter – Obviously, however, I cant supply my analog ports with 5.4v or possibly more, as I would destroy the Arduino.

I then tried to ground my anode with the output just before the resistor as follows:

schematic

simulate this circuit – Schematic created using CircuitLab

Unfortunately now, I get close to nothing with a 10kΩ resistor. even with 40kΩ, the output is nothing to brag about – I would at least expect something in 1000mV range, but I barely get 200mV.

What's going on here – Am I doing anything wrong?

Best Answer

A specification for accuracy is missing.
As others have pointed out, leakage current of your Arduino input pin likely limits the accuracy, especially for low-light measurements. Leakage current of the photodiode is probably less than that of Arduino, but also impacts low-light accuracy. Leakage currents are affected greatly by temperature.

If you're using analog-to-digital converter, increase the current-sensing resistor to a large value to improve sensitivity, but be aware that large value resistors, while fairly temperature-stable themselves, make temperature-variable leakage currents impact accuracy to a greater degree.
If you're only interested in light level changes, then to a first approximation you can calibrate out the offsets caused by leakage by taking a zero-light reference reading as a stored reference, and measure light-level changes from that point. A change in temperature might require a new reference reading.

Consider too the maximum light level you anticipate. This will set the maximum value of current sense resistor...as the voltage across the resistor approaches +5V, the diode's voltage decreases - your detected voltage is no longer proportional to light intensity.

A requirement for very wide-range detection (both low-light and high-light situations) might suggest switching in various values of current sense resistors. An extra I/O pin can be programmed for a logic low, or else a high-impedance state where its attached resistor is disconnected. But now leakage is from two I/O pins:

schematic

simulate this circuit – Schematic created using CircuitLab
In this circuit, high-sensitivity is achieved by programming the I/O pin to be high-impedance, so that R2 (100k) is not connected. R1 (10Meg ohm) is the active current-sense resistor. However the leakage current of the R2 I/O pin still impacts accuracy.
To decrease sensitivity in high-light situations, the I/O pin is set to be active logic low. Now you have 10Meg in parallel with 100K as the current-sense resistor.