Using Optical Absolute Rotary Shaft Encoder

Hello,

I am a student and this is my first experience with arduino, so I apologize in advance for my lack of knowledge. However, any help would be appreciated to help me understand more about absolute encoders and my arduino uno.

I need to keep track of shaft rotations using an optical absolute shaft encoder from US Digital. Here is the link: http://usdigital.com/products/encoders/absolute/rotary/shaft/A2

The encoder came with a 6-Pin Modular Connector: http://usdigital.com/products/cables-connectors/cables/6-pin/CA-MD6A-SS-MD6

I will be using an ardunio uno.

I will be turning a shaft. I would like to have the arduino display on an LCD screen how many rotations have been completed. I will be moving the shaft clockwise and counter-clockwise. (For example: If I turn the shaft 5 times clockwise, then 1 time counter-clockwise, I would like the LCD to display 4 rotations. I know these won't be exact whole numbers due to the bits, but saying this for the simplicity.)

I know I need to arduino to interpret the analog voltage output from the sensor, however I do not know how.

I have read countless threads and forums about encoders and arduino, however I was wondering if anyone could help me with this specific hardware and purpose.

Is there any starting suggestions, code, or hardware connections that could help me with this project. Any help would be appreciated. Thank you.

npbirked: Hello,

I know I need to arduino to interpret the analog voltage output from the sensor, however I do not know how.

Looking at the data sheet i suspect that the analogue output gives an angular output from 0 to 360 degrees.

It will not however discriminate multiple turns. Index counting would be needed for that. What are you trying to achieve.?

I suspect using the digital output would be easier, otherwise why buy an absolute encoder, incremental would be cheaper.

I am a student and this is my first experience with arduino, so I apologize in advance for my lack of knowledge. However, any help would be appreciated to help me understand more about absolute encoders and my arduino uno.

Are you certain that you want to use that encoder. Using this encoder will require significant work with the data sheet and other technical documents. It has a custom communication protocol, and there is not extensive Arduino Library support, and what comes up on Google is this GitHub - k3ng/k3ng_arduino_a2_sei_bus_encoder: Arduino Library for US Digital A2 SEI Bus Encoders

There is a multi turn mode, but it is not based on a simple index pulse. From http://usdigital.com/support/user-guides/sei-absolute-encoder-communications-protocol

Multi:
multi = 1, multi-turn mode: a 32 bit counter keeps track of the position (it increases or decreases over multiple turns, i.e. 3 1/2 turns at a resolution of 100 would be 350). This counter is cleared at reset.
multi = 0, single-turn mode: position is between zero and the max resolution, according to the shaft angle.
Note: in older versions (V1.X), this bit indicated a fast mode (3msec update rate) with a 9 bit accuracy.
Also, any other command besides position inquires can corrupt the multi-turn position.

I do not know how the multi turn mode relates to the use of analog read to determine the angular position.

In my opinion, you are headed down a path not suited for a beginner with Arduino, and I would advise some research on a different encoder which will suit your needs.

The data sheet you linked indicates that "The A2 is also available with an [u]optional analog output[/u]. The analog output option provides a maximum voltage range of 0 to 4.095 volts with 12 bit resolution. " - does the one you are working with have the optional analog output or does it only have the digital output?

gpsmikey thank you for the response - Yes, the one that we have in our possession is the analog output model