LM19 is an analog temperature sensor that operates over a while temperature range (-55 to 130 Celsius). It is very easy to interface it with a microcontroller due to is fairly linear voltage output.

The following code listing illustrates how to obtain temperature readings from LM19 with an Arduino. The code assumed that the sensor output is connected to Analog 0 pin.

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

void loop()
{
  float vin = 5.0 * analogRead(0) / 1024.0;
  Serial.print(vin);
  Serial.print("  ");
  float tempC = (1.8663 - vin) / 0.01169;
  float tempF = 1.8 * tempC + 32.0;
  Serial.print(tempC);
  Serial.print("  ");
  Serial.println(tempF);
  delay(100);
}

In the code above, I used the approximated linear transfer function shown below. It is fairly accurate when the temperature range is around room temperature.
\[T_{Celcius} = \frac{1.8663-V_o}{0.01169}\]

For more accurate temperature measurement over the full operating range, the following equation can be used:
\[T_{Celcius} = \sqrt{2.1962 \times 10^6 + \frac {1.8639 – V_o}{3.88 \times 10^{-6}}} – 1481.96\]

Be Sociable, Share!