# reading 10 incremental rotary encoder with one Arduino Due

Hi every body

I want to read 10 encoders simultaneously with interrupts pin of one arduino board. is this possible? any other solutions?
(arduino due is in my mind.)

**My Encoders info:
HEDL 5540
500 pulse per turn / 3 channels

**Motor Max speed:
7000rpm

is this possible?

NO.

pooyasf:
is this possible? any other solutions?

Calculate the signal frequency you need to support. Then decide what you need to do with the data you're collecting. Are you just counting pulses, or something more?

I want to count pulse and determine direction. The final purpose is to calculate speed and direction.

Grumpy_Mike:

is this possible?

NO.

can you please explain more why it is not possible?

can you please explain more why it is not possible?

And if I would have said yes then you would have asked me how.

Look at the figures.
Speed 7000 rpm
that is 7000 / 6 = 116.7 revolutions a second
At 500 pulses per revolution that comes to be 116.7 * 500 = 58.35 KHz pulse rate
So for 10 encoders that is 583.5 KHz pulse rate.
You have to have one signal generate an interrupt on its edge and get to read the other signal before it changes. It is quadrature so it changes in effect four times this rate, so you have a rate of 2.344MHz or 426 nS to service the interrupt.

Your due has a nominal clock of 84MHz or a period of about 12nS per clock pulse. Therefore you have 35.5 clock cycles to service the interrupt and 106 clock cycles to do all the other stuff you want to do.

My experience tells me that this will not be enough to do what you want. Now you might very well want to try it, or relax the specification it is up to you. But if you were not able to do those calculations I would suggest that you might not have enough experience to do this project. I would not even attempt it without having very good test equipment, much better that the average hobbyist. Maybe a 1GHz sampling scope at least. And at those sorts of frequencies your design, layout and impedance matching has to be spot on.

If I had to do the project I would look at getting some hardware in to help you or maybe a dsp (digital signal processor). Or you could use something like an FPGA, and if you donโt know what that is then you have another 2 to 3 years learning about that.

pooyasf:
I want to count pulse and determine direction. The final purpose is to calculate speed and direction.

Then you're back to the first question: Calculate the signal frequency you need to support, and estimate how many CPU clock cycles you will need to handle each signal..

pooyasf:
any other solutions?

you can use quadrature counter Interface ICs such as hctl 2022.
for each encoder use one hctl and connect them to arduino board with multiplexers. now you can access to encoders data sequentially by read each hctl output.
with this method, you will have access to the data encoder, but not all of encoder accuracy.

mehdierc:
you can use quadrature counter Interface ICs such as hctl 2022.
for each encoder use one hctl and connect them to arduino board with multiplexers. now you can access to encoders data sequentially by read each hctl output.
with this method, you will have access to the data encoder, but not all of encoder accuracy.

Hi Iโm trying to set up an Avago HTCL-2022, do you think you can offer me some tips or share your code?