Rotary encoder for Dragonboard?

I am looking for a rotary encoder, that can also be pushed, to run with the Dragonboard.
Any advice?

Hi @Rasmus:

There are two basic types of rotary encoder. Resistance and Quadrature encoder.

The simplest is a potentiometer (resistance), these encoders are typically rotate about 330 degrees, the output is an Analog voltage which you then need to convert to a digital value representing the position of the encoder. Finding one of these with a ‘push’ function is not easy, but here is an example: The switch can be connected directly to one of the GPIOs and read using a library like libsoc. The analog voltage needs conversion from Analog to Digital. The 96Boards specification does not have an Analog input on any of the connectors, but you can use either the linker Mezzanine Board, or the Sensors Mezzanine Board, both of these boards have onboard Analog to Digital conversion.

The second type of encoder is a “Quadrature Encoder”, it outputs two signals A and B. When these signals change you can determine the direction of rotation based on the edge (rising or falling), and the state of the other signal (high or low). After you have edge change and level detection code running (two gpios) it is reasonably simple to use a up/down counter to keep track of the encoder position. Here is an example Quadrature Encoder with push switch:, wire pins C and D to ground, and wire pins A, B and F to three GPIOs on the low-speed connector.

Full Disclosure: I am an employee of Qualcomm Canada, Any opinions expressed in this or any other post may not reflect the opinions of my employer.

1 Like

Thank you for that reply.
I have a quadrature encoder, but I can’t figure out how to interface it. Will need some low level code, I assume. Would you know? Or perhaps know any developer who could help me?
I am also looking for a camera to use with the Dragonboard. Will make another post about that…