Thermistor doesn't work Connecting all like shows the image, thermistor shows, that I'm going to be burnt:



The code is simple:

#define analogPin  A0 //the thermistor attach to 
#define beta 4090 
#define resistance 10 

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

void loop()
{
  //read thermistor value 
  long a =analogRead(analogPin);
  //the calculating formula of temperature
  float tempC = beta /(log((1025.0 * 10 / a - 10) / 10) + beta / 298.0) - 273.0;
  float tempF = 1.8*tempC + 32.0;
  Serial.print("Temp: ");

  Serial.print(tempC);

  Serial.print("  C");

  Serial.print("Fahr: ");
  Serial.print(tempF);
  Serial.print(" F");
  delay(200); //wait for 100 milliseconds
}


Do I have a wrong thermistor or wrong code?
The series resistance is 220 Ohms (Red, Red, Brown).

You also need to take into account the thermistor resistance at 25C. Assuming its 10K. Hence choosing a 10K series resistance will make the calculations easier.

     int THERMISTORNOMINAL =  10000;
     int SERIESRESISTOR = 10000;
     int TEMPERATURENOMINAL = 25;  

     a = 1023 / a - 1;
     a = SERIESRESISTOR / a;
     tempC = a / THERMISTORNOMINAL;     // (R/Ro)
     tempC = log(tempC);                  // ln(R/Ro)
     tempC /= Beta;                   // 1/B * ln(R/Ro)
     tempC += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
     tempC = 1.0 / steinhart;                 // Invert
     tempC -= 273.15;                         // convert to C