Analog Input Noise at Midrange

Status
Not open for further replies.

Doodads

Member
Hi all,

I'm having a problem with analog input on my Teensy 4.1 not behaving linearly. At about 1.6-1.7V, I'm getting a lot of noise on the analog input. The measured values fluctuate about +/-15 counts, which works out to about 90mV. The input behaves normally at higher and lower voltages, but I'm finding that this noise creates a discontinuity in my sensor measurements that would otherwise behave linearly. Is there a way to eliminate this noise?

One interesting thing I found was that it is quite difficult to actually set the potentiometer to 1.65 volts, as the slightest touch to adjust the Pot would move the voltage a large amount. Below 1.6 or above 1.7 volts it was much easier to adjust the voltage, the potentiometer wasn't as "touchy."

Here's a screenshot of the serial plotter, note the noise between 500 and 530 counts:
Teensy_Analog_Troubleshooting_Annotated.jpg

Here's my setup and code:

Hardware:
Teensy 4.1, powered by PC USB
Benchtop power supply supplying 3.3V
Potentiometer for adjusting voltage
Multimeter for measuring voltage.

Teensy_Analog_Troubleshooting.jpg


Code:
void setup()
{                
  Serial.begin(38400);
}

int val;

void loop()                     
{
  val = analogRead(17);
  Serial.print("analog is: ");
  Serial.println(val);
  delay(250);
}
 
Does it occur when you use the power supply connected directly to the ADC input (no pot)?
 
One interesting thing I found was that it is quite difficult to actually set the potentiometer to 1.65 volts, as the slightest touch to adjust the Pot would move the voltage a large amount. Below 1.6 or above 1.7 volts it was much easier to adjust the voltage, the potentiometer wasn't as "touchy."

Which suggests that there is something flaky with the pot. Since you are feeding the pot from an external supply, drop its voltage to say 2V. Does the problem occur at a proportionally lower voltage? If yes then it is definitely the pot. If it stays at 1.65V, then it might be the ADC.

ADC's work best with low pass filtered and buffered signals.
 
Does it occur when you use the power supply connected directly to the ADC input (no pot)?
I tried this out, and the noise does not occur. Interesting!


Which suggests that there is something flaky with the pot. Since you are feeding the pot from an external supply, drop its voltage to say 2V. Does the problem occur at a proportionally lower voltage? If yes then it is definitely the pot. If it stays at 1.65V, then it might be the ADC.

ADC's work best with low pass filtered and buffered signals.
I gave this a try at 2.3V on the power supply, and the noise went away when lowering the voltage, but then reappeared when I adjusted the potentiometer to 1.65V on the analog input. So it's not an issue with that spot in the potentiometer travel, but maybe with some other property of the potentiometer? Here's a graph of what happened:

Teensy_Analog_Troubleshooting_Annotated_2.jpg

The fact that the problem does not occur when directly connected to the power supply makes me think it's not an issue with the Teensy, but I'm still stumped on why I'm seeing the noise with the potentiometer. My actual use case on my project is reading a 4-20ma sensor over a 165ohm resistor. I think solving the potentiometer noise issue could help solve my sensor noise issue as well?

UhClem, does the secret lie in the low pass filter and buffering? As an electronics novice, would I be better served using an external ADC, or could it be as simple as adding a capacitor to my existing setup?
 
> I tried this out, and the noise does not occur. Interesting!

This suggests that you should use a lower impedance source. Or add capacitance near the teensy pin.
 
I'd be worried that sometime else is using the pin digitally and this is the effect of an input gate or Schmitt-trigger or some such.
What is the impedance of the potentiometer?
 
Status
Not open for further replies.
Back
Top