A recurring problem with analogue potentiometers is to get a stable output that only changes when the pot is actually moved (i.e. it doesn't output a lot of extremely similar values due to noise or jitter). What is the best approach to account for this?
I can think of a couple of approaches:
- Timeout: enable a deadzone after a second or two if the knob isn't moved by a certain amount.
- Moving deadzone: every time the read value leaves the deadzone, recenter it on the new value.
Note that pure filtering doesn't solve the problem - when you quantise the filtered value it can always be half-way between two quantisation levels and flutter between them.
Does anyone have any more solutions?
Edit: To be clear, this is why averaging, filtering, a better potentiometer, ignoring the LSB etc won't work:
Suppose we have this voltage after filtering/averaging whatever:
Then suppose we quantise to the nearest 0.1. We'll get an output that jitters around:
Hopefully you can see that no matter how good your filtering, or how coarse your quantisation, there will always be the possibility of jittering. That is why you need something other than really good filtering or really coarse quantisation.
Edit 2: To be doubly clear, because it seems some people aren't getting this. I would like some method to completely eliminate this kind of jitter (which is caused by unavoidable noise in the system), while still responding 'nicely' to a user physically turning the pot (it's for a brightness knob).
Edit 3: To be triply clear (come on guys), I only want the value to change when the pot has been physically moved because acting on these changes is costly (the display flickers when the brightness is changed; I don't want it flickering continuously).