Printer optical encoder as analog input step counter.

Hello, I would like to use optical encoder from old HP printer (It has 4 pins, and capacitor between pin 1 and 3. Part no. 09845 Agilent 58), and count steps with Arduino Mega. Can anyone help? Does anyone know how to connect this encoder to the Arduino, and some code?

Do you have a photo(s) of the unit you could post?

I have attached a photo.

photo.JPG

Does anyone know how to connect this encoder to the Arduino, and some code?

It looks like a rotory encoder. You have to work out what wires are 5V and ground then the other two are the quadrature index pulses. Code you can use is here:- http://arduino.cc/playground/Main/RotaryEncoders

Do I need some resistors, or not?

I don't know, what signals are you getting out of it. Try first just connecting to the arduino inputs. If you can't get a reading then enable the internal pull up resistors.

Could you read the encoder? I have the same encoder and I cannot read it.