Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: rotary encoder chatter  (Read 827 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys,

I have cannibalized an old mouse and am attempting to use the scroll wheel for a project.

The problem that I am having is in trying to use the code from the playground...

It seems that no matter which direction I turn the wheel, the encoder0Pos value increases - in random intervals.

The little reading I have done online about this leads me to believe this is due to switch "chatter" within the encoder itself.

My question for those more knowledgeable than I:  What can I do to eliminate this 'chatter' ???

-post
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

how did you set the slot-detectors up? You need two, slightly out of phase, to detect direction.

D
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The encoder I am using has three pins to interface with: A, B, and common.

I first wired up the encoder as such to test:

A -> resistor -> GND
B -> resistor -> GND
common -> 5V

As expected, when I rotated the wheel, the results were (keep in mind visible to the eye):

Clockwise:   A and B on, only B, both off
Counter:      only B, A and B on, both off

So it seems that the code from the playground should work adequately, or am I totally off?
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

can you post a pic of how you have it wired up? You might need some kind of buffering on the output of the slot encoders.

Two things particular to encoders come to mind:
- if the encoders are exposed to ambient light this can cause problems
- encoders sometimes work fine with regular linear motion, but not so well with finger motion, as the finger can cause the encoder to oscillate between positions. This might be cleaned up with software in the computer or the mouse's processing chip.

D
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: