Try this code:
/*
Connect thermistor between Vref and the reference resistor.
Vref--Rt--Rref--GND, where Vref = 5V
Rt = R0 * ((Vref/Vout)-1)
*/
const int Vout_pin = A0; // ADC Pin to which the voltage divider is connected
const int num_samples = 5;// Number of samples for average
const int Rref = 10000; // Value of reference resistor used for the voltage divider
const int Max_ADC = 1023; // Maximum ADC value (for 10 bit = 1023)
void setup()
{
Serial.begin(9600);
}
void loop()
{
int i;
float ADC_average;
int samples = 0;
float Rt;
// Read the thermistor voltage num_samples times
for (i = 0; i < num_samples; i++)
{
//samples += analogRead(Vout_pin);
// for testing
samples += 974;
delay(10);
}
ADC_average = samples / num_samples; // Average voltage
Serial.print("ADC readings ");
Serial.println(ADC_average, 0);
// Calculate thermistor resistance
// Rt = R0 * ((Vref/Vout)-1)
// If Vref is same volatge for the ADC then
// Vref/Vout = Max_ADC/ADC_average
Rt = Rref * ((Max_ADC / ADC_average) - 1.0);
Serial.print("Thermistor resistance ");
Serial.println(Rt, 1);
// Calculate temperature
float temperature;
temperature = 273.1 - ((100.0/650.0) * Rt);
Serial.print("Temperature ");
Serial.print(temperature, 1);
Serial.println(" *C");
Serial.println("\n");
delay(1000);
}
If it does not work maybe someone else can help. I need to leave for now