SPLat Logo

Example: Simple temperature threshold with thermistor

NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

Example: Simple temperature threshold with thermistor

There is now a very easy way to calculate temperatures from thermistor readings.

There may be times when all you need out of a thermistor is a simple yes/no as to whether the temperature is over or under a fixed limit, or threshold.

There is a collection of program examples our website in the File Resources area. In there the folder thermistor contains a SPLat example, SIMPLE1.SPT, that does just that. It won;t give you a temperature value but will resolve if the temperature is below or above the threshold.. The process for incorporating this function into your own program is this.:

  1. Use a spreadsheet to establish the thermistor operating conditions.
  2. Copy the code from our example program into your program
  3. Extract two constants out of the spreadsheet and edit them into our example program (expanded below)
  4. Insert GoSubs into your program to initialize the thermistor circuit and to test the temperature.

SIMPLE1.SPT contains instructions on integrating itself into your program. Below is the procedure for establishing the two required constants (which depend on the thermistor you are using and on the temperature you are interested in.

  1. Select a thermistor. Generally this works best with most SPLat boards if the thermistor has a resistance of about 10K around the temperature of interest. R25 is one of the two key thermistor parameters. The table below gives suggested R25 values to aim for versus threshold temperatures.
  2. Establish the actual R25 value for your selected thermistor, and its Beta value (sometimes called B, and usually a number around 4000).
  3. Run Excel and load the spreadsheet Thermstr8.xls
  4. Enter R25 and Beta into the green cells labeled R25 and Beta
  5. Set Tmin and Tmax values. I suggest Tmin about 10°C below your threshold temperature and Tmax 10°C above. If you think you may want to change the threshold temperature, use values that bracket the range you expect to need. Note the spreadsheet is all in Celsius, and you must not try and use Fahrenheit values!
  6. Hover the mouse over the other parameter labels and read the pop-up boxes. Follow the instructions given to enter the remaining values.
  7. Click the "Find best Vfeed" button.
  8. Click the "Q" button
  9. Read off the AnOut value in the hot pink cell. This is the value for cTLM_Drive in the program.
  10. Find the required threshold temperature in the column labeled "T".
  11. Read off the corresponding number from the "Count" column. Round it to the nearest integer value. This is the value for cTHM_ThresholdCount in the program.
  12. Edit the program at the places flagged with <<<<<<<<<.

Suggested thermistor R25 values versus threshold temperature

If you can select a thermistor close to the R25 listed below, you will get the best temperature discrimination. This is not of cosmic importance, assuming you don't need huge accuracy. The "Resolution" column in the spreadsheet is indicative of performance for a given set of parameters. The smaller the number the better.

Temp °C R25
-35 625
-20 1250
-5 2500
10 5000
25 10000
40 20000
55 40000
70 80000
85 160000
100 320000
115 640000