Author Topic: ADC, filtering high frequencies for potentiometer input with simple RC circuit  (Read 289 times)

0 Members and 1 Guest are viewing this topic.

Offline wllmxTopic starter

  • Newbie
  • Posts: 3
  • Country: es
Hi y'all, I've been having issue with my potentiometers being super unstable when reading them (to the point of a 7 bit reading being wobbly). I'm using high-quality, recently-lubricated pots but a circuit without any passives besides the pot (I know, I know). I've redesigned the circuit, but my EE knowledge is just falling short to know if I'm making sense or not.

For the post-pot circuit I picked a value of 100 ohms so the RC filter has a cutoff feq of 160Hz with a step response time of ~5ms. I'm thinking the 100 ohm resistor will not be generating a problematic amount of Johnson–Nyquist noise. For the pre-pot circuit, I added the RC filter to filter out some of the noise before going in, with the capacitor to function as a decoupling capacitor.

I really barely know what I'm doing here so any and all feedback is appreciated (even just a: "this doesn't make any sense")

Here is the circuit:
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
What type of pot is your "10 k" unit?
If it be wirewound, there will be a finite resolution (which a good data sheet will quantify) as the wiper goes bumpety-bump across the winding.
For low-value multi-turn wirewound pots (e.g., 100\$\Omega\$, 1.25" trimpot), this resolution can be surprisingly coarse.
Wirewound pots are used when their tempco is critical.
 

Offline wllmxTopic starter

  • Newbie
  • Posts: 3
  • Country: es
Hey Tim, they're carbon film (1 turn, 300deg). They're the panel mount trough-hole Alps potentiometers that you see in a lot of digital audio gear. Thanks for asking! The majority of the issues right now are caused by their instability at rest.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5913
  • Country: es
You made it way better than required, if still getting issues with that then it must be a problem with the ADC or the power supply.

Replace the pot with two fixed resistors, i.e. 2k2+2k2, but I think it'll do the same.

What device are you using yo read it?
There are MCUs with really bad ADCs, like the esp32.
Better if you posted some parts of the pcb and a bit of the ADC schematic.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline wllmxTopic starter

  • Newbie
  • Posts: 3
  • Country: es
The circuit I showed is the new planned version, designed to fix the issues of the old one. If nothing looks outright dumb, I'm probably gonna do some testing and order the components etc. Thanks a lot for all the feedback so far guys, really appreciate it!
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5913
  • Country: es
Then it might be the ADC adquisition time.
High impedance sources heavily affect the adc, as it charges the internal sampling capacitor.
If the impedance is too high and the sampling time too low, you'll get bad readings.
ADC capacitance is usually ~10pF, small but still might not fully charge in time.
A simple fix is to add a small 1nF cap near the ADC pin, so it has no trouble sourcing the current.
Also try increasing the sampling time in the ADC settings.
But basically you want at least 5RC time to let the capacitors charge, I'd use at least 10RC for best stability.

With 10pf and 10K, 10RC would be 1us.
But the ADC pin has also some impedance and there might be other considerations, so check the datasheet and reference manual.
« Last Edit: June 25, 2023, 11:11:08 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: wllmx


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf