Thermistor calibration


Using this code and the exact wiring setup that they described, I got temperature readings of -44C at room temperature with normal behavior of increasing when I would touch the thermistor. Is it normal that I would have to calibrate it by adding approx 65C to the temperature value?

Thanks! Cedric

It's not normal. You may have 100K thermistor. What is it's resistance when you measure just the thermistor with a DMM?

jboyton: It's not normal. You may have 100K thermistor. What is it's resistance when you measure just the thermistor with a DMM?

I measure 10K. Let me know if that's what's expected, thanks.

Then you did something else wrong.

Start over at the beginning and pay close attention to each step.

In measuring the resistance of the thermistor, it should vary with a little temp change. Does yours vary? how much?

If you have not already, I like to put a small capacitor between the analog input and ground (about .1 or .01mf). It sometime solves strange readings.

I didn't see which arduino board you are using, just assuming one that is 5volt. If it is a 3.3 volt board, then that may require some adjustments.

I am not a math whiz, but I am having a hard time figuring out how a calculation alone can give much accuracy. There are hardware variables that need to be taken into consideration. The 5Volt that is only 4.7 v. The value and characteristics of the thermistor. If the arduino is a 5v or 3.3v processor... I normally calibrate with a good thermometer, using the map() function, and that seems to work well for any hardware variations that may show up.

It doesn't matter. If the thermistor is even close to 10K the reported temperature would also be close to room temperature.

And 5V or 3.3V doesn't matter either. The output of the ADC is a measure of the proportional voltage drop.

In the playground example that the OP said he is following, the author of that example stated (note: ideally, the arduino would be running at 5.0 volts, but my power supply gives it 4.86 volts, so I divide by 4.86. With respect, I still think the hardware variances will adversely affect the calculation, unless you calibrate with map().

[quote author=jack wp link=msg=2316676 date=1436917097] In the playground example that the OP said he is following [/quote] Obviously not a good example to follow if you only read half of it. Resistance can be determined without knowledge of the supply voltage, as the author goes on to state:

The resistance calculation uses the ratio of the two resistors, so the voltage specified above is really only required for the debugging ...

The important stuff is the value of the balancing resistor in the divider which needs to be accurately measured, and the B-value used in the Steinhart-Hart equation.

It's a tricky equation to follow, so maybe a typo or cut-and-paste error is giving the discrepancy.

The exact value of the analog reference only matters for printing the voltage. As MartinX has reiterated, for calculating the temperature the voltage is irrelevant. Go ahead and change 4.86 to 9837.21 in the sketch. You'll get the same temperature.

It's kind of a sloppy, blog-like tutorial aimed at a beginner audience. But the code actually works reasonably well.

I've used the Steinhart-Hart equation for thermistors. Over a limited range it can be quite good.

It seems I may have quoted out of context. Thanks for the heads up.

I have never used the Steinhart-Hart equation for thermistors. I have only used the method to calibrate with the map() function. Have you used both? Which one do you think is more accurate?

I'm using 5V. Any other suggestions would be appreciated.

I just tried it with a $3 1% tolerance 10K thermistor and a 10K resistor that measured 10.00K on my DMM. The first two sketches were both within 1-2°F of the digital thermometers I have sitting on my desk. The third sketch read slightly high until after I noticed that the fixed resistor value is defined in the code as 9850 ohms and I set it to 10000. I didn't try the last sketch.

So what is there to suggest? The code works. Obviously something is wrong either with your setup, which is invisible to us, or your code, which is also invisible to us.

(edited to be nicer)

@CedricE, maybe a couple questions. 1. What range do you want to measure? Freezing to boiling, 20 ` C range, or if for an incubator, only a range of 2 degrees ?

  1. With your 10k thermistor hooked to the 10k fixed resistor (voltage divider), what value did you read on the analog pin? The voltage on the pin should be about 2.50 volts (relative to ground). In the script you should be a reading close to 511. Is it?

  2. have you put a small capacitor on the analog pin ?

  3. Ar there any other processes running on this arduino (any other analog inputs being used)?