Go Down

Topic: Stabilizing a potentiometer.  (Read 701 times) previous topic - next topic

syka2210

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?
We believe in better. And cake, definitely cake!

arduin01

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.
"Hay 10 tipos de personas en el mundo: las que saben binario y las que no." -- Anónimo
"There are 10 types of people in the world: those who know binary and those who don't." -- Anonymous

Paul__B

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.

syka2210

Thank you for the response, my electronics knowledge are minimum, i will try a averaging algorithm and hope for the best
We believe in better. And cake, definitely cake!

DVDdoug

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.

syka2210

Haven't thought of that, but it makes more sense. Maybe both of them combined might do the trick.
We believe in better. And cake, definitely cake!

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.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

MarkT

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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up