What is a model? Without taking the time to look up an official definition, I would say it is a representation of reality. (I am sure some women would like to argue that point with me, but when I wrote the definition, I was not thinking of THAT kind of model! 🙂 ) Seriously, when I was a child plastic model cars were very popular and we would glue together all the plastic parts and end up with a car just to stare at.

Weather we know it or not, we have models running in our heads all the time. If I am happy and smile, my model in my head says many people will smile back. When that doesn’t happen, I start developing another model… usually in this case the new model says:”I don’t like it here.” I digress…

Engineers love math models. It allows us to experiment with something before we actually build it. If there was unlimited time and unlimited money we could keep plugging in parts until we get what we want, or we let all the smoke out of the thing we are building. Math models allow us to take our best guess as to what will work before we build the device and we can run the models on a computer program so see how well thinks will work. That is exactly what we did when I produced the graphs in the article “Principles of Linearizing the Thermistor” and later in “Linearizing our Thermistor“. The problem we still have ahead of us is determining how we will deal with the tolerances in the components. So… more math models.

The Wikipedia article on Thermistors gives an equation to model a thermistor called the Steinhart-Hart equation. This equation is shown in the first picture. It is easy enough to solve and use to model a thermistor. The equation has 3 unknowns, a,b, & c, and since I have data from several points these were easy enough to determine. I used the datasheet values for T = -30, 25, & 100 deg C. Before plugging those into the equation I had to convert deg C to deg K because the equation specifies it must be an absolute zero scale. (deg K = 273.15 + deg C). Solving this gave me the following values for a, b, & c:

- a = 0.00118499254653
- b = 0.000227992348542
- c = 8.84875064566e-08

Plugging these into the equation and comparing the calculated values to the datasheet values gave the graph shown to the right. I would say that looks pretty darn close! However, not being able to leave good enough alone I decided to subtract the two values and produce an error graph.

The error of the calculated value compared to the datasheet value is shown on the graph to the left. Again… pretty darn close.

The problem with this is it is of no-help to us at getting at the tolerance values stated in the datasheet. It turns out the datasheet used another, less accurate equation. However, the effort was not useless, we will have a use for the equation later.

The datasheet provided tolerances based on the equation shown to the right. We were told a Tref = 25 deg C (298.15 deg K), Rref = 10,000 Ohms with a +/- 10% tolerance. The B factor in the equation is 4038 +/- 2%. I wrote a simple python program and ran the equation 5 times. Once with Rref = 10K and B = 4038 and then with all four combinations of Rref at the high value or low value with B at high value and low value. Some of the results are pictured next.

Because I have been graphing all of these on a log scale for the resistance,I got curious about how it would look with R on a linear scale. I am not sure what it is telling me, but it is interesting.

Now that we have done all of this calculating what do we really have? Actually we are well on our way to really understanding how to build and calibrate the final circuits. We already know that we will have to put an adjustable offset and gain adjustments into the final amplifier. The big question to me is after we do make those adjustments how much with the variation of the R25 value throw off our linearization calcuations? Will we have to compensate by adjusting the value of the parallel resistor? Then there is the really big question. If we have variations in the voltage output of this circuit, how much will it really affect the temperature after the final linearization is done by the computer? I am close to doing all those calculations, but not quite there yet. It will have to wait until a future post. To be continued…. (Kind of melodramatic ending wasn’t it?)

I do have all of the python programs I have been using available. I do not have them very well documented. If you would like the programs please e-mail me at garyfox@create-and-make.com and I will clean up the documentation a little and send them to you in an e-mail attachment.

As always thank you for your time, I hope I made it interesting, educational, and enjoyable. If you enjoyed this article please consider informing your friends and associates about it and consider subscribing to the site.

Gary

[…] block diagram above and described how we would have to calibrate the thermistors. Later in “Modeling the Thermistor.” I described the two models for the thermistor. One, the Steinhart-Hart model, was very […]