Using multiple quadrature encoders

Hi,

I have a project where I need a lot of encoders (Hand turned) and I found on ardsim's site :
http://svglobe.com/arduino/in_encoder.html a way to connect them on a bus. (At the bottom of the page) (I attached the diagram below)

It makes the number of pins much smaller.

I know how to read encoders, but in my present setup, the ground pin has always been connected to... ground, and it requires two Arduino pins per encoder.

I am also intrigued by the way the encoder's switches are connected.

I tried to find this setup somewhere else on the net, but no cigar.

Can anyone point me in the right direction?

Thanks for your help.

Jacques

jbellavance:
the ground pin has always been connected to... ground, and it requires two Arduino pins per encoder.

Connect all the encoder GNDs together and then connect them to a single Arduino GND pin.

...R

Hi Robin2,

Yes that's what I am used to do, but the diagram shows Something totaly different.

Jacques

Will only one encoder be working at a time?or several?

Allan

I would think that in your diagram, the two input pins for the bus are configured with INPUT_PULLUP. Then I think you would set the common pin to ground using pinMode OUTPUT and digitalWrite(LOW) depending on which encoder you wanted to read.

To read multiple encoders, you would cycle through the common pins, setting each to ground in turn, and read the two bus pins as you would normally.

Hi,

allanhurst : There will be only one encoder that will be working at a time.

cattledog : I will try to write a sketch to check this. That would mean that reading the encoders would have to be done in the loop(). No use of interrupts possible there.

Thanks for your insight.

I will be back to tell you if I am successfull.

Jacques

1 Like

Tanks you for your help. It works perfectly.

Jacques

1 Like