I have an Arduino and have attached a motor shield to it. That leaves me with only the analog pins available. That however, is not the problem
I’ve just purchased this http://www.cytron.com.my/viewProduct.php?pid=DDQwOwQ0KSQNKgUBAzEAD2QZMXXeD6ENnWJfJ5bII6g= to be used for an edge detection robot.
Problem is, I can’t make heads or tails of the pin. There is a pdf file regarding the pins http://www.cytron.com.my/usr_attachment/SN-IR-1.pdf but I’m not too clear with it.
I just need clarification on what pins 1,2 and 3 are.
Pin 1 ground
pin 2 detect
pin 3 supply.
Using Groove's listing of the pins, I would suggest the following:
a 10K resistor between the Detect (2) pin & +5V. This way, the detect stays high, until the photo transistor (detector) gets a signal (then drops to GND).
Still keep a 1K resistor to the supply pin (3). Especially if you're constantly leaving the LED output constant. (always on), or even if pulsing it with a pin output.
The detector is similar to a NPN transistor, using the detected IR as the "Base" connection to complete the circuit.
Most IR detectors operate in the 32Khz band, and can be varied slightly to detect distance. (IR Radar.) I used a similar circuit to this device, using the emitter/detector pair Radioshack sells, when I broke the pins to the IR receivers for an Parallax BOE-Bot, and was surprised the internals of the receiver could be mimicked so simply.
Though, You might also want to place some kind of tube shield around the detector, to keep it focused forward and away from the emitter, and ignore stray IR waves that bounce from the side.
Also, to get an accurate "Detect" you'll need a 3ms delay between the pulsed output of the emitter, then the detector. Otherwise, side by side, You'll get a false "Detect" signal.