Tolerance of Resistor when using Thermistors for Temperature Readings

Hello All :wave:t3:,

Electrician here by trade, not great at electronics. Need some pointers please and thanks. Situation here, had to rebuild a hot tub controller in late fall/winter…

For temperature, the hot tub has an NTC ~10Kohm(@25celsius) thermistor in contact with water inside tub. I created a voltage divider with what I had on hand with a ~10Kohm resistor (do not know accuracy/grade/tolerance??:grimacing:).

I did this in cold weather as mentioned and calibrated the incoming analog input integers to the correct temperature using 2 known working good thermometers (both calibrated).

Now that it is summer, the temperature of hottub is off by as much as 2 degrees . My thought is the thermistor should be rather consistent as its environment has not changed much BUT possibly the dividing resistors environment has changed quite a bit and maybe the resistor used in the controller box are not good ones and its resistance varies drastically due to outside temperature swings???

Any electronics help would be great.... maybe I just need to buy better grade/tolerance dividing resistors? Any thoughts?? Thank You!!

Normal resistors are 5% tolerance ( 3 colored bands an gold band) or2% tolerance (4 coloured bands).
The resistance will depend on temperature (not much though).
Best way would be to put your voltage divider resistor with the thermistor in the bath...
Or find the temperature coefficient of your resistor and correct for temperature using the outside temperature...

Resistors (and thermistors) are very stable but they have tolerances. But that's not too important because just about any temperature measuring device has to be calibrated (if it's expected to be accurate).

Corrosion could add resistance to the connections, or you could otherwise have a bad connection.

Was it ever correct at higher temperatures? Was it ever calibrated?

A regular straight-line calibration is done by adding or subtracting an offset, which is usually measured at zero (or the minimum expected reading). And a slope, which is a multiplication factor calibrated at the maximum or "most important" temperature.

...If your offset is calibrated at zero it's easy because any slope factor (multiplying by zero) doesn't mess-up the zero calibration. If you choose a different (low) reading for offset, you'll have to solve simultaneous equations.

Depending on the type (composition) of the resistor in the controller box, its temperature coefficient might be on the order of 1000ppm/ºC. Thus if the ambient temperature swing is large, its value would change by several percent.

The simplest solution might be to replace it with a resistor with a very low TC. You can research that with a search engine or an electronic supplier's site.

You got three things working against you:

The ESP32 ADC has a limited range is non-linear and also needs to be calibrated.
The thermistor is non-linear and need to be calibrated.
You are using a resistor of unknown quality
You are using a thermistor of unknown quality. Maybe the tolerance is +/-2% over 100 degree range.
Wait that's Four things.

Maybe time to buy a new generic temperature controller.

Hmmmm :thinking:…. These are all great tips and advice.

@build_1971
So looks to me I had used very old time looking resistors, about 1/2 to 1 watt in size and very dark brown in colour…. 3 colour bands with a silver band on other end. Think its time to change these over to 1/4watt blue resistors I now have on hand with 4 colour bands like in your profile picture. For a start anyway. I do not the TC of these blue resistors but Ill try and find and compensate for this.

@DVDdoug
I “calibrated” them best an electrician can, LOL but like I said, did this at -20celsius outside temp. To bring the tub and piping to “zero” would not be good for obvious reasons BUT ill take the rest of the comments and digest! Thank You. I will be redoing connection s and checking when I change resistors.

@EmilyJane
Temp swings can be from -40celsius to +30celsius so roughly 70-80 degree swings.

@jim-p
Very good advice!! You are so right LOL,,, trust me, I shopped around, best I could find at the time was 1500$… we had just gone on strike at work (still am on Strike), 4 beautiful little kids, inflation, a car the dealership had just blown the engine on and we are still fighting to this day through the courts for proper compensation. In life, When it rains it Pours they say… LOL

I am trying the best I can given the times and the cards life has dealt us! Hahaha its fun learning as well

Wow, you have found some resistors with 10% tolerance. Probably 50 years old...
But: that does not matter...
Your calibration will compensate for the error....
maybe temperature dependency of these old ones is worse (I do not know).

Google says:
Metal film resistors have Temperature coefficient values ranges from ±50 – >±100 (ppm/°C) & Voltage coefficient is 0.0 %/V. & Voltage coefficient is 0.0 %/V. The carbon film resistor has temperature coefficient ranges from ±200 – >±1500 ppm/°C & Voltage coefficient of 0.0005 %/V.

You now have carbon film resistors...
... so metal film resistors would be much better.

As for the non linearity of the NTC: I guess there are formulas for that... and otherwise you could do a 3 or 4 point calibration... ...and fit some polynomial...

@build_1971
Metal film and recheck connections underway. I will of course need to remap all my calibration points

@ZX80
Thanks for that :+1:t3:. This library is in use and also reached out to the creator of library to specifically talk about his NTC thermistor example and he helped me along originally.

This is why I suspect as others have said,,, there are a lot of factors against me here,,, poor quality dividing resistors, ESP32 really does suck, i have no idea quality of thermistors either, I need to research and do a better job of calibrating…. At end of the day, not terrible results but not accurate as they are currently

Those would be carbon resistors and will drastically change value with age. Test yours with your ohmmeter to see what today's value is!

I will definitely be replacing… One thing I forgot to do in my calibration table was an original ohm reading of resistors at certain temps. Will not forget this time around . This is a case where older is not better right :wink:.

I believe I got these resistors from a mine/mill We were decommissioning that was over 100 years old. I have this problem where I love old time stuff and sometimes use them in projects :man_facepalming:t2:

I am the same way! Some of my resistors are from stuff I dismantled in the 1960-1970 time. Carbon resistors NEVER stop changing. I got a factory metal box of assorted packs of new carbon resistors because my tech got them from someone else and he did not like having to measure each resistor before using it. I use so few that I do not mind. For instance, out of a pack of 4 resistors, only one was close enough to the needed value to be usable.

Really handy if you need a 11 k resistor!

1 Like

You could also be picking up noise if the thermistor is a long (wire) run away, and also if the Arduino power is not earth-grounded on the DC side. A two-prong wall wart will have a lot of noise as their output floats, it's not grounded.
Sometimes heater power or the circ pump on can add AC hum, or the thermocouple thermowell can pick up noise as well. Just things to consider before blaming the resistor.
The giveaway is if the temp reading error moves around, sometimes high or low etc.
Water in the thermistor or wiring will make it read high.

You can add averaging in software too to filter out some noise, add a 0.1uF cap for the analog input to GND etc.

An ESP32 has the wrong A/D converter for a thermistor.
A thermistor needs a ratiometric A/D. The ESP has an absolute A/D.
You never will get it to output a stable temperature.

Replace the thermistor with a digital temp sensor, like the DS18B20.
Don't be fooled by the "waterproof" versions (they are not).
Mount it against the outside of the hot tub.
Leo..

More things to consider… powered by a wall wart so that was in the future plans to give it all (electronics) a proper ground reference.

I do currently have a software smoothing filter and it seems to help some :+1:t3: but i will add the actual hardware filter. Thanks

Hmmmmm… all of what you said goes well over my head but I will take that as good advice and maybe try and implement this DS18B20. I need to dig a little deeper into the sprayfoam and hottub workings BUT this looks to be the right size and I may be able to pull the thermistor out of the thermowell and replace with the mentioned product.

Thank You

1 Like

It is unlikely your resistor has changed much,*** but being non linear the NTC may be stable but may not change the way you expect.

I don't think this is your problem but there should be a 0.1µF ceramic capacitor between A0 and ground.

One possibility is; you would like the NTC to read the water temperature, but it is on the other side of the tub wall. I don't know the temperature of the back of the tub wall (where the NTC is) during the winter but I would not be surprised if it could simply be affecting a change to the actual NTC temperature.

Is your 2° F error from reading the NTC value from the ESP or is the ESP controlling the tub and the water is off by 2° F?

Do you have a specification for the NTC? Where did you purchase it.

What is your target temperature?

*** BTW those brown body with flat ends are old Allen Bradley resistors. Please dispose of them safely. I don't know the Tempco for them but I wouldn't trust them for measurement (or anything). Note it doesn't matter in this application but these when stressed will fail shorted, not good.
You should be using metal film resistors, much better than carbon film resistors.

1 Like