I've recently bought two OPB706A reflective sensors to make a wheel encoder for a robot. I'm using a BS2 as microcontroller, but i'm not sure how to connect the sensor to the stamp.
The sensor consists in an IR diode (1,7 V) and an NPN transistor bundled together. My question is about the resistors to connect the diode (and how to determine it's value).
Also I need to know if I need to connect the diodes to the BS2 I/O pins or just to the power source (with the apropiate resistors, of course). I think that I can leave the diodes always on, and connect only the transistors to the BS2 pins to get the input from the wheels. Is that correct?
Here is a datasheet of the sensor: