Electronic – How to connect a photodiode

photodiode

I'm trying to design a circuit to measure the ambient visible light (380nm to 750nm). Accuracy isn't too important.

I've been looking at photodiodes, but I'm not sure how to connect them up.

I need the following requirements from my circuit:

  • low power
  • low accuracy
  • low cost photodiode (e.g. this on digikey)
  • AD convert signal for uC

I was thinking of some sort of voltage divider with a photodiode in the circuit? Then connecting this to an op amp, before going to the AD pin of a uC.

Best Answer

Photodiodes are easy. You connect them reversed to the +5V (cathode!) and the anode to a resistor to ground.

enter image description here

If light falls on the diode it will cause a current through the resistor, which will cause a voltage across it. So you can choose the sensitivity by choosing a value for the resistor. You'll have to make sure that there remains enough voltage drop across the photodiode.

enter image description here

Note that the SFH3410 is a phototransistor, you use them in the same way, collector to +5V, emitter to resistor. They have a much larger current, in fact they contain a photodiode, whose current is amplified by a transistor. (Nice product, that SFH3410. I've also used it.)

enter image description here

This is the most important graph from the datasheet. It shows current as function of luminosity. Note that both scales are exponential. 10 lux is twilight, 1000 lux is a brightly lit desktop for precision work. Direct sunlight can reach 100 000 lux. So if you want to measure inside lighting you could use a 12k\$\Omega\$ resistor, which will give you 3.6V at 1000 lux. The SFH3410 will work well up to 4.5V output at a 5V power supply.