Arduino and identifying Optical Encoders?

Hello, I am an Arduino newbie and I have an old HP Deskjet 3325 I've taken apart looking for stepper motors - only to find it uses two DC motors and an optical encoding wheel / tape to control each of them.

So now I'm curious. How hard is it to use optical encoders with the Arduino?

The encoders are both 6 pin and both from Agilent. One's marked '9986/S229' and the other '9985/S232'. I had assumed that was a part number, but after googling for 30 minutes and having no luck I'm beginning to wonder if it relates to the encoders themselves?

I'm about to try desoldering them from the boards and experimenting, but any tips regarding optical encoders and/or directions to datasheets for something equivalent to these particular encoders would be welcome!


Have a look at this, it should help you understand what’s going on.:-

Those are probably "house numbers": when a manufacturer buys enough of a particular part, they can often get the vendor to put their own number on it. That way, if they have multiple products that use a simple NPN transistor, they can buy 2N3904s, 2N2222s, etc., from many vendors, and have them all marked "4724" so they don't have to change assembly instructions every time a new supply of transistors comes in.

There was a thread here in the last week or so by someone who was doing the same sort of scavenging, and managed to decode the pinout of the encoder and match it up with a similar part. A forum search for that may save you a lot of time.


Thanks, yes I've since found the Agilent sensor does seem to be a special part. According to a PDF from the Avago site (who seem to have bought Agilent IP),

9986 indicates a part number and S229 indicates a 'special part' built in week 29 of 2002.

Two of the six pins are obviously for powering the LED on one half of the plastic housing, and I can see an LED emitting red light in there.

By examining the PCB it came of I believe I've identified power, ground and two channel pins on the other side of the unit. However I can't get the unit working with it's original encoder wheel (attached to the printer).

Ah well, I'll search the forums anyway - thanks. Beginning to think it might be simpler to just buy a rotary encoder new. At least then I'd get a part#/data sheet!

I have been searching for the specs for similar optical encoders made by Aglient for a while too. And this spec ( seems to represent these 2pin-4pin optical encoders.