Pages: [1]   Go Down
Author Topic: Rotary encoder woes!  (Read 991 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello

I've been fiddling about with a rotary encoder and my Arduino with pretty hopeless results. I've done plenty of Googling and tried various different approaches including the basic one detailed in the Playground page for rotary encoders, using interrupts and a very clever one that used some analog pins and some seriously indecipherable code!

The various problems I've been having include detection in one direction only, no response at all, too many turns needed than is practical and of course some horrendous bouncing!

First of all it's worth saying that the encoder I've used may well be rubbish or even faulty. It was salvaged from a dead Akai Sampler. So I've ordered an Alps STEC12E08 which is specifically named in some examples as working well and hopefully that'll be Ok.

We'll see but first a few questions.

1. Is the use of cheap mechanical rotary encoders just a nightmare full stop or can I expect to get good results if applied properly?

2. Should I be hardware debouncing even if the example code I use attempts to debounce in software?

3. If so then what do I use for hardware debouncing?

4. I'm using the rotary encoder only as a user interface device to scroll through and select a series of values on an LCD. I don't care about it's position only whether it turns left or right. If it does I want to effectively trigger an "event" and allow the software to increase or decease a value accordingly. Many of the code examples I've seen seem more complex than this. What's the best approach for this simple task?

Thanks
Jim
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 515
Posts: 31567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1) Yes the two knobs on this project are both very cheap mechanical rotary encoders used without interrupt.


2 / 3) Yes I would, I have used this:-


Although you can just use the capacitors the Schmidt input inverters clean things up and the 74LS74 gives you simple step and direction pulses without any software at all.
Logged

Pages: [1]   Go Up
Jump to: