The Thermistor APIs provide a set of functions to read the temperature from a thermistor. The thermistor stores the relevant information (from the datasheet) such as the B value, the nominal resistance, circuit configuration (upper or lower part of the voltage divider), the fixed resistor value, and the supply voltage.
It uses these data to compute the measured resistance of the thermistor, from which the temperature can then be calculated using the Steinhart-Hart equation. See the Wikipedia article for more information.
Using the Steinhart-Hart equation, the temperature can be calculated using the following formula:
Math
T = \frac{1}{\frac{1}{T_0} + \frac{1}{B} \\ln \frac{R}{R_0}}
where:
Note: the thermistor
component assumes that the thermistor is used within a
voltage divider circuit, with a fixed resistor. The component can be configured
so that either the thermistor or the fixed resistor is the upper part of the
voltage divider.
The example shows how to use the thermistor
component to compute
the temperature from a temperature sensitive resistor (thermistor) -
specifically negative temperature coefficient (NTC) thermistors.
idf.py add-dependency "espp/thermistor^1.0.4"