🔧 Turn Your Ideas into Reality!
The Taiss 5Pcs KY-040 Rotary Encoder Module is a versatile and durable component designed for precision control in various applications. Operating at 5V, it features a robust aluminium alloy knob cap and can count pulses in both directions, making it ideal for projects requiring accurate input. Each package includes five modules and knobs, providing excellent value for makers and engineers alike.
D**N
Works great, but super noisy.
They work great, ... as long as the noise is filtered out. I needed to run the signal on wire over 45 feet. This destroyed any ability to simply read DT -- it was just bouncing all over. I tried putting in a 0.1uF cap and tried pull up resistors. Neither was able to filter out the noise. So I wrote some code that seems to be working great. This should run on Arduino and similar devices. Keep in mind that this approach does NOT use interrupts, so it is possible that turns could possibly be missed if your MCU gets busy on other things (though unlikely, unless you're running very long processes).uint16_t debounceDuration = 100;uint8_t clkVal = 0;uint8_t dtVal = 0;uint8_t dtValPrev = 0;uint32_t dtValLows = 0;uint32_t dtValHighs = 0;uint32_t millisR = 0;bool activePeriod = false;bool dir = false;uint8_t clkPin = A0;uint8_t. dkPin = A1;uint32_t currentMillis = 0;void setup() {pinMode(clkPin, INPUT_PULLUP);pinMode(dkPin, INPUT_PULLUP);}void loop() {currentMillis = millis();clkVal = pinReadFast(clkPin);if (clkVal == LOW && !activePeriod && currentMillis - millisR > debounceDuration) { // happens one time once CLK goes low.millisR = currentMillis;activePeriod = true;dtValLows = 0;dtValHighs = 0;}if (activePeriod) {dtValPrev = dtVal;dtVal = pinReadFast(dkPin);if (currentMillis - millisR < 1) {if (dtVal == HIGH) dtValHighs++; else dtValLows++;}}if (currentMillis - millisR > debounceDuration && activePeriod) { // finished active period. fired oncedir = (dtValHighs > dtValLows);activePeriod = false;Serial.print("dir: ");Serial.println(dir);}}
B**N
Wish It Would Have Added Built-In Capacitors
This took me awhile to get working properly because my Arduino code was incorrect. It needs 0.1uF capacitors from the CLK and DT outputs to GND, and I wish these were built in. It's missing a resistor on the switch part, which I'm not using. The parts I ordered have 15 PPR.Here is my Arduino code if this is helpful for anyone...const int i_A = 3;const int i_B = 2;int encoderPos = 0;bool encAValPrev = LOW;void setup() {Serial.begin(9600);pinMode(i_A, INPUT);pinMode(i_B, INPUT);}void loop() {bool encAVal = digitalRead(i_A);if ((encAValPrev == HIGH) && (encAVal == LOW)) {if (digitalRead(i_B) == LOW) {encoderPos--;Serial.println(String(encoderPos) + " Counter-Clockwise");} else {encoderPos++;Serial.println(String(encoderPos) + " Clockwise");}}encAValPrev = encAVal;}
C**I
They work well and seem pretty sturdy
There is some position wiggle to them were position can jump back or not every single jump is recorded but every 2 jumps works fine and the wiggle can be adjusted in code. I'd probably buy these again
K**.
Switch bounce solved
I had a big problem with switch bounce when connecting clk, data, and switch to my Arduino Uno R4 Wifi, using the KY040 code from MediaFire. That program kept firing off a reset (switch depress) even when I was only rotating the dial. I also noticed that the switch was missing the 10KOhm pull-up resistor for the switch line, so I popped one off another switch and soldered that in. Bounce gone completely, and I can count up or down to my heart's content without a reset. Very nice, other than needing to buy a bunch of 10K 0805 chip resistors. Note that the program was supposed to provide pull-ups from the board, but that apparently did not happen properly. I note that two of the pins were analog optional pins, so perhaps that caused an issue. In any case, the switches appear to work well once modified.
=**=
Knobs don't fit, Missing resistor
The knobs don't fit on the D-shaft of the encoders. Also, while the pullup resistors for the CLK and DT pins were installed, the pullup on the pushbutton switch was missing. Other reviewers have had the same problems. Disappointing.
S**T
Very nice!
Very nice quality, machined aluminum caps and pleasing mechanical haptic feedback. (Makes nice clicky-clicks when you turn it, satisfying button press when you push on it.) Easy to solder, easy to find documentation.
D**F
Wrong knobs
The knobs do not fit the encoders. The knobs have a sharp spline shape but the encoder shafts are half circles.
Trustpilot
1 month ago
2 weeks ago