Electronic – Measuring light levels with a photodiode and an ADC


I'm trying to use a photodiode to measure light levels via an ADC on an ATMega168. I've got the microcontroller code working properly (measuring values on a pin and reporting it as an led brightness) but I'm having trouble getting the photodiode to report a voltage dependent on light levels.

I see that I could accomplish this with an op amp (here) but I'd like to be able to do this without an op amp if possible. I have a 5 volt source and I'd like to make the photodiode spit out values between 0 and 5 volts. Is there a crafty circuit I could use for this purpose that doesn't require an amplifier? I'm asking this question because I'd like to know how to use a photodiode for this purpose (I don't want to use an LDR). Thanks!


Oh yeah, here is the datasheet for the photodiode I am using.

Best Answer

Important notice This is an IR diode: Daylight blocking filter matched with 870 nm to 950 nm emitters. IR photodiodes usually have an opaque black package, while visible light photodiodes are in clear packages. You could look for a photodiode (a phototransistor is even more sensitive) with an eye sensitivity curve. I remember having used the SFH3410 from Osram here.

Then the good news: a photodiode or phototransistor acts as a current source, so a series resistor is sufficient to convert the current to a voltage. In your datasheet the graph of figure 3 is the one you need. The reverse current varies between 1uA and 100\$\mu\$A. A series resistor of 10k converts this to 10mV - 1V. You could increase this to get a higher voltage, you'll have to experiment with light levels and resistor value to achieve a full range of 5V. Also keep in mind that the input impedance of the ADC is parallel to the measurement resistor, reducing sensitivity.

The graphs below are from the SFH3410's datasheet. If you keep in mind that you need a \$V_{CE}\$ of at least 0.5V (right graph), you'll be limited to 4.5V output from a 5V power supply.

alt text

Further reading:
SFH3410 application note