Electronic – arduino – Thermistor Datasheet Reading

arduinodatasheetthermistor

I have the following datasheet for a thermisistor:
http://make-documents.s3.amazonaws.com/UGulDNLaIajWgPom.pdf

I am trying to use the formula (found here http:// iwantmyreal.name/blog/2012/09/23/measuring-the-temperature-with-an-arduino-and-a-thermistor/):
$$
1/T=1/T_0+1/B*ln(R/R_0)
$$
I am not sure I'm using the correct values, my understanding is that the values provided in the datasheet are as follow: $$R_0=20,000 ohm,$$ $$T_0=25 C,$$ $$Beta=4300$$ Can anyone confirm that this is correct?

I'm trying to get a temperature reading out of that sensor using an Arduino UNO microcontroller using the following found at http://playground.arduino.cc//ComponentLib/Thermistor2 at the bottom where it says example #2 using numbers instead of episco k164 definition …. (substituting with the above values)

The results are ~41.96 degrees F, and the room is between 75-80 degrees F so that means the temperatures readings are way off, I don't understand why unless I got the wrong values from the datasheet. Also I have two of these sensors and both give about the same value.

Code currently using:

// Code obtained from http://playground.arduino.cc//ComponentLib/Thermistor2
#include <math.h>
// enumarating 3 major temperature scales
enum {
  T_KELVIN=0,
  T_CELSIUS,
  T_FAHRENHEIT
};

// manufacturer data for episco k164 10k thermistor
// simply delete this if you don't need it
// or use this idea to define your own thermistors
#define EPISCO_K164_10k 4300.0f,298.15f,10000.0f  // B,T0,R0

// Temperature function outputs float , the actual 
// temperature
// Temperature function inputs
// 1.AnalogInputNumber - analog input to read from 
// 2.OuputUnit - output in celsius, kelvin or fahrenheit
// 3.Thermistor B parameter - found in datasheet 
// 4.Manufacturer T0 parameter - found in datasheet (kelvin)
// 5. Manufacturer R0 parameter - found in datasheet (ohms)
// 6. Your balance resistor resistance in ohms  

float Temperature(int AnalogInputNumber,int OutputUnit,float B,float T0,float R0,float     R_Balance)
{
  float R,T;

  R=(1024.0f*R_Balance/float(analogRead(AnalogInputNumber)))-R_Balance;
  T=1.0f/(1.0f/T0+(1.0f/B)*log(R/R0));

  switch(OutputUnit) {
    case T_CELSIUS :
      T-=273.15f;
    break;
    case T_FAHRENHEIT :
      T=9.0f*(T-273.15f)/5.0f+32.0f;
    break;
    default:
    break;
  };

  return T;
}

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

void loop() {

 Serial.println("*************************");
 Serial.println("10k Balance");
 Serial.println(Temperature(0,T_FAHRENHEIT,4300.0f,298.15f,20000.0f,9770.0f));
 //Serial.println(Temperature(1,T_FAHRENHEIT,4300.0f,298.15f,20000.0f,9770.0f));
 Serial.println("*************************");

 delay(500);
}

Best Answer

For anyone interested in knowing how I solved this problem, I used the AREF and 3.3V from the Arduino microcontroller connected directly one of sides of the thermistors. I believe the voltage coming out of my laptop was dropping; USB +5V was dropping to ~4.7V thus making my calculations lower.

Here's the website which helped to find my answer (this site includes CODE and DIAGRAM):

http://learn.adafruit.com/thermistor/using-a-thermistor

Thanks everyone for your help.