My truly problem is I do not know how combine Arduino and seniors.
Our problem is that without an exact knowledge of the sensor you are using we can’t tell you how to wire it up and how to send the data to your computer.
Assuming you send a number to your computer over the serial port do you know how you will handle it at the computer end?
This is probably an incremental encoder. Connect A to one Arduino input pin and B to another. Connect GND to Arduino GND. Then reading A and B you can figure out how much the wire has pulled. I bet the best way would be to connect A or B or both to interrupt routines, which increment or decrement a global variable.
Grumpy_Mike:
Our problem is that without an exact knowledge of the sensor you are using we can’t tell you how to wire it up and how to send the data to your computer.
Assuming you send a number to your computer over the serial port do you know how you will handle it at the computer end?
Thanks but it is not that helpful I don't read Chinese. It seems their are three models, one with an open collector output, one with a push/pull output and one with a line driver. You need to know which one you have to know how to connect it up.
After that it looks like you have a pulsed data output with up to 5 different scales of output giving different mm per pulse sensitivity. I have no idea what determines what you have.
Also there are two quadrature outputs to tell you the direction. This is just like a rotary encoder and there are lots of examples of how to read those. Like this one:- https://playground.arduino.cc/Main/RotaryEncoders
But, having in mind that Mike has sent such a polite post, I'd limit to say that I've looking for similar sensor and found some of them connected to a multiturn potentiometer.
Depending on the service you intend for the sensor you have to choose one of another.
Regards.