# NTC Temperature Sensor (`ntcSensor`)

> A thermistor that reads the temperature of a thermal net as a resistance, by the Steinhart-Hart or the B equation.

![ntcSensor](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/ntcSensor.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/meters/ntcSensor/)

**Group:** Meters · **Kind:** `{"kind":"ntcSensor"}`

## When to use it

Use it to measure a heatsink, a winding or a module baseplate through a divider into an ADC or a comparator, for over-temperature protection or derating. Use NTC Thermistor for inrush limiting.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `p` | electrical | One terminal |
| `n` | electrical | The other terminal |

## Common parameters

- `r25`: Resistance at 25 °C (Default: 10k)
- `law`: Resistance law: steinhartHart (a1 to d1) or beta (b only) (Default: steinhartHart)
- `b`: B value: how fast the resistance falls with temperature (Default: 3977)
- `thermal`: Thermal net for its heat and temperature; replaces delta and cth (Default: optional (off))

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `r25` | Ω | 10k |  | Resistance at 25 °C |
| `law` | — | steinhartHart |  | Resistance law: steinhartHart (a1 to d1) or beta (b only) |
| `b` | K | 3977 |  | B value: how fast the resistance falls with temperature |
| `a1` | 1/K | 3.354016m |  | Steinhart–Hart a1: 1/T at R = r25 |
| `b1` | 1/K | 256.985u |  | Steinhart–Hart b1: coefficient of ln(R/r25) |
| `c1` | 1/K | 2.620131u |  | Steinhart–Hart c1: coefficient of ln²(R/r25) |
| `d1` | 1/K | 63.83091n |  | Steinhart–Hart d1: coefficient of ln³(R/r25) |
| `delta` | W/K | 7m |  | Dissipation factor: heat it loses per kelvin above its surroundings |
| `cth` | J/K | 0.105 |  | Heat capacity |
| `ta` | °C | 25 |  | Temperature of its surroundings |
| `thermal` | — | optional (off) |  | Thermal net for its heat and temperature; replaces delta and cth |

_Parameter descriptions are in English in both languages._

**Use for:** Heatsink temperature · Over-temperature protection · Derating inputs

**Not for:** Inrush limiting → [`ntc`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/passive/ntc/)

## Formulas

| Formula | Equation | Source |
|---|---|---|
| Resistance by the B equation | R = r25·exp(b·(1/(T + 273.15) − 1/298.15)) | IEC 60539-1:2016, B value |
| Divider output, NTC to ground | Vout = Vref·R/(R + Rfix) | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 3 (voltage division) |
| Self-heating error | ΔT = P/delta = Vout²/(R·delta) | IEC 60539-1:2016, dissipation factor |

## Quick check

Inputs:

- `r25`: Resistance at 25 °C = 10k Ω, `r25`
- `b`: B value = 3.977k K, `b`
- `delta`: Dissipation factor = 7m W/K, `delta`
- `tb`: Measured temperature = 85 °C
- `rfix`: Divider resistor = 10k Ω
- `vref`: Divider supply = 3.3 V

Outputs:

- `rt`: Resistance at tb = `r25*exp(b*(1/(tb + 273.15) - 1/298.15))` Ω
- `vout`: Divider output = `vref*rt/(rt + rfix)` V
- `dt`: Self-heating error = `vout^2/rt/delta` K

## Model logic

- With law steinhartHart the resistance solves 1/T = a1 + b1·x + c1·x² + d1·x³ for x = ln(R/r25), by Newton's method inside a bracket; with law beta it is r25·exp(b·(1/T - 1/298.15 K)).
- With thermal set, T is the temperature of that thermal net and its own small heat flows into it.
- Without it, T starts at ta and after each accepted step moves toward ta + P/delta with the time constant cth/delta.
- Each step uses the resistance at the temperature reached at the end of the last step.

## Model

With law steinhartHart the resistance R solves 1/T = a1 + b1 * x + c1 * x² + d1 * x³ with x = ln(R / r25) and T in kelvin (the classic three-term equation is r25 = 1 Ohm, c1 = 0). With law beta it follows R = r25 * exp(b * (1/T - 1/298.15 K)). With thermal set, T is the temperature of that thermal net and its own small heat flows into it. With no thermal net, its temperature rises with its power over cth and falls toward ta with the dissipation factor delta, and is the waveform T(name). T is updated after each step.

## Common mistakes

- Its own power heats it: delta is 7 mW/K, so 1 mW in the divider reads about 0.14 K high. Keep the divider current small.
- Without a thermal net it reads only its own body temperature, which stays at ta. Set thermal to the net of the part it measures.

## Datasheet and sources

Take r25 and b (B25/85) from the ordering table. The Steinhart-Hart coefficients a1 to d1 come from the table of parameters for the nominal resistance values, in the row of your B value. delta is the dissipation factor and cth is the thermal time constant times delta. The defaults are the Vishay NTCLE100E3103 (10 kOhm, B25/85 = 3977 K), data sheet 29049 of 07-May-2025, pages 1, 2 and 4.

## Example

Open the example with the command `file.openExample` and the name `demo:ntcSensor`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
