elmegil

Joined: Mar 20, 2012 Posts: 2179 Location: Chicago
Audio files: 16
|
Posted: Mon Sep 24, 2012 10:23 pm Post subject:
Rotary Encoder, cheap |
 |
|
Click wheels on older mice are frequently implemented with a rotary encoder. A rotary encoder basically lets you rotate forever in either direction, and sends out quadrature signals so that you can determine the direction of rotation.
I've been looking at Buzby's Arduino/Sequencer project and thinking about how I'd do it, and I wanted to use one of these encoders. They're not expensive to buy new ones, but for testing purposes I figured I'd use one from a sacrificial mouse. I think this might be of more general interest, since old mice, especially PS/2 models, ought to be easily available from lots of sources for very cheap. And you can get some nice micro switches while you're at it
A couple of useful links for using an encoder:
Best explanation I found of the quadrature and how you'd wire up the bare encoder:
http://www.mcmanis.com/chuck/robotics/projects/lab-x3/quadratrak.html
Several other sites talk about preserving the mouse encoder and interpreting the PS/2 data stream, which seemed like too much trouble for what I was trying to accomplish.
Then for Arduino specific coding:
http://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino
and with some examples that demonstrate using interrupts instead of just polling in your main loop:
http://arduino.cc/playground/Main/RotaryEncoders
It's too late for me to do anything in the way of a "real" implementation on this, but I was able to wire it up with pull up resistors and look at it on my scope to confirm that the quadrature relationship is there. Hopefully in the next couple of days I'll be able to hook it up to the arduino and do some additional testing. |
|