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
float Vout= (analogRead(ThermistorPin) * voltage)/1023.0;
return resistance * (voltage/Vout) -1;
}