Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - temperature formula help please

(you are viewing a thread; or go back to list of threads)

temperature formula help please (by simon)
Hi
I have a very simple temperature controller using NTC10K sensor and 3 resistor .
I read this data :
-20 C = 1013
-10 C = 1001
0 C = 980
+15 C = 936
+30 C = 875
+90 C = 477

How can y made a formula to read temperature from -25C to +200C ?

Tanks
Wed Feb 2 2011, 13:22:34, download attachment termometru32ntc10.JPG
(no subject) (by David R)
give the piecewise linear function a try
through it does not look like you have enougth range in your voltage.
Regards
David
Wed Feb 2 2011, 17:39:09
no subject (by simon)
Tank you David
I need to use formula with another sofware
Thu Feb 3 2011, 06:08:53
no subject (by simon)
Hi

You need to correct what I said earlier. Temperature range is from -20 to +100 degrees Celsius.

Tanks
Thu Feb 3 2011, 09:59:37
(no subject) (by Jonathan Westhues)
Even if your software doesn't have a specific piecewise-linear function, you can still do that. For example, if the ADC code is between 477 and 875, then the temperature should go linearly between 90 and 30 degrees, for T = 90 + (30 - 90)*(code - 477)/(875 - 477). So you'd write equations for the five straight line segments, and choose among those five equations according to the interval that the ADC code falls into.

Although as David notes, your curve gets very flat with cold temperatures. So very small inaccuracies in the ADC code will give large inaccuracies in the measured temperature. If you need accuracy over the full range, then you might do better with a bandgap-type temperature sensor (e.g., the LM135), which is much more linear.
Thu Feb 3 2011, 10:11:40
no subject (by simon)
Thanks for the help. I will try to do as you say.
Fri Feb 4 2011, 10:28:20
no subject (by simon)
Hi Jonathan

I tested your idea, but I stuck at sub-zero temperatures.

If you could help with LM35C, how to calculate the entire range of temperatures (positive and negative), I used the equation:
T = ADC * 5.

Thanks a lot
Fri Feb 4 2011, 13:38:32
(no subject) (by David R)
I use A sht-75 these are digital temp and humidity and work vary well.
I can post code that will talk to these.

Regards David
Fri Feb 4 2011, 17:50:08
(no subject) (by Jonathan Westhues)
The LM35C outputs a voltage proportional to the temperature in degrees C. So for negative temperatures, you need a negative voltage supply, and an A/D input capable of converting a negative input voltage.

This gets complicated; there's ways you could it (most readily, by lifting up the LM35's ground reference with respect to that of the microcontroller), but it's easier to use an LM135. This reads out in Kelvin, so the voltage is always positive.
Sat Feb 5 2011, 01:00:31
(no subject) (by David R)
I sometimes use A Precision Full Wave Rectifier see

http://sound.westhost.com/appnotes/an001.htm

This allows the measurement of + and - voltage.
through you need to hack the circuit to generate an output to till the micro controller which mode it is operating in.
Regards
David.
Sat Feb 5 2011, 18:59:06
read temperature from ADC... (by dzairo)
Hi all. I see your post and I have question. Is possible to made
new instruction?? New for read value from ADC and calculate with formula to convert value to temperature (celsius or Fahrenheita). Use 10k NTC chip. and new for I2C read data from external IO (ADC, memory ...). Now we can read data from ADC but we need calculate with defined formula to calculate real data (temperature). All MCU have only 8 or 10 ADC input. But I want use more. Is possible to use external ADC (I2C or SPI) but this function is not implemented.
what about this idea???

king regards
Sun Feb 6 2011, 13:06:01
no subject (by simon)
Thank you guys for help. Can not find currently to buy LM135, but I'll do a test next week with the LM335.
Sun Feb 6 2011, 17:04:02
no subject (by simon)
Hi
I tested LM335 with :
T = (4.7*adc0)/1024.0*100.0-273.15
4.7=ref pin
is ok
I din't test the negative temperature . Next days.
Fri Feb 11 2011, 14:19:32
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):