Continue to Site

How do you calculate temprature from ADC value

jab99407

Member
I have general question if we have 10 bits ADC that gives range from 0 - 1024

What's formula to get temprature value in Celsius ?

Last edited:

rjenkinsgb

Well-Known Member
That depends on the sensor or transducer that is connected to the ADC?

As a general principle, for a linear scale sensor: Call the values at 0'C "LO" and 100'C "HI" :

Temperature = ( ADC - LO ) * ( 100 / ( HI-LO ) )
eg. if 0'C was 177 and 100'C is 620

C = ( ADC - 177 ) * ( 100 / ( 620 - 177 ) );

The multiplier part is a constant so the compiler should calculate it, rather than it being re-calculated every time the calculation is performed.

If it's not a linear sensor input, eg. such as a thermistor and resistor divider, the calculation is somewhat more complex.

Last edited:

jab99407

Member
That depends on the sensor or transducer that is connected to the ADC?
How we calculate temprature, In the case where k type thermocouple connected to ADC ?

rjenkinsgb

Well-Known Member
You cannot read a thermocouple directly with a normal ADC, the signal level is far too low - only about 4mV change from 0 to 100'C

You need to use a conditioning amplifier, and ideally a dedicated device made for K type interfacing, that has the cold junction compensation built in.

Something like this, that has compensation and linearization built in:

You can build one with separate components, like in this article, but it still uses a dedicated thermocouple-related device:

Note that every connection from a thermocouple through to it's conditioning circuit is critical.

A thermocouple is just two different metal conductors clamped or welded together, pretty much the same as many basic electrical connectors.

You need to use the matching Type K connectors and extension cable if the built-in cable is not long enough, and make sure any other connections or joints are identical construction (so adding the same offset voltages) in both wires, like where the thermocouple cable connects to the amplifier.

The amplifier output (and ground) can connect directly to the ADC input, if it has suitable gain.

The module in the first link has its output levels printed on the back; 1.25V offset at 0'C [LO] and 5mV per 'C scaling, making 500mV over 100'C, 1.75V out at 100'C [HI]

Convert those to the ADC count at whatever ADC ref voltage is in use, and plug them in the calculation I gave before.
eg. With 2.5V ref, 1.25 / (2.5 / 1023) for LO and 1.75 / (2.5 / 1023) for HI; 512 and 716

[A ten bit ADC has a range of 1024 values, 0 to 1023 inclusive].

Active Member
Single chip solutions for this -

The above a 1 chip solution. And most of chip resources still left for other tasks.

Here are the other additional chip capabilities -

Regards, Dana.

Replies
3
Views
745
Replies
1
Views
565
Replies
42
Views
4K
Replies
2
Views
762
Replies
21
Views
2K