1
\$\begingroup\$

I'm working on an embedded system project using an STM32 microcontroller, and I need help calculating the resistance of an NTC thermistor from a specific circuit design. My background is in software programming, so I'm not as familiar with electrical engineering concepts. Here's the setup:

LD-TMP! is the voltage read by the ADC of the MCU, which is configured with 12-bit resolution and reference voltage 3.3V.

This thermistor has a resistance table with Beta value of 3450 and resistance at 25 degrees as 10K.

NTC circuit portion

LD connector

I have some equations but I'm unsure if I'm applying them correctly. Any help or guidance on how to calculate the thermistor resistance from the ADC reading would be greatly appreciated.

Thank you!

\$\endgroup\$

4 Answers 4

0
\$\begingroup\$

You should provide the part number for the Thermistor.

First you should measure the resistance of your thermistor. Notice that it's forming a voltage divider of 5V where the high side is a fixed 10k.

Here's the characteristic equation for voltage dividers: voltage divider equation

You can re-arrange it so that the unknown resistor is alone on one side of the equation. More info on this can be found on wikipedia.

https://en.wikipedia.org/wiki/Voltage_divider

The best next step is to look up the value in a lookup table provided by the resistor manufacturer. If you want to be really fancy, maybe even interpolate between the 2 closest values.

You can use the beta constant and other resistor specs to calculate the temperature but it will be less accurate. This is the equation:

1/T = 1/T0 + 1/B * ln(R/R0)

The variable T is the ambient temperature in Kelvin, T0 is usually room temperature, also in Kelvin (25°C = 298.15K), B is the beta constant, R is the thermistor resistance at the ambient temperature (same as Rt above), and R0 is the thermistor resistance at temperature T0. The values for T0, B, and R0 can be found in the manufacturer's data sheet.

Source

\$\endgroup\$
4
  • \$\begingroup\$ I don't have the part number, just the look up table. Yes, I wanted to use that equation but I'm having a hard time figuring out the R. I can convert the ADC reading back to voltage, but now how to calculate the R is beyond my electrical knowledge. \$\endgroup\$
    – Arieh
    Commented Aug 4 at 20:01
  • \$\begingroup\$ @Arieh Sorry, I assumed you knew how to do that. Added info. It's easy. \$\endgroup\$
    – Drew
    Commented Aug 5 at 13:09
  • \$\begingroup\$ Looking back at your question. It's not clear exactly where the thermistor is in the circuit. Can you draw a simplified circuit with only the thermistor, adc and the connected passives (pull ups, pull downs, caps, etc)? \$\endgroup\$
    – Drew
    Commented Aug 5 at 13:45
  • \$\begingroup\$ The thermistor is inside a Laser Diode, that is connected to the PCB with an 8 pin connector (LD connector in the second picture). This LDNTC signal only appears in these 2 places on the pictures. The Laser Diode itself is a black box for me, I don't know its internal circuit. \$\endgroup\$
    – Arieh
    Commented Aug 6 at 17:40
1
\$\begingroup\$

That looks like a somewhat silly connection scheme, but anyway, if my interpretation is as below:

schematic

simulate this circuit – Schematic created using CircuitLab

Then \$ R_T(V_{ADC}) = \frac{R49(R45 + R47)}{ R47\cdot(Vs/V_{ADC})- (R45 + R47 + R49)}\$

That's what I get, check it with a simulator.

With the values given, the maximum output possible is about 2.38V with the sensor open (Rt=∞). Note that (in the form given) the equation blows up for Vadc = 0, since that corresponds to a shorted sensor (Rt=0Ω).

This connection scheme uses a 5V source for excitation but measures with a 3.3V reference that is most likely uncorrelated, thus either source changing relative to the other will cause error. That error will be worse at low temperatures. It's also throwing away at at least 28% of the resolution and probably quite a bit more. I suggest evaluating the number of bits per degree near the top and bottom end of your useful range to ensure that the resolution is acceptable for the application, both functionally and aesthetically (say if the number is to be displayed digitally).

\$\endgroup\$
0
\$\begingroup\$

Basically you need to come up with an expression for the voltage divider sampled at the STM32, consisting of the NTC which is unknown or dependent on temperature. That is one equation. Then you get another equation with the voltage that is sampled by the STM32. These two you set equal and isolate the NTC resistance. This number is then used in one of these equation for a thermistor and the temperature can be found.

\$\endgroup\$
0
\$\begingroup\$

I assume you have the following equivalent circuit.

schematic

simulate this circuit – Schematic created using CircuitLab

Beta parameter equation is: $$ Rt = Ro \; e^{B\; ({1 \over T} - {1 \over To})} $$

Voltage divider equation for the above configuration is: $$ Vt = {{V \; Rt}\over {R1+Rt}} = {V \over {R1 \over Rt} + 1} $$

Substituting Rt in to the above equation and a bit of manipulation: $$ {V \over Vt} = {R1 \over {Ro \; e^{B\; ({1 \over T} - {1 \over To})}}}+1 $$

With a bit of algebra: $$ T = {{B \; To} \over {B+{To \; ln \left(R1 \; {Vt \over {Ro\;(V-Vt)}} \right)} }} $$

Where:
\$ T \$ = thermistor temperature in degrees Kelvin
\$ To \$ = reference temperature in degrees Kelvin
\$ B \$ = beta coefficient
\$ Rt \$ = thermistor resistance at temperature \$ T \$
\$ Ro \$ = reference resistance at \$ To \$
\$ R1 \$ = fixed resistor, see above schematic

It would be wise to check the above equation manipulations.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.