Reading an NTC Thermistor via an Atmega32's adc pin

Go To Last Post
56 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to read an NTC Thermistor that is connected to an adc pin on an Atmega32.

I'm not sure exactly how the thermistor probe should be connected. Currently it has one wire to ground, and the other wire is connected to adc0 on the atmega32 with a resistor to voltage in line. I'm not sure if that is the correct way to connect it or not.

I'm using the following code to read from the adc:

int x = 0; 
   
  // Activate ADC with Prescaler 16 --> 1Mhz/16 = 62.5kHz 
  ADCSRA = _BV(ADEN) | _BV(ADPS2); 
   
  for (;;) {   
                // select pin ADC0 using MUX 
                ADMUX = 0; 
     
                //Start conversion 
                ADCSRA |= _BV(ADSC); 
     
                // wait until converstion completed 
                while (ADCSRA & _BV(ADSC) ) {} 
     
                // get converted value 
                x = ADCW;   
    } 

However, x is always 1023 (all 1's in 10 bit). X is 1023 even when the thermistor is not connected at all.

Can someone please give me any hints as to what I'm doing wrong?

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What voltage do you actually see on the pin being measured?

Does your ADC work otherwise?
--AVCC hooked up and proper
--All Gnd pins hooked up

What reference voltage are you using? Is ADMUX of 0 really proper for that selection? What is connected to AREF pin?

I'm not good at ASCII-art. We run thermistors (ignoring series R for protection, 100nF cap at input, double-diodes for protection):

AVcc
  |
  |
 bias resistor--a few k to many k; depends on thermistor and area of interest
  |
  |
  +--- thermistor --- AGnd
  |
  |
 AVR pin

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With your setting of REFS bits in ADMUX you have to connect an external voltage source at AREF. Is that really your intention?
What voltage do you read at AREF?
What happens if you connect GND at ADC0 pin? Do you still get 1023?
Definitely sounds like your hardware connections are wrong.
Have you connected AVcc to Vcc ?
AGND to GND ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The issue was I had nothing connected to aref. Thanks for your help.

Now, I'm trying to figure out how to relate the chart in the datasheet (http://www.epcos.com/inf/50/db/n...) to the actual temperature x represents. You guys have any tips?

Thanks again!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First of all, decide what you really want to use as your voltage reference at AREF. If you have connected Vcc externally to it now I recommend that you use internal connection instead by setting REFS bits in ADMUX in the right way. And that you connect 100nF = 0.1 uF between AREF and GND.

Then you should have a multi-turn potentiometer and connect things like Lee described but exchange your termistor for potentiometer. Using a digital voltmeter you set up your potentiometer to the nominal values in the table and then connect it to your circuit.

I don't you what temperature span you want to measure but you need to find a value of the resistor that is connected to Vcc that will let you use as much as possible of 0-1023 range. NTC's are not linear so you have to set your pot to i.e values for 0¤, 5¤, 10¤ and so on and note the ADC result you get. Then you calculate steps betwwen 0-5¤ and make a table in Flash.
I have done this with NTC that is 10k at 25¤. Since your NTC is 5k at 25¤ my valuees can't help you. It's a rather tedious work :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

NTC's are not linear

True. But if you have a definite area of interest (and not the entire span) then you can select a bias resistor value to geta very nice linear range. Instead of the pot method, I use an Excel spreadsheet for a selection of values and calculate the voltage at the pin & the A/D counts. I then let Excel fit a curve (I usually use linear but you can use others) to determine the transfer function.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If my memory serves me well, the first conversion should be discarded if you want some accuracy.

Guillem.

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What Lee says is true if you don't need a large span.
I had to measure 0-99¤ C. I looked at my Flash table.
Smallest change for one degree was 4, largest was 8.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I had to measure 0-99¤ C

Yes, then it is hard to do linear (though Excel did find a 2nd-order equation with R2 over .98 ). I use the linear in apps with a definite area of control spanning 20 to 40 degrees; below it is basically "too cold" and above it is basically "too warm". when too cold or too warm the accuracy isn't important.

You can still use the Excel method to generqate your table. Given values are VRef voltage, AVcc voltage (which drives the bias resistor), and the bias resistor ohms. Then I make two columns from the thermistor datasheet, entering the temperature & resistance at that temperature. (For the linear "piece" method, all values need not be entered--every 5 degrees or so will suffice.)

From the two resistance values and the AVcc value, a column is calculated for "voltage at pin". From that value and Aref and number of ADC counts (is that 1023 or 1024?), the expected A/D counts are calculated in another column.

The only time-consuming part is entering the values from the datasheet. If you are lucky you can cut-paste from the datasheet.

After that, you can make the graph and vary your choice of bias resistor value to shift the curve around. this is a very useful (and important!) step, so that good resolution is obtained at both high and low ends.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Fri. Apr 20, 2007 - 03:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Yes, then it is hard to do linear (though Excel did find a 2nd-order equation with R2 over .9.

Lee, the penalty for not being an engineer is you get to do things the hard way. :mrgreen:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks!

You wouldn't be willing to share your spreadsheet with me would you? So that I would have a known working spreadsheet and then I could look up the datasheet you created it with?

Thanks again!

theusch wrote:
Quote:

I had to measure 0-99¤ C

Yes, then it is hard to do linear (though Excel did find a 2nd-order equation with R2 over .98). I use the linear in apps with a definite area of control spanning 20 to 40 degrees; below it is basically "too cold" and above it is basically "too warm". when too cold or too warm the accuracy isn't important.

You can still use the Excel method to generqate your table. Given values are VRef voltage, AVcc voltage (which drives the bias resistor), and the bias resistor ohms. Then I make two columns from the thermistor datasheet, entering the temperature & resistance at that temperature. (For the linear "piece" method, all values need not be entered--every 5 degrees or so will suffice.)

From the two resistance values and the AVcc value, a column is calculated for "voltage at pin". From that value and Aref and number of ADC counts (is that 1023 or 1024?), the expected A/D counts are calculated in another column.

The only time-consuming part is entering the values from the datasheet. If you are lucky you can cut-paste from the datasheet.

After that, you can make the graph and vary your choice of bias resistor value to shift the curve around. this is a very useful (and important!) step, so that good resolution is obtained at both high and low ends.

Lee

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

You wouldn't be willing to share your spreadsheet with me would you?

The secondary chart expands our area of interest and is used for Excel line fitting. Excel2003 format, IIRC.

For grins when digging out the file, I had Excel fit a line over the whole range from -40 to +100 degrees F using the "best" bias value, and the R2 was .987 --not bad looking on the screen. Would work fine if accuracy isn't needed.

General guideline: "Best" curve occurs with bias 3x to 5x the thermistor nominal k at room temperature. Beyond that, it depends whether high end or low end is the area of interest.

NEW VERSION 3 UPLOADED TO CORRECT CURVE "DIRECTION"--see comments below.

Attachment(s): 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Fri. Apr 20, 2007 - 05:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for letting me use the spreadsheet. The results are kind of confusing for me however.

When I read from the adc, I get lower numbers when the temp rises and higher numbers when the temp goes down. I was thinking that the a/d counts column should equal the number I'm reading from the adc, however, if I understand it correctly, the spreadsheet works backwards from the way my thermistor works.

Is this correct?

Also, my thermistor is 5k ohm, are there any other changes that need to be made since the spreadsheet is for a 1k ohm thermistor?

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

When I read from the adc, I get lower numbers when the temp rises and higher numbers when the temp goes down. I was thinking that the a/d counts column should equal the number I'm reading from the adc, however, if I understand it correctly, the spreadsheet works backwards from the way my thermistor works.

Refer to my ASCII-art above. We use the bias resistor from Vcc then to the thermistor then to ground. So the thermistor will have the lowest resistance value at higher temperatures. At the extreme, say the termistor is 1 ohm so the A/D pin will see basically Vcc. Say the thermistor is very cold and has a very high resistance. The A/D pin will see nearly Gnd. I suspect you have yours hooked up differently.

I have no idea whether my diagram is the "standard" or "best" way to hook up a thermistor. It is the way that we do it. Input impedance to the A/D pin stays relatively constant. Current through the thermistor is minimized to lower self-heating effects.

Quote:

the spreadsheet is for a 1k ohm thermistor?

It doesn't matter what the nominal value is, as you will enter your resistance values into the appropriate column. I'd suspect you want 15k to 20k bias.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Refer to my ASCII-art above. We use the bias resistor from Vcc then to the thermistor then to ground. So the thermistor will have the lowest resistance value at higher temperatures. At the extreme, say the termistor is 1 ohm so the A/D pin will see basically Vcc. Say the thermistor is very cold and has a very high resistance. The A/D pin will see nearly Gnd. I suspect you have yours hooked up differently.

With all respect, looking at your ASCII-art :D
If termistor is 1 Ohm ADC pin will be very close to GND?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have everything connected like the ascii art.

Thermistor pin 1 to ground.
Thermistor pin 2 to ADC0 with a resistor to voltage inline.

However, the reading from the adc still goes up as temperature goes down, and down as temperature goes up.

Any more suggestions?

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's an NTC thermistor right? N= negative, T= temperature, C= coefficient. It's resistance goes DOWN as temperature goes UP. Pretty standard stuff. Since you are using a look up table why would you care which direction the values go?

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, it is NTC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have my NTC termistors connected as Lee's ASCII-art.
When temperature goes up resistance will be lower so ADC values will be lower. This is how it supposed to be. Looking at Lee's Excel-diagram the values do go up with increasing temperature. Something is wrong...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, OK, I GIVE UP!!! ;)

I grabbed one of my spreadsheets that had the info needed. It was used for proof-of-concept to see how our circuit would react with a 1k thermistor, rather than the 10k & 30k that we have been applying. That part stays the same.

Apparently I got my voltage-at-pin formula reversed. When I did it I was just concerned with seeing what bias would be best and how straight the pertinent section could be made. [busy revising spreadsheet...]

REPOSTED A NEW VERSION3 SPREADSHEET TO THE POST ABOVE
Doh!

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I posted a response to a very similar question on an AVR list:

Basically one has a lookup table like
flash unsigned int ntclookup[69]=
{774,765,755,745,735,724,714,703,692,
682,671,659,648,637,626,614,603,592,580,
569,557,546,535,523,512,501,490,479,468,
457,446,436,425,415,405,395,385,375,365,
356,347,338,329,320,311,303,295,287,279,
271,264,256,249,242,235,229,222,216,210,
204,198,193,187,182,177,171,167,162,157};

And use it like
ntc2data=read_adc(2);
roomtemp=0;
while ((ntc2data < ntclookup[roomtemp])&&(roomtemp<70)) roomtemp++;

Epcos have a tool on their site for calculating all the resistance values at different temperatures.
http://www.epcos.com/web/generator/Web/Sections/DesignTools/NTCThermistors/Page,locale=en.html

The connection is from the NTC to ground and an ADC pin and a resistor from the ADC pin to V+ .The value of the resistor would be around the NTC resistance at
the average operating temperature or the middle of the desired temperature range. To have the ADC reading go up as the temperature goes up just swap the positions of the NTC and the resistor.

The Epcos tool puts the resistance values in an MSAccess database.
You can get the values for the lookup table with an Access query like

SELECT Result.t, Result.r_soll, Int(([r_soll]*1024)/([r_soll]+10000)+0.5) AS
adcval INTO adcvals
FROM Result
ORDER BY Result.t;

Replace 10000 by the resistance value connected ADC/V+

Ralph Hilton

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The new spreadsheet works great, and it seems to relate to the readings i'm getting. Thanks very much!

To measure the temp correctly, you have to know the exact voltage that is connected to the thermistor.... even though i have a 5v regulator connected, the voltage is anywhere from 4.5 - 4.9v... is there a way to have the avr act as an exact voltage regulator to put the correct voltage to a certain pin that i could use as a clean steady voltage to the ntc?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
is there a way to have the avr act as an exact voltage regulator to put the correct voltage to a certain pin that i could use as a clean steady voltage to the ntc?

Not as far as I know. I was almost about to add to my former description how to find proper values that you should take care to use the Vcc at the level you will use when your application is ready.
The best I can think of is to use a adjustable voltage regulator and set it to 5v. Use a regulator with some 'overkill' in ability to deliver current needed, then it will not drop down so easily in voltage. Maybe someone else with better skills in analog electronics can give better advice, but I dont think you can use AVR to regulate your Vcc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

is there a way to have the avr act as an exact voltage regulator to put the correct voltage to a certain pin that i could use as a clean steady voltage to the ntc?

Yes--use the same voltage to excite the thermistor that you use as AREF.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aref is set to use the internal 2.56v. If I measure the aref pin with nothing but a capacitor to ground connected, it is actually 2.56v However, if i connect the 2nd thermistor pin to adc0 with an inline capcitor to the aref pin (hoping for exactly 2.56v) i get results that do not match up to the spreadsheet at all (after changing both values at the top to 2.56)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jasonphd wrote:
Aref is set to use the internal 2.56v. If I measure the aref pin with nothing but a capacitor to ground connected, it is actually 2.56v However, if i connect the 2nd thermistor pin to adc0 with an inline capcitor to the aref pin (hoping for exactly 2.56v) i get results that do not match up to the spreadsheet at all (after changing both values at the top to 2.56)

Actually i was wrong...that works fine....

i was looking at the "old" spreadsheet :oops:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For ratiometric conversions as you desire, use AVcc both to excite the sensors and as Vref.

If using internal reference, it probably can't drive ans many mA as your rig is consuming. You could buffer it with an op amp.

Another thing you can do is to switch periodically to AVcc as Vref and do a conversion on the internal reference and then adjust all readings accordingly.

Shortest answer: use AVcc for excitation & Vref.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, what happens if you put your termistor inside your mouth?
Will it read somewhere around 37 degrees C

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

...inside your mouth?

Yes, a bodily orifice can be a good test point. ;)

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lennart wrote:
So, what happens if you put your termistor inside your mouth?
Will it read somewhere around 37 degrees C

Connected the way I stated (adc to aref via resistor), it reads 36 degrees C after several minutes in my mouth :)

That's pretty close, I might be a little cold today.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had to look that ome up in Wiki:

Quote:
A body orifice is an opening in the body of an animal. In a typical mammalian body such as the human body, the body orifices are:

The nostrils, for breathing and the associated sense of smell.
The eyes, for the sense of sight and crying.
The mouth, for eating, breathing and vocalizations such as speech.
The ear canals, for the sense of hearing.
The anus, for defecation.
The urethra, for urination, and in males, also for ejaculation.
In females, the vagina, for sexual intercourse, menstruation and childbirth.
The breast, especially in females for breastfeeding.


I dicovered that termometers had different readings, the most trustworthy temperature source I could think of was my body (orifice).
I didn't try to stick it up my ass though.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

...the most trustworthy temperature source I could think of was my body (orifice).

A packaging such as this might prove useful:
http://www.coleparmer.com/catalo...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, only $93 :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Back in the 70s when I was developing some meteorological equipment, we used to place the sensor and its linearisation components inside a condom which was lowered partially into our highly stable temperature bath. Worked beautifully and did not cost $93 :lol:

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Back in the 70s when I was developing some meteorological equipment, we used to place the sensor and its linearisation components inside a condom which was lowered partially into our highly stable temperature bath. Worked beautifully and did not cost $93

Well, were do you buy a highly stable temperature bath? :D
I looked at some not to cheap digital termometers and they had +/- 0.5 degrees error (at best). I have two DVM's who claim they can measure temperature. One of them didn't work at all. The other one claimed that my body temperature was 33 degrees C which I doubt.

I still would be rather interested in how to calibrate/validate temperature measurements made by NTC termistors. As I stated before the most reliable source I have found so far was my own body temperature, but 6 of my termistors need to measure a span 0-99 degrees C and one outside termistor need to measure -35 - +35 degrees C.
My body orifice test did read 37 degrees C, but I would like to have a couple more stable temperature sources to test against at other temperatures.
Any suggestions how this can be done without loosing a days salary?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lennart wrote:
Quote:
Back in the 70s when I was developing some meteorological equipment, we used to place the sensor and its linearisation components inside a condom which was lowered partially into our highly stable temperature bath. Worked beautifully and did not cost $93

Well, were do you buy a highly stable temperature bath? :D
I looked at some not to cheap digital termometers and they had +/- 0.5 degrees error (at best). I have two DVM's who claim they can measure temperature. One of them didn't work at all. The other one claimed that my body temperature was 33 degrees C which I doubt.

I still would be rather interested in how to calibrate/validate temperature measurements made by NTC termistors. As I stated before the most reliable source I have found so far was my own body temperature, but 6 of my termistors need to measure a span 0-99 degrees C and one outside termistor need to measure -35 - +35 degrees C.
My body orifice test did read 37 degrees C, but I would like to have a couple more stable temperature sources to test against at other temperatures.
Any suggestions how this can be done without loosing a days salary?

A continuously stirred slurry of ice water (distilled water, eg sold for car battery top up) will be 0 C (32 F). If your NTC is water proof and most are, just insert it in the slurry.

A certified PT100 sensor should also be cheap enough to use for your standard for comparisons. The PT100 obeys the Callendar Van Dussen equation (didn't check the spelling). Baths like I used were thousands of dollars back in the 70s. I used the Standards Laboratory of the Australian Bureau of Meteorology...my employer at the time. You will not need one unless you are planning on issueing forecasts for the nation :lol:

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I second the ice bath suggestion. It's pretty precise.

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I second the ice bath suggestion. It's pretty precise.

Really cheap too. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lennart wrote:

I had to measure 0-99¤ C.

Then why you not go the easy way and use a sensor with direct digital °C output, e.g. DS18B20 (1/16°C resolution).

This save many calibration effort.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Then why you not go the easy way and use a sensor with direct digital °C output, e.g. DS18B20 (1/16°C resolution).

Well because I use six indoor and one outdoor NTC to control my heating system. Wires are 3-8 meters, three of the termistors are inside a tank where I store hot water.
Don't know if the chips you recommend would work under those conditions.
Maybe a good way to calibrate my NTC's though.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Accuracy and precision are nice, but why would you need sub-one-degree precision and accuracy in a heating system?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Accuracy and precision are nice, but why would you need sub-one-degree precision and accuracy in a heating system?

It's just my pedantic personality that is pleased by knowing that 78 degrees C on LCD isn't 74 or 82 in reality. I just need to display one degree changes and yes, everything is working as is. Still I'm curious about accuracy and if there is a way to check this that I missed...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rolling boil at standard pressure is 100 deg C. No one mentioned that yet.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since english is not my native language I have to ask what the expression 'rolling boil' means... :oops:
I have thought about boiling water but I wasn't sure if temperature of water in i.e a kettle would be lower than 100 deg. C.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most electric kettles have a switch off (bimetallic strip) that will have some largeish inaccuracy (but perfectly suitable for making tea or coffee). If you put an uncovered saucepan/pot of water on heat and bring it to the boil and keep it boiling gently (a rolling boil) it will be 100 C if this is done with distilled water at sea level and 1013.25 hPa (I am pedantic also :lol: )

[Edit] If you do this as well as the ice slurry, you will have a "two point" calibration. using your mouth will add another point :roll:

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Rolling boil at standard pressure is 100 deg C. No one mentioned that yet.

My sciences are rusty, but isn't that affected by altitude/air pressure?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

is pleased by knowing that 78 degrees C on LCD isn't 74 or 82 in reality

In reality, the thermistor is "reporting" the temperature that it is at. If it is in air 25 cm from a wall and is "reporting" that the temperature is the same as the wall (hmmm--you must have a more trusted temperature reporting device) then the air 25 mm from the wall is the same temperature as the wall. The thermistor is "reporting" the temperature at the location you placed it. If you want the temperature of a different location, perhaps you should place it there.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ross wrote:

Quote:
If you put an uncovered saucepan/pot of water on heat and bring it to the boil and keep it boiling gently (a rolling boil) it will be 100 C

Thanks, suspected this was the mening of a 'rolling boil', just wanted to be sure. :wink:

Lee wrote:

Quote:
In reality, the thermistor is "reporting" the temperature that it is at. If it is in air 25 cm from a wall and is "reporting" that the temperature is the same as the wall (hmmm--you must have a more trusted temperature reporting device) then the air 25 mm from the wall is the same temperature as the wall. The thermistor is "reporting" the temperature at the location you placed it. If you want the temperature of a different location, perhaps you should place it there.

I have read thiss five times or so, still can't figure out what you try to tell me. I do not doubt that thermistors are reporting pretty accurate resistance values, taking into account that my $1 NTC's aren't calibrated and might introduce some error themselves. (I did though put ten of them in my bodily orifice and they all read 37 deg. C). Three of my thermistors are placed inside 20cm long 8 mm wide tubes going to inside of a tank where I save hot water, two are connected to pipes with hot water inside, with some insulation to shield them from air contact. There is really no other location to put them and I have never planned to move them...

I just wanted to check on my Flash table accuracy, after spending a number of hours to create software, hardware and physical enclosures for the three AVR's involved, my pedantic mind likes to do the final touch and find a method to ensure that the deg. displayed on LCD's are within, let's say +/- 0.5 deg. margin.
The boiling water and ice slurry methods are accurate enough, but since my Flash table spans from 0-99 deg. C they are at the very limits of my table and therefore not optimal points to calibrate at. Maybe I'll look into pt100 or DS188?? suggestions.
Thanks for all suggestions. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or let the controller do the work:

#define RREF 10000  //10k NTC 
#define BVALUE 3977  // from datasheet

// calculate NTC resistance , 1023 = 10 bits ADC  10000 = pullup value
float fCalcNtc( word wADCVal ){
	float fRntc;
  fRntc = 10000 *  (float) wADCVal / ( 1023.0  - (float) wADCVal);
	return(fRntc);
}
// calc temperature from NTC value
float fCalcTemp( float fRntc){
	float fTemp;
  fTemp = (1.0 / ( (log(fRntc/RREF))/BVALUE  + 1.0/298.0)) - 273.0; //log = ln 
	return( fTemp);
}

You can increase the resolution by using oversampling.
( see Atmel appnote )

Dig

Last Edited: Mon. Apr 23, 2007 - 06:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dig, thanks for your advice.
I have read that app note before.
I don't need to increase my resolution since my LCD only display whole degrees.
I have looked at several tables for 10K NTC's and noticed that they don't have exactly same resistance for other temp than 25 deg. C
As far as I understand increased resolution would not correct the error possibly introduced by different resistance for different manufacturers NTC's.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "sensitivity" is determined by the Betavalue, this is in the datasheet. With my NTC Bvalue = 3977 the resolution at lower temps using 10 bit ADC is lower than 1 degree, so you can improve the resolution significant by oversampling, even to 16 bits.
The accuracy is pretty good with a 2% NTC like Farnell 118-7036, in practice += 2 degrees for room temperature.
You don't improve accuracy by oversampling.

Dig.

Pages