Products for USB Sensing and Control

Data Logging With a Thermocouple

From Phidgets Support
Jump to: navigation, search

The project described here is a data recording program for the Phidget Temperature Sensors. We play with the program and record data to learn things about our environment.

Although we use the Temperature Sensors, the emphasis in this Guide is on data logging - passing data and writing to files in different languages, and also dealing with data in general.

Practical concepts covered are (click on links to see other projects on that topic):
  • Data Logging
    • Writing to a text file
    • Adding timestamps to your data
    • Using Phidgets with C#
    • Using Phidgets with Python
    • Using Phidgets with Java
    • Using Phidgets with C/C++
  • Analyzing your Phidget Data
 

As with any of our described projects, Phidgets takes care of the electrical component design. Here, we also provide some simple code so you can play around with your Temperature Sensor and thermocouple, and save the data to plot later.

Time: About two hours for the basics, three hours for looking at and analysing the data
Special Needed Tools: Something hot (tea, your skin), or something cold (ice, etc)
Materials and Phidgets: A Phidget Temperature Sensor (1048 or 1051), a Thermocouple, a USB cord, and your computer

Also:


Contents


Introduction

This application guide is all about basic data logging and analysis with Phidgets. The ability to write an automatic data logger is one of the strong advantages to Phidgets - you do not have to take visual readings of a thermometer (or other sensor) and record the readings in a log book manually. Rather, you can simply log directly to a computer.

Thermocouples provide a way to inexpensively measure the temperature of a material through physical contact. Although we use thermocouples and a Phidget Temperature Sensor (1048 or 1051) as our Phidget to log data from, basic data logging will be similar for many other Phidgets.

Phidgets

To use the code in this Guide, you will need to have a Phidget Temperature sensor and a thermocouple.

Some example ways to set this up are:

Example Setup Strengths
Basic thermocouple setup
Ability to measure multiple points
Wide temperature range thermocouple

Of course, these are only examples - any thermocouple with either Temperature Sensor Phidget board will work.

We will log data from thermocouple port 0. On a one-input board, this is the only thermocouple input; on a four-input board, make sure you have a thermocouple plugged in to sensor port 0:

Then:

  • Make sure you have followed the Getting Started guide for your Temperature Sensor, found in its user guide
  • Make sure you have the programming language libraries that you want installed
  • Plug the USB cord on the Temperature Sensor in to your computer
  • Continue on to the next section and start writing code!

Code

For all platforms, we wrote code in Java, C#, and Python.

The C/C++ language has no method of accurate time stamping in a platform-independent way. The C/C++ code here was written for a POSIX (Linux and Phidget Single Board Computer) system, but can be easily adapted for Windows.

C# Code and Discussion

The data logger C# source code we used can be downloaded here: File:App guide templogger csharpcode.cs

The entire source code (as this Guide is about data logging code) is:

  1. using System;
  2. using System.IO;
  3. using System.Diagnostics;
  4. using System.Text;
  5.  
  6. using Phidgets; 
  7. using Phidgets.Events; 
  8.  
  9. namespace DataLogger {
  10.     class Code {
  11.  
  12.         // Obtain an initial time from which to generate timestamps
  13.         public static Stopwatch stopwatch = Stopwatch.StartNew();
  14.  
  15.         // Clear and open the file for writing
  16.         public static FileStream outFile = new FileStream(@"temperature_data_csharp.csv", FileMode.Create);
  17.  
  18.         static void Main(string[] args) {
  19.             try {
  20.  
  21.                 // Print a text header to the file first thing
  22.                 string header = "Time,Thermocouple-Temperature,Ambient-Board-Temperature\n";
  23.                 System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
  24.                 Byte[] bytes = encoding.GetBytes(header);
  25.                 outFile.Write(bytes, 0, bytes.Length);
  26.                 outFile.Flush();
  27.  
  28.                 // Create the Phidget software object, hook in the event function, and open the object
  29.                 TemperatureSensor device = new TemperatureSensor(); 
  30.                 device.TemperatureChange += new TemperatureChangeEventHandler(temperatureDataHandler);
  31.                 device.open();
  32.                 device.waitForAttachment();
  33.  
  34.                 // Set the thermocouple type and trigger on port [0] (0 = record all data)    
  35.                 device.thermocouples[0].Sensitivity = 0;
  36.                 device.thermocouples[0].Type =
  37.                     TemperatureSensorSensor.ThermocoupleType.PHIDGET_TEMPERATURE_SENSOR_K_TYPE;
  38.  
  39.                 Console.WriteLine("Press Enter to end anytime...");
  40.                 Console.Read();
  41.  
  42.                 device.close();
  43.                 device = null;
  44.             }
  45.             catch (PhidgetException ex) { Console.WriteLine(ex.Description); }
  46.  
  47.         }
  48.  
  49.         // Create a listener function to handle all temperature data events 
  50.         static void temperatureDataHandler(object sender, TemperatureChangeEventArgs e) {
  51.             double microseconds = stopwatch.ElapsedMilliseconds / 1000.0;
  52.  
  53.             // Start composing a string of data from this event
  54.             string data = microseconds + "," + e.Temperature + ",";
  55.  
  56.             // Get the board temperature and add it to the string
  57.             data = data + ((TemperatureSensor)sender).ambientSensor.Temperature + "\n";
  58.  
  59.             // The raw write method involves translating our string into bytes, like Java
  60.             System.Text.ASCIIEncoding  encoding = new System.Text.ASCIIEncoding();
  61.             Byte[] bytes = encoding.GetBytes(data);
  62.             outFile.Write(bytes, 0, bytes.Length);
  63.  
  64.             // Print a dot to the console to indicate another more data written
  65.             Console.Write(".");
  66.             Console.Out.Flush();
  67.         }
  68.     }
  69. }

Some highlights:

  • Line 13 and 51: To create timestamps for the data being recorded, we use System.Diagnostics.StopWatch to accurately obtain the elapsed time.
  • Lines 16, 22-26 and 60-62: To start with a fresh, empty file each time, we use a FileStream which writes raw bytes and starts at offset 0.
  • Line 36-37: We used a K-type thermocouple. You need to change this line to your thermocouple type.
  • Line 35: We set the sensitivity (trigger) to 0, to record all data. Setting a value above 0 will only record changes greater than or equal to that value.

Compile and Run

C# requires, due to the class name, that this code be saved in a file called Code.cs, or you can change the class name to whatever file name you would like. If you need help compiling and running Phidgets C# code and linking Phidget21.NET.dll, you should try the in-depth instructions on the Language - C Sharp page.

Note: If you are using Visual Studio (by copy and pasting the code into a project), the output file temperature_data_csharp.csv will be written to the bin → Debug folder within your project.

Java Code and Discussion

The data logger Java source code we used can be downloaded here: File:App guide templogger javacode.java

The entire source code (as this Guide is about data logging code) is:

  1. import com.phidgets.*;
  2. import com.phidgets.event.*;
  3. import java.io.*;
  4.  
  5. public class DataLogger {
  6.  
  7.     public static final void main(String args[]) throws Exception {
  8.  
  9.         // Clear and open the csv file for writing, and write the header
  10.         final FileOutputStream outFile = new FileOutputStream("temperature_data_java.csv");
  11.         String header = "Time,Thermocouple-Temperature,Ambient-Board-Temperature\n";
  12.         outFile.write(header.getBytes(), 0, header.length());
  13.         outFile.flush();
  14.  
  15.         // Get a start time from which we can generate timestamps later
  16.         final long start = System.nanoTime();
  17.  
  18.         // Create the Phidget software object
  19.         TemperatureSensorPhidget device;
  20.         device = new TemperatureSensorPhidget();
  21.  
  22.         // Attach a listener function to changes in thermocouple temperature
  23.         TemperatureChangeListener temperatureDataHandler;
  24.         device.addTemperatureChangeListener(new TemperatureChangeListener() {
  25.             public void temperatureChanged(TemperatureChangeEvent event) {
  26.  
  27.                 long now = System.nanoTime();
  28.                 // The nanoTime() function gives us microseconds; we want seconds.
  29.                 double timeDifference = (now - start) / 1000000000.0;
  30.                 // Initialize the board temperature with some impossible number
  31.                 double ambientTemperature = -99;   
  32.  
  33.                 // Cast the event into a specific (TemperatureSensor) Phidget
  34.                 // This must be done separately from calling a device function
  35.                 TemperatureSensorPhidget localDevice = (TemperatureSensorPhidget)event.getSource();
  36.  
  37.                 // Get the board temperature
  38.                 try {
  39.                     ambientTemperature = localDevice.getAmbientTemperature();
  40.                 } catch (PhidgetException exception) {
  41.                     System.out.println(exception);
  42.                 }
  43.  
  44.                 // Print dots to indiciate one more point recorded
  45.                 System.out.print(".");
  46.                 System.out.flush();
  47.  
  48.                 // Write the data to the text file
  49.                 String output = timeDifference + "," + event.getValue() + "," + ambientTemperature + "\n";
  50.                 try {
  51.                     outFile.write(output.getBytes(), 0, output.length());
  52.                     outFile.flush();
  53.                 } catch (IOException exception) {
  54.                     System.out.println(exception);
  55.                 }
  56.  
  57.             }
  58.         });
  59.  
  60.         // Open the device and make sure it is plugged in
  61.         device.openAny();
  62.         device.waitForAttachment(10000);
  63.  
  64.         // Set the thermocouple type and trigger (0 = record all data)
  65.         try {
  66.             device.setThermocoupleType(0, device.PHIDGET_TEMPERATURE_SENSOR_K_TYPE);
  67.             device.setTemperatureChangeTrigger(0, 0);
  68.         } catch (PhidgetException exception) {
  69.             System.out.println(exception);
  70.         }
  71.  
  72.         System.out.println("Press Enter to end anytime...\n");
  73.         System.in.read();
  74.  
  75.         outFile.close();
  76.  
  77.         device.close();
  78.         device = null;
  79.     }
  80. }

Some highlights:

  • Line 16 and 27: To create timestamps for the data being recorded, we use System.nanoTime() to accurately obtain the elapsed time.
  • Lines 10-12 and 49-52: To start with a fresh, empty file each time, we use a FileOutputStream which writes raw bytes and starts at offset 0.
  • Line 66: We used a K-type thermocouple. You need to change this line to your thermocouple type.
  • Line 67: We set the sensitivity (trigger) to 0, to record all data. Setting a value above 0 will only record changes greater than or equal to that value.

Compile and Run

Java requires, due to the class name, that this code be saved in a file called DataLogger.java. If you need help compiling and running Phidgets java code and linking phidget21.jar, you should try the in-depth instructions on the Language - Java page.

Python Code and Discussion

The data logger Python source code we used can be downloaded here: File:App guide templogger pythoncode.py

The entire source code (as this Guide is about data logging code) is:

  1. #! /usr/bin/python
  2.  
  3. from time import time
  4. import sys
  5.  
  6. from Phidgets.PhidgetException import PhidgetErrorCodes, PhidgetException
  7. from Phidgets.Events.Events import *
  8. from Phidgets.Devices.TemperatureSensor import *
  9.  
  10. # Define an error catching function so we can call it on "try...except" blocks
  11. def LocalErrorCatcher(event):
  12.     print("Phidget Exception: " + str(e.code) + " - " + str(e.details) + ", Exiting...")
  13.     exit(1)
  14.  
  15. # Obtain an initial time from which to generate timestamps
  16. start = time()
  17.  
  18. # Clear and open the data file for writing
  19. outfile = open("temperature_data_py.csv", "w")
  20.  
  21. # Create a listener function for changes in thermocouple temperature
  22. def TemperatureDataHandler(e):
  23.     global start
  24.     global outfile
  25.  
  26.     now = time() - start
  27.  
  28.     # Get the board temperature
  29.     ambientTemp = e.device.getAmbientTemperature()
  30.  
  31.     # Write the data to the text file
  32.     outfile.write(str(now) + "," + str(e.temperature) + "," + str(ambientTemp) + "\n")
  33.  
  34.     # Print a dot to indicate one more point recorded
  35.     sys.stdout.write(".")
  36.     sys.stdout.flush()
  37.  
  38. # Write a header to the text file first thing
  39. outfile.write("Time,Thermocouple-Temperature,Ambient-Board-Temperature\n")
  40.  
  41. # Create the Phidget software object, hook in the event function, and open the object
  42. device = TemperatureSensor()
  43. device.setOnTemperatureChangeHandler(TemperatureDataHandler)
  44. device.openPhidget()
  45. device.waitForAttach(10000)
  46.  
  47. # Set the thermocouple type and trigger (0 = record all data)
  48. try:
  49.     device.setThermocoupleType(0, ThermocoupleType.PHIDGET_TEMPERATURE_SENSOR_K_TYPE)
  50. except PhidgetException as e: LocalErrorCatcher(e)
  51. device.setTemperatureChangeTrigger(0, 0)
  52.  
  53. print("Press Enter to end anytime...");
  54. character = str(raw_input())
  55.  
  56. device.closePhidget()
  57. exit(0)

Some highlights:

  • Line 16 and 26: To create timestamps for the data being recorded, we use time() to accurately obtain the elapsed time.
  • Lines 19: We start with a fresh, empty file with the same name each time, overwriting previous contents.
  • Line 49: We used a K-type thermocouple. You need to change this line to your thermocouple type.
  • Line 51: We set the sensitivity (trigger) to 0, to record all data. Setting a value above 0 will only record changes greater than or equal to that value.

Compile and Run

To run the Python code on your system, you can save it in a file such as code.py and then run it from a command line or terminal with:

python code.py

If this basic reminder doesn't help you run the code, you probably will want the in-depth instructions on the Language - Python page.

C Code and Discussion

If you are using Windows, please refer to the Java or Python section as the C code was written on Linux, including the Phidget Single Board Computer (SBC). The use of Phidgets in C on any operating system is the same. However, ANSI-based C does not include support for getting time on any resolution smaller than one second. So, to obtain timing for the data as it comes in, we need to use operating-system specific code. It would be fairly straightforward to modify this code to use a Windows method of obtaining time.

The data logger Linux C source code we used can be downloaded here: File:App guide templogger ccode.c

The entire source code (as this Guide is about data logging code) is:

  1. // Linux version
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. #include <time.h>
  7. #include <sys/time.h>
  8.  
  9. #include <phidget21.h>
  10.  
  11. // This struct gets passed through the "usrptr" part of the Phidgets API
  12. struct userStruct {
  13.    struct timespec start;
  14.    FILE *outputFile;
  15. };
  16.  
  17. // Create a listener function for changes in thermocouple temperature
  18. int TemperatureDataHandler(CPhidgetTemperatureSensorHandle device, 
  19.                            void *userptr, int index, double data)
  20. {
  21.     double ambientTemperature;
  22.  
  23.     struct timespec now;
  24.     double timeDifference;
  25.     clock_gettime(CLOCK_REALTIME, &now);
  26.  
  27.     // Extract the passed user data structure, and the file pointer within it
  28.     struct userStruct *passedData = (struct userStruct *) userptr;
  29.     FILE *file = passedData->outputFile;
  30.  
  31.     // Get the board temperature
  32. 	CPhidgetTemperatureSensor_getAmbientTemperature(device, &ambientTemperature);
  33.  
  34.     // Print dot to the screen to indicate one more data point recorded
  35.     printf(".");
  36.     fflush(stdout);
  37.  
  38.     // Sums the seconds plus nanoseconds
  39.     // Translates to seconds by using 10^9 nanoseconds per second
  40.     timeDifference = ((now.tv_sec - passedData->start.tv_sec) + 
  41.         (float) (now.tv_nsec - passedData->start.tv_nsec) / 1000000000.0);
  42.  
  43.     fprintf(file, "%6f, %6f, %6f\n", timeDifference, data, ambientTemperature);
  44.     fflush(file);
  45.  
  46.     return 0;
  47. }
  48.  
  49. int main(int argc, char* argv[]) {
  50.  
  51.     int result;
  52.     char character;
  53.  
  54.     // Obtain an intial time from which to generate timestamps
  55.     struct timespec start;
  56.     clock_gettime(CLOCK_REALTIME, &start);
  57.  
  58.     // Clear and open the file for writing
  59.     FILE *file = fopen("temperature_data.csv","w");
  60.  
  61.     struct userStruct userData;
  62.     userData.start = start;
  63.     userData.outputFile = file;
  64.  
  65.     // Print the header at the top of the file first thing
  66.     fprintf(file, "Time,Thermocouple-Temperature,Ambient-Board-Temperature\n");
  67.  
  68.     // Create the Phidget software object, hook in the event function, and open the object
  69.     CPhidgetTemperatureSensorHandle device = 0;
  70.     CPhidgetTemperatureSensor_create(&device);
  71.     CPhidgetTemperatureSensor_set_OnTemperatureChange_Handler(device, 
  72.             TemperatureDataHandler, (void *) &userData); 
  73.     CPhidget_open((CPhidgetHandle)device, -1);
  74.     result = CPhidget_waitForAttachment((CPhidgetHandle)device, 10000);
  75.     if (result) {
  76.         printf("No Device!\n");
  77.         return 0;
  78.     }
  79.  
  80.     // Set the thermocouple type and trigger (0 = record all data)           
  81.     CPhidgetTemperatureSensor_setTemperatureChangeTrigger(device, 0, 0);
  82.     CPhidgetTemperatureSensor_setThermocoupleType(device, 0, 
  83.             PHIDGET_TEMPERATURE_SENSOR_K_TYPE);
  84.  
  85.     printf("Press Enter to end\n");
  86.     getchar();
  87.  
  88.     CPhidget_close((CPhidgetHandle)device);
  89.     CPhidget_delete((CPhidgetHandle)device);
  90.     fclose(file);
  91.     return 0;
  92. }

Some highlights:

  • Line 25 and 56: To create timestamps for the data being recorded, we use clock_gettime() (a Linux-specific function) to accurately obtain the elapsed time.
    • Similar (but different) functions exist on Windows
  • Lines 59: We start with a fresh, empty file with the same name each time, overwriting previous contents.
  • Line 82-83: We used a K-type thermocouple. You need to change this line to your thermocouple type.
  • Line 81: We set the sensitivity (trigger) to 0, to record all data. Setting a value above 0 will only record changes greater than or equal to that value.

Compile and Run

The process to compile this code differs from the one described on the Language - C/C++ page. You will need to link in both the Phidgets library (-lphidget21) and the Real Time POSIX library (-lrt) when compiling your code. If you have saved the C code in a file code.c, the gcc compiling command will be:

gcc code.c -lphidget21 -lrt

The Real Time library is required for the clock_gettime function in the C code above. Then, the executing instructions are the same as those described on the C/C++ Language page.

Putting it All Together

If you select your language of choice above and examine what the code does, you will probably find that it simply calls an event function to record data over and over. If you were to use a different Phidget, or different sensor, it will be a differently named event function and Phidget software object. But, many of the concepts remain the same, including:

  • The method for obtaining time and writing time stamps with the data
  • The method of opening and writing to a file
  • The order of setup for the Phidget including creating, opening, attaching, and using. (For more detailed information on these steps, see our programming guide)
  • The ability to analyze the data in a text format or in a spreadsheet format

Now that you have some running code, we go more in-depth on what it does. The code above saves the data from the Temperature Sensor Phidget into a Comma Separated Value file (*.csv). It will be named based on the code snippet you use and written into the directory where you run the code:

  • C# code writes to "temperature_data_csharp.csv"
  • Java code writes to "temperature_data_java.csv"
  • Python code writes to "temperature_data_py.csv"
  • C code writes to "temperature_data.csv"

Try running the code on a command line or in a terminal. For example, if you are using the Python code and have saved it to a file code.py, running it will give you something like this:

The other languages will look almost exactly the same. Each period "." indicates a data point being written to the file. After you have recorded what you want to record, press 'Enter' and the file will be finalized and the program will exit.

When we ran the program, we measured three different warm materials:

  1. We exhaled onto the thermocouple, exposing it to warm air
  2. We touched the thermocouple to warm skin
  3. We dipped the thermocouple into warm tea

These three events form the basis of the data we will work with here and in the analysis section below.

Most spreadsheet programs (Excel, Open Office) will automatically recognize a *.csv file as something they can open. You can use the spreadsheet program of your choice to open the *.csv file and look at the data you've recorded. Here, we use the program R to view and plot the data - it is free and available for many operating systems.

To import the data from the python program, we can start R on the command line with the command "R", and then import the temperature_data_py.csv data file with:

temp.data = read.csv("temperature_data_py.csv")

This import will automatically carry over the headers from the text file. Unlike other languages, the dot "." in R can simply be used as part of a variable name. The "accessor" function for accessing the slots within an object is the dollar sign "$". To plot the temperature data, you simply type:

plot(temp.data$Time,temp.data$Thermocouple.Temperature)

Or we can pretty it up with axis labels, lines instead of dots, and some colour with:

plot(temp.data$Time,temp.data$Thermocouple.Temperature,type="l",ylim=c(0,70),xlab="Seconds",ylab="Degrees Celsius",col="blue")

Which gives:

This temperature variation was obtained by touching the sensor to warm materials, and this is a good test to make sure your leads are hooked up correctly. The large spike in temperature is due to the thermocouple being immersed into hot tea. But if the leads were backwards, as we did with a second recorded series of the same materials, it will look something like this:

Since hot tea is not colder than -10C, this is a good indication that the leads are reversed. However, the ambient temperature at the start of the series is possible and not entirely unreasonable, so accidentally reversing the leads may only be discovered when objects of very different temperatures are measured.

At this point, you have successfully logged data from a Phidget to a text file which can also serve as a spreadsheet. If you want to learn more about how the data can be interpreted, and more about how to use your Temperature Sensor and thermocouple, read on. Otherwise, enjoy playing around with the sensor and logging data on your own!

Data Analysis

In this section, we use the data collected in the Putting it All Together section to examine how different materials provide different rates of heat transfer.

Matching Data With Reality

First, we'll set up a more complete plot of the data. To plot both the thermocouple temperature and the ambient board temperature, you can add things to your plot in R after the first plot command, including a legend in the upper left:

plot(temp.data$Time,temp.data$Thermocouple.Temperature,type="l",ylim=c(0,80),xlab="Seconds",ylab="Degrees Celsius",col="blue")
lines(temp.data$Time,temp.data$Ambient.Board.Temperature,col="lightgreen")
legend("topleft", lty=1, c("Thermocouple","Ambient"),col=c("blue","lightgreen"))

When we expand the window with the plot in it, we can clearly see the three hot materials - air from breath, skin, and hot tea:

Accuracy and Error

Given that the ambient board temperature (green line) is about 2.5 C warmer than the thermocouple (blue line) before we have applied any heat or cold, you are probably already asking about the accuracy. The accuracy of our K-type thermocouple is 2 C. The board temperature sensor has its own accuracy. So in this case, we are not only comparing the thermocouple temperature to whatever the ambient air temperature is (which should be within 2 C of the blue line), we are actually comparing it to a second sensor. And that second sensor has its own error, and that error may even be in the opposite direction!

But this is for absolute temperature. If you are not as interested in how close the thermocouple data is to the actual, real-world temperature, but you are interested in detecting very small changes in temperature, you are in luck. Detecting accurate real-world temperatures is hard because it depends many factors, from the current slight temperature differences across the board to the sampling speed compared to the speed of change, and so on. But detecting temperature change given relative consistency of those factors is easy.

This is one of the fundamental challenges in measuring temperature electrically:

It is easier to measure a difference in temperature than an absolute temperature

....By the way, if you are interested in measuring absolute temperature more accurately, and also change in temperature more accurately, check out Resistive Temperature Devices (RTDs), which you can use with the 1046 - PhidgetBridge 4-Input and resistor hookups such as our 3175 - Precision Resistor - 1K Ohm 0.1% (Bag of 4).....

To describe the precision with which a temperature sensor can detect absolute and relative changes in temperature, the error analysis is split into two parts: accuracy for absolute temperature, and resolution for relative change in temperature:

In addition, noise is random error which can be corrected for in a large data set, but not for an individual data point. Think of noise like static - it is a fairly predictable 'pattern' if you watch or listen to it over time, but precisely predicting one particular pixel or tone in a video or sound stream of static is impossible.

Material Heat Transfer

One of the interesting things about this experimental application is that you can see how the thermocouple measures temperature of different materials.

There are a few different types of materials in this data series - Liquid, air, and soft material. The type of material matters because the thermocouple must become the same temperature as the object it is measuring in order for the correct value to be measured. So a material which transfers its heat poorly to the metal tip of the thermocouple will need more time to produce an accurate measurement, whereas a material which can transfer heat quickly will need less time.

We can see the differences in time for the different materials used:

Most striking is probably the difference between heat transfer in liquid and in air. Air takes much longer to bring the thermocouple to its temperature than the liquid does. This is mostly because the air is less dense, and heat transfer occurs most efficiently by direct contact between surfaces, which are less dense in air than in liquid.

Try measuring different surfaces. You can place different materials in a low-heat oven (or dryer, depending on the materials) to warm them to the same temperature and then observe how fast the thermocouple can equalize with their temperatures. This will give you an idea of how long you will need to wait for equalization when measuring a new material which you intend to build your final system around.

Extra Credit

  • As mentioned above, the thermocouple is a contact temperature sensor - it works by becoming the same temperature as the material it is touching. There was a sharp contrast between liquid and air. But what factors would affect the equalization time for different liquids? Different solids?
  • If you have the 4-input Temperature Sensor, try using more than one thermocouple at the same time on the same material. Then use one thermocouple and move it to different points on the same material. The different thermocouples will probably read a slightly larger variation in temperatures than the single thermocouple. This is related to the accuracy-type error discussed above.



Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox