ir encoders from mouse

I'm trying to use the IR pair from a mouse to track motor speed / distance for a tiny project bot.

I have it working (more or less) using the PCB from the mouse and the PS/2 library from the playground.

Weight and size are both factors. I'd like to ditch the PCB. Has anyone had success interfacing the IR emitter / receiver pair directly? I've ripped apart several mice at this point, and all the ones I've found are 2 pin IR emitter and 3 pin receiver. Anybody have more info like a spec sheet for a similar type setup?

Am I better off just sticking with the mouse PCB as is?

Thanks!

This might be interesting :

http://mechatronics.mech.northwestern.edu/design_ref/sensors/reflectors.html

Hi,
I have looked at using just the emitter/receiver from a mouse, but I have not actually used them this way, so I don't have a working example. That being said, it shouldn't be too hard. The programming would be the hard part. All the parts should be TTL, because mice use 5V power.
The emitter is the two pin device. It's a diode, electrically. Most mice string them both on the same trace so that they can be turned on and off together. Like so: +5--(resistor)---->|--------->|---(transistor)---GND. You don't have to do that of course, you can wire them in parallel or even on separate pins, and you can skip the transistor. You'll need a resistor no matter what, and it's better to over-estimate. These are probably not very high-power IR LEDs. Since you still have the mouse PCB, you might be able to directly measure the resistance that it uses.
The receiver has two outputs and a Vcc. The power is probably the middle pin (on every one I've seen). It acts like a pair of transistors with a common input (the control is the IR detector). I don't know if it needs a resistor on the Vcc pin, but it's worth trying it that way first. The other two pins from each one (4 in all) should be attached to arduino digital input pins. For a first try, just read those pins and dump out the values and see if you can get both 1's and 0's.
The tricky part is now you have to program your arduino to handle quadrature input from two encoders. Polling is probably not going to work very well unless it has nothing else to do, so interrupts are the way to go here. Unfortunately, you only have 2 external pin interrupts to play with. However, with a little digging into the datasheet and the avr-gcc header files, you can find something call "pin change" interrupts. This will generate an interrupt per port when a set of pins changes state. The attachInterrupt() function does not support them at this time. However, you can look at the source for attachInterrupt() to see how an ISR is written.
The rest of the code will consist of decoding the pairs of inputs from quadrature into a reading you can use. There should be examples around here somewhere.

I prefer to keep the mouse guts because it handles all of those messy details for me. I just grab a reading via PS2 when I need one. I have chopped down mice PCBs before. They use the PCB as a spacer and filler in the mouse body: once the encoders are separated, you can jettison the PCB under the buttons, wheel, and other stuff. Be careful: some of the traces connecting the encoders together can get convoluted. Careful use of a multimeter and magnifying glass can reveal which parts can go. I've cut a couple of mice PCBs in half and connected the wires from the encoders almost directly to the controller chip. It's harder with surface mount and expoxy blobs (which is why I prefer older mice), but you can usually find a trace, jumper or solder point that will do.

Good luck. If you get it working, please post some details.