Testing Rotary Encoder

Well been playing with a rotary encoder for the last few days, and got rotation figured out , but something strange occurs when I push the button in I am getting random responses. I can move the whole sensor unit, twist it about and it begins to count to the serial monitor. This leads me to believe something may be wrong with my sensor unit. what is the best way to test this unit to make sure it works alright. The rotary works well, but the push button I'm having random issues with. I even just used the button state change example code

for testing and I still get randomness.
Anyways can I test the push button with a multi meter, maybe check current? or will i need a probe?

Hi, are you debouncing the button input?

Also are you using a pullup or pulldown resistor.

Tom..... :slight_smile:

Tom, thank you I will use that sketch to see if the debounce helps. there are 10k resistors on the board for SW,DT,CLK.

Well I used the deb ounce code on this unit, and yeah something is wrong it flashes on and off all on its own, and if I pick up the board, without touching the button or anything else, it changes LED from on to off, and vice versa. Perhaps the resistor is messed up, I will drop and 10k resistor in and see if that works. At least I can narrow it down that way.

Well I got some serious issues with this rotary encoder… r1 is missing though when I put a pull down it doesn't work , aside from the same random things… off to check the board.

HI, can you post a link or data on the encoder unit please?

Tom....... :slight_smile:

I got it out of this kit

and for a better pic second column 8th down.

I have no clue where to find data sheets on this either.

Hi, after reading the sales hype and the reviews and if I new little about electronics I'd give amazum up as a bad joke for selling such a poorly supported product. DX unfortunately are of similar philosophy.

I could and do trawl the ebay fee postage auctions. Get better component backup and decent postage.

Can you post us a good closeup of the encoder, especially if it has any numbers on it.

We will try and identify. The pic on amazum does help.
Tom..... :slight_smile:
Just found

Enjoy 8)

Thanks for the link I tested it and it does just fine, so obviously I have an issue with some code and not the unit. Now I got something to work with, thank you very much.

Well I have done some testing , and I think maybe this old bread board might have some issues, I will have to try a different one when I get home.

No pull down/up
Encoder library uses pull_up on inputs.
So the 3 pins on encoder goes: middle pin to GND, the other to inputs.
(1st of the two preferred an input with intr. capabilities)

sensai:
Well I got some serious issues with this rotary encoder… r1 is missing though when I put a pull down it doesn't work , aside from the same random things… off to check the board.

Hello ... I may have a similar rotary encoder. It looks like the one you posted links to. Regarding resistors you said "r1 is missing". Same thing with mine, which was surprising because on eBay, where I got mine, there was a picture showing all three resistors present. On mine the r1 is a pullup for the switch, keeping it high when the switch is not being pressed. But because it is missing the switch is floating low. The sketch that finally worked for you included using internal pullups on the pins such that the missing r1 pullup therefore had no effect. Do you agree? The point here is some of these rotary encoders are coming through without the r1 pullup resistor on the switch and that may need to be accounted for when connecting to an Arduino. I ordered some 10k SMT resistors and am going to try to solder in the missing resistor. I've heard that using the Arduino's internal pullups is generally not advised, though I'm not sure why.
-- Peter