2 pin IR example schematic and code

Hi All,

i purchased a pair of these but have had difficulty finding any example arduino schematics and code for 2 pin receivers. There seems to be plenty for 3 pin. Just wondered if someone could point me in the right direction as I haven't had much luck so far.

Any help is greatly appriciated. Thanks in advance.

The three pin devices are typically 38kHz demodulators as well as a photo diode. What you've got is just a photo diode.

What are you trying to do?

Arduino <== RadioShack emitter detector circuit

Thanks for the replies and the video guys. Essentially I'm trying to create a simple shutter speed tester similar to this

He appears to have a 2 pin receiver but as I understand it from what AWOL said, this I'll need a three pin one with a demodulator?

Thanks again for your help, really appeiciate it.

I can't see why you'd want want a 38kHz device for a shutter tester. A pnotodiode should do just fine.

AWOL: I can't see why you'd want want a 38kHz device for a shutter tester. A pnotodiode should do just fine.

Yes you're only measuring time, detector behind shutter, this should work fine...

Regards

Mel.

I see, I suppose this circuit should do the trick (removing the buzzer and using a hitache lcd to display the times) with some alterations to the code?

Hi, Yes that could work, except I use a 10K resistor between the phototransistor emitter and GND with this junction to the Arduino pin. And just measure it with pulsein.

Regards

Mel.

Cactusface: Hi, Yes that could work, except I use a 10K resistor between the phototransistor emitter and GND with this junction to the Arduino pin. And just measure it with pulsein.

Regards

Mel.

Thanks Mel, did you mean to put a link where 'this' is as I'm not sure which junction you are referring to. Thanks again, Oliver

You might just as well delete the 3k resistor altogether ("deleting" means putting nothing in its place, no connection) and enable "INPUT_PULLUP" in the code.

Hi oduffy,
That 3K resistor does not go to 5V+ according to that schematic?? Most photo-transistors of the 2 wire type have the emitter on the short lead, (same as LED Cathode) from here a 10K resistor to GND, then also a connection straight to an Adruino pin input. This gives a LOW for no light and a HIGH for light!

The transistor is off without any IR, so the emitter is LOW, IR switches it on current flows from collector through 10K to GND and 4V+ is across the 10K, take this to arduino input…

Here’s an image of my line follower using the Vishay TCRT5000, buy you can wire individual parts like yours the same.

Regards

Mel.