# Why do all my NTC thermistor have a PTC curve?

Suddenly, after testing my NTC thermistor (100k), the thermistor's curve started to turn into a PTC curve. To measure the resistance I am using an Arduino. I think its a hardware issue as I did not change my program at all. Is there a way to check it the resistance's that the Arduino outputs are correct? Could this be the problem, would it be the thermistors? The precision, I think, is also affected, some are too 5C others are to 1C.

#include <Wire.h>
#include <Arduino.h>
int ThermistorPin = 0, reffPin = 1;
int resistance = 10000;

void setup() {
Serial.begin(9600);
}

void loop() {
float avg = 0;

for(int x = 0; x < 10; x++)
{
avg += volateToResistance();
delay(50);

}
Serial.println(avg/10.0);
delay(5);
}
float volateToResistance()
{
float voltage = analogRead(reffPin) * 5.0/1023;  // takes in ausmmed 5 volts and calulates actutal voltage Ex if analogRead(reffPin) = 1023, then voltage will be equal to exactly 5 volts
return resistance * (voltage/Vout) -1;
}


• A multimeter would be the classical way of measuring resistance. Nov 2, 2019 at 15:26
• To measure the resistance you are using an ardunio and what circuit?
– τεκ
Nov 2, 2019 at 15:26
• The Arduino is not an ohmmeter so you need to show us the circuit you are using and insert a listing of your code. Have you measured the thermistors with an actual ohmmeter? Nov 2, 2019 at 15:27
• @AdityaKendre an actual schematic would've been better (drawing them is not hard) than a wiring cartoon, but well, it helps, if you tell us which cables go where. Nov 2, 2019 at 15:43
• Your code doesn't make sense to me. You calculate voltage, then multiply Vout by it, then factor it out in the return statement. You might want to add some comments. Nov 2, 2019 at 16:13

As general troubleshooting guide, if you question the thermistor, test it in isolation. Disconnect the thermistor from the circuit, and use a multimeter in resistance mode to measure its resistance... should show about 100 kohm. Grab the thermistor with your fingers to heat it, and verify that the resistance decreases. Then it's a NTC.

If the problem is not with the thermistor, it's the calculations. Your calculations don't look right to me but I can't say exactly what's wrong. You can't measure Vref as that's already the reference the ADC measures again -- it's like using a ruler to measure the length of the ruler.

As your thermistor is on the high side of the voltage divider and you measure across the lower resistor, you will measure higher voltage when a NTC thermistor heats up. Maybe this is what confuses you.

A warning about your setup; your voltage divider using a 100 kohm thermistor and 100 kohm resistor will together give 50 kohm impedance. Signal impedance is the resistance 'experienced' by the microcontroller ADC, or loosely how sensitive the signal is to disturbances. Arduino Uno uses the ATMega328 microcontroller, which needs lower impedance for ADC to avoid skewed measurements. The datasheet can tell you in detail but I vaguely remember it should be lower than 10 kohm at least. The easiest solution is to add a capacitor between A0 and GND. Any capacitor value 10 nF or higher is ok -- 100 nF and 1 uF are common values.

The precision, I think, is also affected, some are too 5C others are to 1C.

This may be due to the impedance mentioned above, some error in the calculation or natural variations between thermistors. (All thermistors only promise to follow the specifications within some percentage.)

• some of those capture-a-sample-of-the-analog-input ADCs end up with negative voltages on the cap (from what I've seen), and that causes huge confusion on the next high-impedance sample. Nov 2, 2019 at 17:31
• That's odd, do you have some link for that phenomenon? A big cap or slow sampling frequency should avoid such a problem, right? Nov 2, 2019 at 17:35
• the behavior is what I recall explained the -90 millivolt input residual on a Teensy board. The engineer-in-charge added a unity-gain buffer, and RC output filter, and that behavior went away. There is no link. Without the ADC schematic and timing diagram, who know what really was happening. I was just helping debug. Nov 3, 2019 at 3:54