Rotary encoder for Dragonboard?


#1

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


#2

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: http://www.digikey.com/product-detail/en/bourns-inc/39LA-1PB-103/39LA-1PB-103-ND/954388 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: http://www.digikey.com/product-detail/en/tt-electronics-bi/EN11-HSM1AF15/987-1188-ND/2408766, 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.


#3

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…