I'm attempting to read temperature data from a simple 2-pin thermistor sensor. I'm using a Teensy 4.0.
I've used this simple thermistor many times, and it has worked very well so far with both Teensys and Arduinos. However, I'm running into an issue with this set of thermistors lately, only on the Teensy.
I first connected the thermistor to my Arduino Uno R3, according to the following Arduino tutorial.
The thermistor I'm using has a resistance value of 10K, and so has the resistor I'm using in my circuit, instead of the 100K they use in the tutorial I used, as such:

Alongside the following code, as per the same Arduino tutorial above:
The setup and code above work to produce correct temperature readings from the sensor.
I then went to build the same setup with my Teensy 4.0, as such:

Using the same exact code.
However, this setup does not work correctly, and my temperature values are off. I also tried swapping out the 10K resistor for a 100K one, to no avail.
What is going wrong here with the Teensy? As far as I understand, the Teensy data pins are each rated for 3.3V, which should not be an issue here.
Thanks for reading my post, any guidance is appreciated.
I've used this simple thermistor many times, and it has worked very well so far with both Teensys and Arduinos. However, I'm running into an issue with this set of thermistors lately, only on the Teensy.
I first connected the thermistor to my Arduino Uno R3, according to the following Arduino tutorial.
The thermistor I'm using has a resistance value of 10K, and so has the resistor I'm using in my circuit, instead of the 100K they use in the tutorial I used, as such:

Alongside the following code, as per the same Arduino tutorial above:
Code:
int ThermistorPin = A0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
void setup() {
Serial.begin(9600);
}
void loop() {
Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
T = T - 273.15;
T = (T * 9.0)/ 5.0 + 32.0;
Serial.print("Temperature: ");
Serial.print(T);
Serial.println(" F");
delay(500);
}
The setup and code above work to produce correct temperature readings from the sensor.
I then went to build the same setup with my Teensy 4.0, as such:

Using the same exact code.
However, this setup does not work correctly, and my temperature values are off. I also tried swapping out the 10K resistor for a 100K one, to no avail.
What is going wrong here with the Teensy? As far as I understand, the Teensy data pins are each rated for 3.3V, which should not be an issue here.
Thanks for reading my post, any guidance is appreciated.