• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Ups and Downs of Rotary Encoders?

Status
Not open for further replies.

Speakerguy

Active Member
Hi,

I am planning to use rotary encoders in my next project. I've never used one before. I need a 'coarse' and a 'fine' adjustment knob for a DDS frequency generator, and there might be a lot of ambient noise (tesla coil for example) so I don't want to use a simple pot and ADC pin for each.

Is there anything I should know about rotary encoders before I use them? I plan on using the port B interrupt on change and always interrupting on the falling edge of one signal and then looking at the value of the other signal to determine direction change. Does that sound reasonable? Any thing that might be problematic with that in a very high EMI environment?

Thanks!
 

kchriste

New Member
Forum Supporter
You might have more luck using a LPF between the POT and the ADC. I assume the ADC is in a PIC or AVR, etc? EMI on an interrupt pin can be pretty disruptive on a micro also. The neat thing about using a rotary encoder is that you can easily make them multiturn and use the same encoder for both fine and coarse adjustments by toggling a divide ratio in code. Whatever input method you use, you'll need to stop any EMI from getting into the DDS and associated circuitry. If you don't, random resets and erratic operation will be the flavor of the day.
 
Last edited:

Mr RB

Well-Known Member
Hi,

I am planning to use rotary encoders in my next project. I've never used one before. I need a 'coarse' and a 'fine' adjustment knob for a DDS frequency generator, and there might be a lot of ambient noise (tesla coil for example) so I don't want to use a simple pot and ADC pin for each.

Is there anything I should know about rotary encoders before I use them? I plan on using the port B interrupt on change and always interrupting on the falling edge of one signal and then looking at the value of the other signal to determine direction change. Does that sound reasonable? Any thing that might be problematic with that in a very high EMI environment?

Thanks!
The system you mentioned will only give a 1 in 4 resolution of the encoder, you can get 4 times better resolution with my system shown on this page;
TrackBall Interfacing - TrackBall to PIC microcontroller

I wouldn't use the int on change feature, but manually poll the encoder pins and include a software "debounce" to remove spikes and also include RC filters on the encoder inputs placed right at the PIC to reduce EMI (as kchristie said).

Finally if you are worried about spurious changing of the encoder value you could add a safety layer like a pushbutton you must hold down to enable the encoder to change the value, (ie 'adjust mode") so there's no way the value will change by itself. You could also accomplish that safety layer with a "time out" on the encoder so you have to jiggle it up/down a bit to get it to work, then adjust, then once the encoder stops moving for more than a few seconds it disables the adjust mode so the value can't be changed.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top