I found this PEC11-4215F-S24 rotary encoder on Adafruit (https://www.adafruit.com/products/377) and I want to use three of them - or another rotary encoder - to use it in my Raspberry Pi project. I was wondering if there is a way of doing that, like with 12C.

I have a Raspberry PI 2, if it changes something.

Thank you!


What you will need is either:

1) Easiest: A system with direct connections to your Pi. This is what joan describes. In this case you will use direct wires to GPIO pins on your Pi. The rotary encoder you describe has a switch and thus acts as 3 switches in total. That means 3 x 3 = 9 direct GPIO connections to your Pi. And since you got 9 switches you will need 9 pull-up resistors too.

2) A shift register IC. This allows you to expand the number of GPIO inputs your Pi can handle. The Pi's SPI bus is the normal choice here. You can use it to directly interface with such a chip. A 74HC165 shift register can read in 8 switches in parallel, and costs very little. They can be "daisy chained" together to create a huge number of inputs, all just using a single SPI bus. I2C might be possible but these are special and more expensive chips.

3) A combination of the above. If you need to read out 3 encoders with switch, then you can use 1 shift register and 1 direct GPIO.

| improve this answer | |

It looks like a standard mechanical rotary encoder.

You can connect as many to the Pi as you can find spare GPIO.

Each encoder needs two GPIO and a ground connection.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.