2825 views|19 replies

768

Posts

0

Resources
The OP
 

Please tell me how to convert the ADC value of thermistor into temperature [Copy link]

 

I am using a 3950 100K thermistor, and the VCC is 3V. The ADC value read at room temperature is 0X0E25, which is 3621. How do I convert it into a temperature value? Thank you. The temperature comparison table says 100KR = 25 degrees.

This post is from PCB Design

Latest reply

Thermistor is generally ADC + table lookup   Details Published on 2024-2-27 10:02
 

650

Posts

8

Resources
2
 

The adc value is converted into voltage, adc_V/3.3 = adc/4095 (depending on the number of ADC bits), and then the corresponding resistance is calculated, and the temperature is obtained by looking up the table.

This post is from PCB Design

Comments

It is 12 digits. I don't quite understand it. Is it 3621/4095? The result doesn't seem right.  Details Published on 2024-2-22 15:20
 
 

6075

Posts

6

Resources
3
 

This mainly depends on the temperature comparison table, which is generally included in the specification sheet of thermistor.

This post is from PCB Design

Comments

There is a temperature comparison table in the specification, but I don't know how to convert it  Details Published on 2024-2-22 15:19
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

768

Posts

0

Resources
4
 
Qintianqintian0303 posted on 2024-2-22 15:16 This mainly depends on the temperature comparison table, which is generally included in the specification sheet of thermistor. It is basically linear
There is a temperature comparison table in the specification, but I don't know how to convert it MF52A-100K-B3950.pdf (241.22 KB, downloads: 16)
This post is from PCB Design

Comments

What an obvious negative feedback thermistor. Collect the voltage value, calculate the thermistor value based on the voltage value, and then compare  Details Published on 2024-2-22 15:40
 
 
 

768

Posts

0

Resources
5
 
29447945 Published on 2024-2-22 15:10 The adc value is converted to voltage, adc_V/3.3 = adc/4095 (depending on the number of ADC bits), and then the corresponding resistance is calculated, and the temperature is obtained by looking up the table.

It is 12 digits. I don't quite understand it. Is it 3621/4095? The result doesn't seem right.

This post is from PCB Design

Comments

First calculate the voltage at the detection point is 3621/4096*3.3≈2.92V, then calculate the resistance value of the NTC at this time according to the circuit schematic, and finally look up the table to get the temperature  Details Published on 2024-2-22 15:44
First calculate the voltage at the detection point is 3621/4096*3.3≈2.92V, then calculate the resistance value of the NTC at this time according to the circuit schematic, and finally look up the table to get the temperature  Details Published on 2024-2-22 15:31
 
 
 

1792

Posts

0

Resources
6
 
sky999 posted on 2024-2-22 15:20 It is 12 digits, I don’t quite understand it, is it 3621/4095? The result doesn’t seem right either

First calculate the voltage at the detection point is 3621/4096*3.3≈2.92V, then calculate the resistance value of the NTC at this time according to the circuit schematic, and finally look up the table to get the temperature

This post is from PCB Design

Comments

Thanks  Details Published on 2024-2-22 17:43
 
 
 

6075

Posts

6

Resources
7
 
sky999 posted on 2024-2-22 15:19 There is a temperature comparison table in the specification, but I don’t know how to convert it

What an obvious negative feedback thermistor. Collect the voltage value, calculate the thermistor value based on the voltage value, and then compare

This post is from PCB Design
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

650

Posts

8

Resources
8
 
sky999 posted on 2024-2-22 15:20 It is 12 digits, I don’t quite understand it, is it 3621/4095? The result doesn’t seem right either

If you don't understand it, it means you don't understand the principle of ADC. It is recommended to read the principle of ADC first. Once you understand it, you will know it.

This post is from PCB Design

Comments

Yes, ADC is rarely used, thank you  Details Published on 2024-2-22 17:43
 
 
 

31

Posts

0

Resources
9
 

Your circuit is divided by 10k, that is, RT/(10kΩ+RT)=ADValue/4096, so ADValue = 4096RT/(RT+10kΩ), or RT = 10kΩ·ADValue/(4096-ADValue).
For example, for 100kΩ at the standard 25℃, the corresponding AD sampling value is about 3723. The sampling value of 3621 you cited corresponds to a resistance value of about 76.2kΩ, which is converted to the corresponding temperature after looking up the table.
This is just a principle calculation explanation. There are many factors that need to be considered in actual engineering design, such as compensation for heat caused by static current, compensation for poor heat dissipation/excessive heat dissipation, consistency of thermistor, etc. It takes a lot of thought to be both cheap and accurate.

This post is from PCB Design

Comments

Thank you, it is much easier to understand if you put it this way. I have never come into contact with thermistors, so how should I do heat compensation?  Details Published on 2024-2-22 17:44
 
 
 

894

Posts

0

Resources
10
 

Calculate the resistance based on the ADC value, then look up the table and perform linear interpolation

This post is from PCB Design
 
 
 

768

Posts

0

Resources
11
 
sint27 posted on 2024-2-22 15:31 First calculate the voltage at the detection point is 3621/4096*3.3≈2.92V, then calculate the resistance value of the NTC at this time according to the circuit schematic, and finally look up the table...

Thanks

This post is from PCB Design
 
 
 

768

Posts

0

Resources
12
 
29447945 Published on 2024-2-22 15:44 If you don't understand it, it means you don't understand the principle of ADC. I suggest you read the principle of ADC first. Once you understand it, you will know it.

Yes, ADC is rarely used, thank you

This post is from PCB Design
 
 
 

768

Posts

0

Resources
13
 
Ejack1979 posted on 2024-2-22 15:59 Your circuit is divided by 10k, that is, RT/(10kΩ+RT)=ADValue/4096, so ADValue = 4096RT/(RT+10kΩ), or RT = ...

Thank you, it is much easier to understand if you put it this way. I have never come into contact with thermistors, so how should I do heat compensation?

This post is from PCB Design
 
 
 

6788

Posts

2

Resources
14
 

There should be relevant code on the Internet. I will look for it and send it to you for reference when I have time.

This post is from PCB Design
 
 
 

6841

Posts

11

Resources
15
 

I originally wanted to use NTC to measure temperature.

I have encountered the same problem as you.

NTC is used in many scenarios, including temperature control circuits, humidity collection, etc.

I suggest you first get familiar with the characteristics of NTC resistors and the relationship between temperature and resistance. For example, 25 degrees is 100K, how many K is 20 degrees? If you convert the temperature according to the official resistance table.

Let's learn about ADC conversion again. 10-bit, 12-bit, 14-bit, and 16-bit ADCs can divide the ADC reference voltage into the power of 2. Use the obtained ADC value to convert it with the voltage divider circuit to get the resistance value, and then find the temperature value based on the resistance value.

Take your circuit as an example:

Assume the NTC resistance is R, and the voltage is v

According to Ohm's theorem, the calculation formula should be: (R+10K)/3=R/v

The data you provided is only an ADC measurement value, which cannot be used to calculate the voltage value.

because:

1. You did not provide the number of bits of the ADC.

2. You did not specify the reference voltage of the ADC.

If your ADC is 12 bits, the reference voltage of ADC is 3.3V

Then the formula for calculating v is: v=(3621*3.3)/4095.

This way you can calculate the resistor value.

Then check the resistance conversion table provided by the NTC you bought. The resistance value he gives you is also in integer degrees. If you want to subdivide it, you need to calculate the decimal temperature based on linearity.

Another way to improve accuracy is to calculate the maximum voltage change range based on the temperature change range, and then use an operational amplifier to amplify the voltage and then calculate it, so that the temperature value obtained will be more accurate. Of course, to improve accuracy, you also need to use more accurate reference voltages, collection resistors, etc. There is a lot of knowledge and a long way to go!

This post is from PCB Design
 
 
 

6841

Posts

11

Resources
16
 

Also, the voltage divider resistors you selected do not seem to be suitable. It is best to use 100K and 100K NTC resistors to distinguish them. For a circuit like yours, the voltage value divided by the NTC is very small, which is not very good for the measurement accuracy of the ADC.

This post is from PCB Design
 
 
 

6841

Posts

11

Resources
17
 

The resistance value of NTC should be determined according to the temperature range you want to measure. You can check the information.

This post is from PCB Design
 
 
 

6

Posts

1

Resources
18
 
If the temperature requirement is not high, the voltage value can be collected and calculated according to the formula; if the requirement is high, it needs to be calibrated.
This post is from PCB Design
 
 
 

2

Posts

0

Resources
19
 

Refer to the thermistor datasheet, which has a temperature-voltage conversion/correspondence table.

Then, based on the above voltage divider resistor, the actual voltage value is obtained proportionally.

This post is from PCB Design
 
 
 

6069

Posts

4

Resources
20
 

Thermistor is generally ADC + table lookup

This post is from PCB Design
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list