Encoder connection with arduino

MaxHeadRoom

Joined Jul 18, 2013
28,686
The output of a incremental encoder is two square waves, 90° apart, hence quadrature.
The two pulses principally are used for both direction and pulse count.
There are also means of using all four edges of the two pulses to increase the count to 4x. if needed.
 

MisterBill2

Joined Jan 23, 2018
18,504
Unfortunately all of the information that the supplier can give is already in the listing. That is the flaw in dealing with them, although the prices are good.
For that encoder there should be markings on it including a manufacturer and a model number. If you can supply us with that information much more help can be available. The resources of this group are amazing!!

For most encoders, aside from the power and common terminals, the other outputs are either open collector transistors, which need a pull-up resistor, or else voltage outputs, alternating between the supply voltage and a very low voltage near the common.

For the one in the listing, the supply range of 5 to 24 volts suggests that the output is open collector, so an active pull-up would be needed.
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
Hello, I want to connect an encoder to an arduino, I know that the red wire goes to 5v, the black to GND, but I need information about the A and B wires, what type of communication do you need, what type of output, etc, thank you very much.
To detect the nature of the output, apply the 5v supply and then measure from COM to one of the outputs and Slowly turn the encoder to see if there is a transition from 0v to 5v.
If very much less, then a 750Ω to 1k pull-up may be needed.
 

MisterBill2

Joined Jan 23, 2018
18,504
The two phases of an encoder are simply pulses a half-cycle out of step. So you will need a counter to count steps. Determining direction takes some simple digital logic that senses the logic state of one channel when the second channel has a rising edge. With a bit more logic you can have pulses on one line for clockwise rotation and pulses on another line for counter-clockwise rotation.
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
The two phases of an encoder are simply pulses a half-cycle out of step. So you will need a counter to count steps. Determining direction takes some simple digital logic that senses the logic state of one channel when the second channel has a rising edge. With a bit more logic you can have pulses on one line for clockwise rotation and pulses on another line for counter-clockwise rotation.
Half cycle, 90° out of step, reason for the name "Quadrature"
That is the whole purpose of two pulses. step AND direction.
The count can be increase by x2 or x4 by counting extra edges.
The direction detection pulse is low in one direction, high in the other.
 
Last edited:
Top