Occational weird value from Potentiometer

I have been testing out a Potentiometer on analog 2, and when I print back the data every once in a while I get a weird number, My terminal would look like such for example (this is at one set position, not changing much at all)


221
221
221
221
221
221
221
220
221
221
456
221
221
221
220

It works fine when I change the position, but it give me a weird number every once in a while which could mess things up. Has anyone else had problems like this or know why this is? Thank you

This is too large of a fluctuation to be electrical noise.
Are you using a quality pot? A cheap pot can be
intermittent on its wiper and cause fluctuations of
this sort.

Too wild for electrical noise, but eliminate it anyway: Use a 0.1 microfarad (not critical, can be +/- 100%) capacitor between the wiper and ground.

What value pot? Should be 5k-10k for the RC ADC inputs.

Try it with 2 fixed resistors - does it still jump? (One resistor goes from +5 to center, other from center to ground, center is also your signal. 4.7k resistors or so).

Those should get you to the root cause.

Don