The HP Q9874 and Q9898 are optical encoder modules that run on 5v and
output quadrature at TTL levels. They have four pins with pin 1 marked
with a white dot.
The pinout is
1=GND
2=PhaseA
3=+5V
4=PhaseB
if you have an heds9000 enocder
5=Phase B
4=+5V
3=PhaseA
2=Index pulse
1=GND