IR photodiodes

I am having a little problem understanding how IR photodiodes work. I have an IR emmiter and IR photodiode (2 pins). So how can I detect with that photodiode if the IR emmiter is emmiting any light? I just want simple ON or OFF (not analog input). Problem is that I don't know how to work with IR photodiodes.

Basically you put a photo diode cathode to an input pin, anode to ground. Then put a pull up resistor to +5 from the input pin or enable the internal pull up.
Then a zero on the input is light and a one is no light.

For a circuit with longer range see:-
http://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.html

Waht is the range of this simple connection? I need half a meter or a litle more.

If by simple you mean the direct connection of the IR diode to the board then about half an inch. The one in the project you might just get half a meter. You might have to up the drive on the emitter.
Most IR remote controls have a built in amplifier which makes them more sensitive.
Look at the arrangement in the Sound Square The Sound Square - that gives you about a foot and a half.

The schematic on that link is for a phototransistor (3 pin) not photodiode - if I understand that correctly.

What about Vishay TSOP18 series? It has 3 pins and integrated preamplifier - if I read that datasheet correctly. It is designed to work with remote controls.

I don't think you will have enough signal variation with just a reversed biased photodiode to generat a logic level switching voltage suitable for a Arduino digital input pin without signal amplification, test it first. The link provided by GM shows the photodiode driving a darlington transistor pair.

Lefty

Realy? I think that the first one is a IR pohotransistor.

If it is a transistor - how should IR photodiode be connected? And what type of transistor is it? Is 2N2222A good?

Is 2N2222A good?

No you want a transistor with high gain not high current so something like a BC183.

There is no difference with how you connect a photo diode and a photo transistor, in some photo transistors the base isn't brought out.

I bought C547B (the only thing that they had and was similar to BC183). I think that it is somethnig like this:

Is this good?

Yep that looks fine. :slight_smile:

Tryed it - I get a change on a distance of 1 cm but no more than that. So probably this transistor isn't good, my resistors have a wrong value (they are 100k and 100ohms - didn't have anything close to 300ohms) or I wired it wrong. I connected IR diode to base of a transistor and another pin to ground.

This is the photodiode:

and emitter:

When the light is detected the singnal gets from 205 to 0 (I am using analog input). And cathode must be connected to ground or event that doesn't work and if I connect 5V instead of ground I get a nice USB overcurrent notice from my mac ;D.

Got it! Modified that circuit a little. I connected cathode of the reciever to the point where arduino is connected, and replaced smaller resistor with 10k. Now it is working on desired length.