Page 2 of 2

Re: Wobbly resistance readings

Posted: Tue Apr 14, 2020 3:27 am
by mrburnette
arpruss wrote: Tue Apr 14, 2020 2:36 am Updates:

1. I opened my hardware up, and I am using 30K pots, not 400K as stated before. My mistaken.

2. While I don't have any noticeable wobbling on my Windows laptop with all my changes, I have lots of wobbling on my Raspberry PI, mainly on the second pot. I wonder if this is due to the PI's power supply being overworked.

3. Delaying the acquisition until the USB send is finished doesn't seem to help.
I find that using the Arduino'ish board as a (faux JSON) serial client and the RPi as a Node Red server works remarkably well. The Node Red engine has smoothing nodes, if needed.

https://www.hackster.io/rayburne/arduin ... asy-28882d


Ray

Re: Wobbly resistance readings

Posted: Tue Apr 14, 2020 4:28 am
by misfet
mrburnette wrote: Tue Apr 14, 2020 1:31 am Respectfully:

Ray
:shock: What have you done to Ray????

Re: Wobbly resistance readings

Posted: Tue Apr 14, 2020 5:38 am
by ag123
another thing though, using a long sample time may help, but that means somewhat lower sample rates.
i've in cases use the longest sample time reading my battery power supply across a resistor divider, a long sample time reduces noise fluctations and i tend to get rather consistent readings, if short sample times are used, the readings tend to be rather noisy, and mind it is a nimh battery, there should normally be no a/c noise. but i've occasionally noticed with an op amp i can actually pick up induced a/c noise e.g. from the wifi router, usb power supply and computer etc. the induced a/c noise levels easily exceed 1 mV and can go up to several mV. it may affect high resistance potentiometer / variable resistance readings

Re: Wobbly resistance readings

Posted: Tue Apr 14, 2020 9:13 am
by stevestrong
arpruss wrote: Tue Apr 14, 2020 2:36 am 3. Delaying the acquisition until the USB send is finished doesn't seem to help.
You always have some periodic USB traffic in the background, even if you don not send or receive actively anything.

Appropriately filtering the power supply makes everything much better.
And do not use large capacitors on the input, but use low impedance signal sources.

Re: Wobbly resistance readings

Posted: Tue Apr 14, 2020 12:58 pm
by mrburnette
misfet wrote: Tue Apr 14, 2020 4:28 am
mrburnette wrote: Tue Apr 14, 2020 1:31 am Respectfully:

Ray
:shock: What have you done to Ray????

Sheltering in place (with retired wife) has given ol' Ray a new perspective; that is, I'm trying to be polite because I am constantly being advised by spousal unit that I have a sharp tongue and someone is going to take scissors to it. Since there are only 2 people in the house and a cat, I am a bit worried.

Ray

Re: Wobbly resistance readings

Posted: Tue Apr 14, 2020 1:17 pm
by mrburnette
So,
Both ag123 and stevestrong bring value to the discussion, but each is talking a different methodology.

Steve's suggestion about large-value capacitors basically involve two factors, ESR and RC.
You can read about ESR here: https://www.avnet.com/wps/portal/abacus ... apacitors/
and RC is simply the time-constant. While one may think a large capacitor is the best filter, one must realize that current leads voltage (discharged cap appears as a short when connected to a voltage source and charges exponentially) and anytime a noise pulse comes along, the resistance of the DC input (wall wart, wiring, internal battery R, etc.) plus circuit trace resistance and solder joint resistance all come into calculating the R value. If R is 0 (never is) then a large value of C would create a very large impulse current that can cause crosstalk on the circuit board traces.

ag123 is discussing (I believe) input impedance to the A/D input pin on the chip. The rule-of-thumb is usually a DC resistance of < 10K. (If your analog voltage is a complex wave, like audio, then we need to be thinking < 10K impedance.) For voltage dividers, one could think of this as the "to ground" resistance being 10K Ohms maximum; the input Z to the junction of the 10K + A/D input will actually lower the 10K since it appears in parallel (not series) in a perfect world (perfect meaning the input voltage is created by a 0 Ohm current source - a perfect battery for example.)
https://learn.sparkfun.com/tutorials/me ... resistance

BUT, remember, if your AD reference is shaky, so is the digitized value. As I said previously, most folks just tie Vcc to Aref and that can be the entire issue.


Ray