Description: Rotary encoders can be used similarly to potentiometers. The difference being that an encoder has full rotation without limits (It just goes round and round). They output gray code so that you can tell how much and in which direction the encoder has been turned. They’re great for navigating menu screens and things like that.
This encoder is especially cool because it has a common anode RGB LED built in, as well as a push-button. Look below for the clear knob that goes with this potentiometer.
Based on 3 ratings:
0 of 1 found this helpful:
kind of difficult to prototype with, data sheet is confusing, but it works. also fun to take apart. can count to 3 really well.
The instructions and data sheet isn’t very helpful for this encoder, but it works really well once you become familiar. I used this to create a new table lamp that glows from under a shelf (above the table). The lamp has 4 NeoPixel strips so I can control their exact colour variation. This encoder is perfect for the test because of the glowing indicator, letting me know exactly which RGB value I’m modifying.
It’s useful to get the RG/RGB breakout. Interpreting the grey code was somewhat difficult due to high amount of current bounce that occurs in this encoder. I saw online that some people use a debouncing circuit with resistors/capacitors. I wrote a C++ class RotaryEncoder(int pinA, int pinB, int start, int min, int max, int step) to accurately convert the grey code changes to an integer counter and didn’t need a debouncing circuit. Using logic, I only needed 2x1K resistors, one for pinA and pinB.
The diagram for this unit may look strange for the LEDs, but it’s accurate. You’ll need to supply positive voltage to the unit, and the RGB pins will need a transistor if you want to control their state from a microcontroller (I used NPN, and supplied output from Adruino pin to the base of R,G,B pin transistor).
I’m VERY happy with the end result of the project.
I bought a few of these for a project I’m working on thinking they were a traditional “Gray code” rotary encoder but that is not the case. Read through the comments and you will find that this is a quadrature or “incremental” encoder which basically means that you HAVE to detect the edge of the output or you will have lost inputs. The encoder at resting position will ALWAYS output all high (or OFF in the datasheet) and so you have to detect when it is turned and not simply poll your pins whenever convenient like you would a normal rotary encoder.
The product description is frankly misleading and needs to be updated. I wish I would have read the user comments before purchasing so I would have known what I was buying.
Also note: the LEDs are more sensitive than you might anticipate. One of my encoders now has only blue and green because I accidentally put too much current through the red diode. I’ve done this with other LED products for a short time and they were fine but in this case the diode was dead instantly.