如何使用 UliEngineering 在 Python 中计算热敏电阻阻值

你可以使用 UliEngineering Python 库轻松计算热敏电阻在给定温度下的阻值:

thermistor_resistance.py
from UliEngineering.Electronics.Thermistors import thermistor_resistance
from UliEngineering.EngineerIO import *

# 计算 50°C 时的阻值(参考值 10kΩ @ 25°C,B=3950)
resistance = thermistor_resistance("10k", 25.0, 50.0, 3950)
print(f"50°C 时的阻值:{format_value(resistance, 'Ω')}")

# 计算 0°C 时的阻值(参考值 10kΩ @ 25°C,B=3950)
resistance = thermistor_resistance("10k", 25.0, 0.0, 3950)
print(f"0°C 时的阻值:{format_value(resistance, 'Ω')}")

示例输出

thermistor_resistance_output.txt
Resistance at 50°C: 3.60 kΩ
Resistance at 0°C: 32.6 kΩ

该计算确定 NTC 热敏电阻在特定温度下的预期阻值。这对于传感器校准、电路设计以及预测热敏电阻在温度传感应用中的行为至关重要。该计算使用 B 参数模型,在有限的温度范围内具有良好的精度。

阻值使用以下公式计算:$R = R_0 \cdot e^{B(\frac{1}{T} - \frac{1}{T_0})}$,其中 $R$ 是温度 $T$(以开尔文为单位)下的阻值,$R_0$ 是参考温度 $T_0$(以开尔文为单位)下的参考阻值,$B$ 是以开尔文为单位的 B 值。对于 NTC 热敏电阻,阻值随温度升高而降低。

相关文章


Check out similar posts by category: Electronics, Python