Hi Dias.
Your unit is the same type as mine. It's a 'B E6B2-CW26C', which defines it's shape and size. They're good for 6000rpm, so OK on a lathe.
They come in different resolutions though, ie the customer can choose the resolution (pulses per turn) he wants.
The resolution is tucked away in the other number:
![be6b2cwz6c.jpg be6b2cwz6c.jpg](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
Your ebay photo above says: B38S6G2-F100B526. I have a B38S6G2-C1000B526
The code is:
B = Product Type
38 = Maximum Diameter in mm
S = Solid shaft
6 = diameter of shaft in mm
G = ?
2 = Cable length in metres
F = Output is Complimentary Mode
100 = Pulse Count per Rotation !!! Too low !!!
B = Output Phase ( 2 signals)
526 = Power input Minimum 5Vdc, Maximum 26Vdc
Two things make your choice unsuitable: 100 pulses per revolution is too low, and its complimentary output makes the interfacing the unit to the microcontroller a little inconvenient.
My B38S6G2-C1000B526 has a collector low output and outputs 1000 pulses per revolution, which is OK. Ideally I'd have ordered a 'B38S6G2-C4000B526'. However Joe's comment above very helpfully points out I can write code to read the edges of the quadrature signal, thus getting 4000 pulses per revolution. I hadn't thought of that but it's easy to do!
This is where I got mine – but I see the 4000 position version is no longer available.
Dave