Stabilizing a potentiometer.

So the main problem i encounter during analig reading of a potentiometer is different output values. Sometimes is steady, sometimes it gives me different values, +/-1. I know i could use a code to resolve that, but my question is, can i also use a hardware fix such as a capacitor, or something else, still having that wuick response from the potentiometer?

That's probably not the potentiometer's fault. It's probably the ADC's fault, ADCs aren't perfect and may vary by a few LSBs. So the only thing to do in this case would be software averaging.

Yeah, stick a 1 µF capacitor between wiper and ground.

Of course, you will not prevent a ±1 variation or "jitter" in values - to expect otherwise suggests you do not understand electronics.

Thank you for the response, my electronics knowledge are minimum, i will try a averaging algorithm and hope for the best

With an ADC you can always be on the “hairy edge” between two numbers. Averaging and filtering can help or slow the jumping down but they are not guaranteed to eliminate it completely.

You can write software than ignores change less than a certain number of counts.

Haven’t thought of that, but it makes more sense. Maybe both of them combined might do the trick.

iirc the built-in ADC of the Arduino has an error of +/- 2 LSB. So variations like you see are to be expected.

If you try to detect changes in the pot settings, use a threshold, changes below which you ignore.

wvmarle:
iirc the built-in ADC of the Arduino has an error of +/- 2 LSB. So variations like you see are to be expected.

If you try to detect changes in the pot settings, use a threshold, changes below which you ignore.

That might be the absolute error, but in my experience the Uno ADC is repeatable to well below 1 lsb,
I've had battery voltage sensing in some logging units using the ATmega328 that stepped monotonically
down step by step (with some hairiness on each transistion, but not much).

The ADC on the Due, on the other hand, is pretty poor, probably as that board uses a switch-mode
on-board regulator.

Given a clean 5V rail the Uno class Arduinos' ADCs should perform nicely.