Reading temperature on BeagleBone with AD592

A very common task is to measure temperature at various points. In fact, temperature is the most commonly measured and controlled variable in Process Control. The BeagleBone single-board computer is becoming more popular because of its low cost and sophisticated capabilities. It’s one of the easiest ways to serve up a web page that allows the operator to monitor data and control devices.

Temperature can be measured with a variety of sensors. Here we are concerned with the range of liquids from around 0C to 80C. A straightforward way to measure temperatures in this range is with a semiconductor analog-output sensor. They are easy to use, accurate, and low cost.

I happened to have a number of AD592 temperature to current sensors on hand. These have been traditionally used for process control because their current output makes them very noise resistant when long cable are used. We convert the current (1 microvolt/Kelvin) to a voltage by using a resistor. In this case, we use a 3.3kohm resistor to produce a voltage of around 1V at room temperature. The 3.3k resistor gives a resolution of .003V/Kelvin which with the 273.15K offset gives 0.003V/degree Celsius.

Using the sensor connected to 5V, AGND and the analog input on P9, pin 36, we use this code snippet to read the sensor:

// Read an AD592 temp sensor and return degF
function readTemp()
{
   var volts = 1.8 * trap.analogRead("P9_36");
   // Convert to Kelvin. AD592 outputs 1uV/K
   var k = volts / 3300 / 0.000001;
   // Convert to Fahrenheit
   var f= (k - 273.15) * 9 / 5 + 32;
   // Log the measured values
   console.log("V,k,F: " + volts,k,f);
   return f;
}

For improved accuracy we can measure the actual resistance of the 3.3k resistor and use that measured value in the program.

This concept is easily extended to remote reading. Since the BeagleBone is a powerful little Linux computer, it can be used to serve web pages. We have a simple node.js webserver and sensor data reader program available at thisĀ download link