Main Site Documentation

Potentiometer Module


#1

Has anyone experienced any noisy operation of the potentiometer module when used on the Cerb Bee?

I’ve reproduced the same thing and my solution is very noisy. Is there a known way to eliminate the noise?


#2

@ andre.m (good point; was tired when I posted that.)

When the pot isn’t moving I’m seeing the raw values fluctuate (476, 379, 386, 356 etc).


#3

The aforementioned values are when it is not moving (sorry). Also the pot is a new type (kinda large). It is inside a linear actuator: http://www.servocity.com/html/25_lbs__thrust_linear_actuator.html


#4

Some more context: I tried a decoupling capacitor in parallel with VCC and GND: no help. I tried the cap between the wiper and GND, helped a little (very little).


#5

Hi,
What do you want to do with a potentiometer? Perhaps something like this http://www.soldermonkey.net/shop/index.php?route=product/product&path=59_65&product_id=52 gives a better solution (together with a digital-analog-converter).
Regards
Roland


#6

The voltage across the pot is 3.267 and stable (measured with a multimeter). Going to try that battery. I take it + to Analog and -ve to GND.


#7

So a 3 volt coin cell which reads 3.1 on the multimeter (stable) reads :
3920
3918
3922
3918
3918
3920
3918
3918
3915
3914
3918
3922
3915
3918
3916
3920
3918
3918
3919
3922
3920
3923
3912
3918
3915
3917
3920
3915
3918
3911
3918
3918
3919
3918
3918
3919
3918

I guess it’s internal ADC noise? Should I deploy a reference diode (https://www.sparkfun.com/products/11078)


#8

Nah I used ReadRaw(). So moving average it is.


#9

Ok, so I used a 256 value buffer


Microsoft.SPOT.Hardware.AnalogInput _a0 = new Microsoft.SPOT.Hardware.AnalogInput(FEZCerbuino.Pin.AnalogIn.A0);
            byte _counter = 0;
            int[] _valueArray = new int[256];
            while (true) {
                _valueArray[_counter] = _a0.ReadRaw();
                int _avg = 0;
                for (int i = 0; i < _valueArray.Length; i++) {
                    _avg+=_valueArray[i];
                }
                _avg = _avg / _valueArray.Length;
                Debug.Print(_avg.ToString());
                _counter++;
                Thread.Sleep(1);
            }

The value stabilized in about 1 second. I may be able to live with that.