# Thermistor hash command
The Thermistor
hash command makes it very easy to program for NTC thermistor temperature sensors.
Do not confuse thermistors with thermocouples or RTD sensors. The Thermistor
hash command applies to NTC (negative temperature coefficient) thermistors, and nothing else.
Circuit configuration
The Thermistor
hash command assumes the following circuit configuration, which is used in a large number of standard and custom SPLat controllers.
Example:
The following will return the temperature in ºC of a thermistor connected to analog input 0. The result will be in W. The characteristics of the thermistor and actual circuit values are defined by the hash functions that follow the Thermistor
hash command.
fAnIn 0 ;Raw thermistor voltage to W # Thermistor Params(10000, 3840) Theta(1) Feed(5.6, 5, 50000) RangeC(-25, 50) Order(5) Display(10) ; temp now in W
The various hash functions are explained in the rest of this section.
How it works
When SPLat/PC encounters the Thermistor hash command during program translation, it uses the values supplied in the associated hash functions to calculate a table of raw analog reading versus temperature. It then processes the table to produce a best fit polynomial, and stores the polynomial coefficients in an NVEM0 table. When your SPLat program later wants to convert a raw analog thermistor reading to temperature, the raw reading is "fed into" the polynomial and converted to temperature. In effect, this process automates the older procedure given in the thermistor temperature measurement tutorial.
The result screen and sandbox
If the Thermistor
hash command line includes a Display
hash function, SPLat/PC will pop up a special window that shows the results of its internal calculations. This window includes a sandbox function, that lets you experiment with different values and generate a modified Thermistor
command line.
Selecting a thermistor
There are no hard and fast rules for thermistor selection, but here are some pointers.
- Many thermistor families come in a range of R25 values.Typical values are 1K, 2K, 5K, 10K, 20K, 50K and 100K.
- The higher the temperatures you want to measure, the higher the R25 value will need to be to get optimum performance, and visa versa. For example, if you are interested in temperatures around 0°C, a 1K or 2K thermistor will be appropriate. Around room temperature a 10K unit will work well and for boiling water look at a 100K. The rule of thumb is that the thermistor resistance at the temperature of main interest should be about the same as the feed resistor Rfeed.
- Thermistors come in many shapes and sizes. Some are designed for temperature measurement, while others are designed for other functions like circuit protection. (A common circuit protection use is inrush current limiting in power supplies). Obviously, you want one that's intended mainly for temperature sensing or measurement. You also want one you can "live with" in terms of mounting, encapsulation etc. Some companies offer thermistors already made up into probes (click here, if you are online, to search), while others sell the bare component. Betatherm is a typical company that specializes in quality thermistors for temperature measurement, but there are many others. Temperatures.com provides many more suppliers plus a lot of additional information about temperature measurement.
We are in no way associated with any of the above referenced resources and take no responsibility for their accuracy.
- Thermistors come in many accuracy grades. Usually they are specified in terms of the R25 tolerance, with typical specs being 0.5%, 1%, 2% or sometimes 5%. As a first approximation the temperature accuracy of the thermistor at 25°C will be half the percentage tolerance, meaning a 2% thermistor will be about 1°C accurate at 25°C. That compares very well with semiconductor temperature sensors. For example, the popular LM35 has a 2.5°C accuracy for the low grade part, and 1°C for the premium part. Betatherm and several other specialist companies have thermistors with an initial accuracy of 0.05°C at 25°C
Don't equate the thermistor accuracy with the final measurement accuracy you will achieve! There are many other sources of error that cannot be controlled as easily as just paying out a few more dollars for the thermistor. The main benefit of buying a very high accuracy thermistor is interchangeability.
The thermistor hash command does not set the thermistor drive voltage. On the MMi202 and SL100 you need to initialise the thermistor drive voltage yourself.
MMi202 thermistor drive voltage SL100 thermistor drive voltage (Look near the bottom of the respective pages)