Electronic – arduino – create a multiplexed array of IR photodiodes


I'd like to use an Arduino to read from a large number of IR photodiodes. I have seen this question: How to Use SFH235 IR Photodiode Correctly? and would like to use a similar technique to the circuit on the left:

enter image description here

However, I'm not just trying to read from one photodiode. I have a large number of photodiodes arranged in a grid. I would like to be able to read from this grid with the simplest possible wiring scheme. I thought that it might be possible to use a scheme similar to what is often used for grids of LEDs:

enter image description here

D1,2,3 represent digital pins. I would operate this by setting e.g. D1 to output LOW, and the other two to high impedance. My hope is that this essentially "disables" the second and third column of photodiodes (since their anodes are effectively disconnected), and I could use the ADCs to read only the first column. Then I would toggle the digital pins to activate the second column, then the third, etc.

Will this work? I was originally concerned that the high-impedance state of the Arduino would be too leaky, but this link suggests that it's equivalent to a 100 Mohm resistor.

Aside: I'm an amateur, I don't really have a good grasp on the behaviour of photodiodes, so I find it difficult to reason about situations like this. I also had trouble finding SPICE models for photodiodes, so I couldn't really simulate this setup. Does anyone have pointers to approachable introductory resources for photodiodes, or SPICE models?

Best Answer

The basic multiplexing structure looked superficially OK. However Kevin's comments pointed out that, as drawn, it doesn't work well. When subject to light, photo-diodes have a defined current at all voltages, forward or reverse biased, so they aren't directly connectable as an array of 'proper' diodes like LEDs would be.

You can salvage the matrix concept by adding a single small-signal diode in series with each photo-diode, a 'proper' diode like 1N4148, to conduct the photo-current down to the multiplexing D line. The voltage drop in this diode is of low consequence for accuracy, as the photo-current develops a voltage across the 1M resistor, this is the thing you are measuring with the ADC. The diode drop does change the reverse bias on the photo-diode, so a spread of these will increase the mismatch between the diodes slightly. However, using variable reverse bias and the Arduino internal ADCs indicates to me that accuracy is not the most important spec point you are working with.

To multiplex the rows, take each 'off' D output to 5v. This will reverse bias all the silicon diodes and isolate the photo-diodes.

Don't forget to program the ADC inputs for 5v swing, and do an extra read to flush the pipeline after changing rows.

However, the range of best light sensitivity will be somewhat limited. With the fixed 1M bias resistors, the best sensitivity will be around 2.5v and 2.5uA. It will read from dark to sunlight, but the resolution at the ends of the range will be compressed.

You could use extra Dout pins to switch lower/higher value resistors into the bias to shift the most sensitive range to other light levels. Just a thought.