|Package Dimensions||8.4 x 5 x 2 cm; 50 Grams|
|Item Weight||50 g|
|Is Discontinued By Manufacturer||No|
|Date First Available||7 July 2019|
Cylewet 5Pcs 360 Degree Rotary Encoder Code Switch Digital Potentiometer with Push Button 5 Pins and Knob Cap for Arduino (Pack of 5) CYT1100
|Price:||+ $7.46 Delivery|
- Length of Shaft: 20mm/ 0.79in
- 5 pins
Frequently bought together
Have a question?
Find answers in product info, Q&As, reviews
Your question might be answered by sellers, manufacturers, or customers who bought this product.
Please make sure that you've entered a valid question. You can edit your question or post anyway.
Please enter a question.
Length of Shaft: 20mm/ 0.79in 5 pins Package Includes: 5 Rotary Encoder Code Switch Digital Potentiometer 5 Knob Cap
Review this product
Top reviews from other countries
However, figuring out how they work, in the complete absence of any documentation is a bit of a pain.
There are three pins on one side, two pins on the other side. There are also two larger pins on the other sides, for mounting or alignment purposes.
The two pin side is very straightforward, and represent the two pins of a normally-open switch.
The three pin side is also straightforward, in that the center pin is the ground, and the other two represent what I will call encoder1 and encoder2.
When you rotate the spindle, you will find that there are a total of 20 detents (bumps) during a rotation of 360 degrees.
Each movement of the spindle from one detent to the next results in the encoder1 and encoder2 pins going through multiple transitions, not a single one (as you might expect).
Assuming that you have tied the encoder pins to (say) 5V with a resistor, a rotation between detents, will produce a set of encoder transitions. For example: 11 10 00 01 11 (clockwise) or 11 01 00 10 11 (anti-clockwise).
Thus, in the first state change from 11, you can tell whether the rotation is clockwise or anti-clockwise.
So, a practical use of this, in either the Arduino, the Raspberry Pi, or some other platform, will require polling the two encoder pins, and monitoring the state transitions. When you see a full set of transitions from 11 back to 11, you can determine whether to increment or decrement the counter you are associating with the control.
The polling speed is determined by how fast you expect the user to twirl the dial! I use 1 millisecond polling on my Raspberry Pi, and I cannot twirl the dial fast enough to lose any transitions. You can use slower polling, if necessary. In my case my Pi has little else to do, so why not a fast poll?
I hope this helps others quickly get up-to-speed in using these devices.
Reviewed in the United States on 8 March 2020
Now, here's the thing: the Bildr code sample didn't work reliably at all. Maybe the code is OK and it's just not compatible with this particular encoder (even though people keep recommending it), but bottom line is that the final solution a exhibited very erratic behavior with lots of duplicate codes and practically no way to make a full turn without losing alignment. I was ready to blame the cheap encoders, but then I realized I haven't tried the proper Encoder library from Arduino. As it turns out, it worked flawlessly.
If you're using these with Arduino, just grab the "official" Encoder library by Paul Stoffregen and save yourself some hassle.