IR Led and IR photodiode question

Hey all,

Looking for some confirmation about an IR Led and photodiode (two pin). used for object detection.

This is the LED
Since forward voltage drop is 1.25 V, and assuming I'm using a 5 V source from the Arduino, I assume I need to find a resistor. So which current would I use when finding this resistor, would it be the forward current of 150 mA? If so:

(5V - 1.25V)/150e-3 = 25 ohms.

If that is correct, I'm onto the wiring. Based on what I've read, I want to reverse-bias the photodiode. So essentially, I need to connect the:

  • Long pin of the IR led to a resistor and to 5 V
  • Short pin of the IR led to the long pin of the photodiode and this connection to ground
  • Short pin of the photodiode to a resistor and then to digital HIGH and analog read

Here is the Circuit

Am I on the right track? I'm not quite sure what resistor to use with the photodiode. The photodiode datasheet can be seen here

Is anybody able to confirm my theory and offer some help?

Thanks for your time.

Your calculation and 25 ohms is correct. You might want to use a higher value depending on how much light from the IR LED that you actually need.

Regarding the resistor to use with the photodiode just test different values. While there probably is a way to calculate the needed value it's a lot easier to just use trial and error -- or use a potentiometer so you can adjust the resistance easily. Just don't go below ~250 ohms so you avoid drawing more than 20ma from the digital pin (pin 2 in the example).

(5V - 1.25V)/150e-3 = 25 ohms.

Although the calculation is correct, take into account that 150mA is the maximum rating and Vcc of your Arduino might be higher than 5V if you use USB for powering it. If your USB provides 5.25V and you use 25Ω, you're over the 150mA and might damage the LED.
Also take care not to connect that LED directly to an Arduino digital I/O pin because the maximum rating of an output pin is 20mA (as Chagrin already stated), so to drive the LED you must use a transistor. Although the linked circuit is wired differently you might want to go beyond that layout.