Hi!
I'm going through the tutorials with my new Teensy 4.0 and am having issues with the temperature sensor (https://www.pjrc.com/teensy/tutorial4.html).
My code and breadboard is identical to the example, and I connected the temperature sensor to pin 23 (A9).
However, at ambient temperature, I'm getting an analog value of ~770, which would indicate a room temperature around 52C/126F. I would expect the temperature to be somewhere around 20C/68F, which would mean I should get a much lower code!
I then tried to replace the thermistor with another 10K resistor, thus measuring the voltage between the two 10K resistor.
My board delivers 4.93V, and my multimeter says this voltage is 2.46V, which is exactly Vcc/2. At this mid-point of the analog spectrum, I would expect the analogRead() to return 1024/2 = 512, but alas, it is returning 769!
(Now, assuming 770 = 2.46V, the RT can be calculated to RT = R1/(Vcc/Vx-1) where R1 = 10K, Vcc=4.93, Vx=2.46V and thus RT = 9,960, which should be just over 25C/77F according to the data sheet (and the tutorial).
Thus, it seems that the analog input is not completely linear!
I have tried and Vx = 0V gives code "0" and Vx=Vcc=4.93V gives code 1023.
Am I missing something here? How should I read the analog input?
I'm going through the tutorials with my new Teensy 4.0 and am having issues with the temperature sensor (https://www.pjrc.com/teensy/tutorial4.html).
My code and breadboard is identical to the example, and I connected the temperature sensor to pin 23 (A9).
However, at ambient temperature, I'm getting an analog value of ~770, which would indicate a room temperature around 52C/126F. I would expect the temperature to be somewhere around 20C/68F, which would mean I should get a much lower code!
I then tried to replace the thermistor with another 10K resistor, thus measuring the voltage between the two 10K resistor.
My board delivers 4.93V, and my multimeter says this voltage is 2.46V, which is exactly Vcc/2. At this mid-point of the analog spectrum, I would expect the analogRead() to return 1024/2 = 512, but alas, it is returning 769!
(Now, assuming 770 = 2.46V, the RT can be calculated to RT = R1/(Vcc/Vx-1) where R1 = 10K, Vcc=4.93, Vx=2.46V and thus RT = 9,960, which should be just over 25C/77F according to the data sheet (and the tutorial).
Thus, it seems that the analog input is not completely linear!
I have tried and Vx = 0V gives code "0" and Vx=Vcc=4.93V gives code 1023.
Am I missing something here? How should I read the analog input?