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:
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.
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:
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.
Code:
void setup()
{
Serial.begin(38400);
}
int val;
void loop()
{
val = analogRead(17);
Serial.print("analog is: ");
Serial.println(val);
delay(250);
}