const float A = 0.0013141075651;
const float B = 0.000088450246618;
const float C = 0.00000066945071114;

int raw = analogRead(A0);
float voltage = raw * (5.0 / 1023.0); 
float R_thermistor = 1000.0 * ((5.0 - voltage) / voltage);

float lnR = log(R_thermistor);
float invT = A + B * lnR + C * pow(lnR, 3);
float tempK = 1.0 / invT;
float tempC = tempK - 273.15;

Serial.print(tempC);

