diff --git a/content/zettels/temperature_sensors.md b/content/zettels/temperature_sensors.md index 093edee..d9e2cc8 100644 --- a/content/zettels/temperature_sensors.md +++ b/content/zettels/temperature_sensors.md @@ -189,6 +189,68 @@ The huge advantage of RTD compared to PT100 is that the sensitivity is much larg {{< figure src="/ox-hugo/temperature_sensor_rtd_sensitivity.png" caption="Figure 6: Sensitivity of a RTD as a function of the temperature" >}} +## Compute temperature from the measured resistance {#compute-temperature-from-the-measured-resistance} + + +### Pt100 and Pt1000 {#pt100-and-pt1000} + +The resistance as a function of temperature is approximated by the Callendar–Van Dusen equation: +\\[ R(T) = \begin{cases} + R\_0 (1 + A \cdot T + B \cdot T^2), & \text{for } T>0^oC \\\\ + R\_0 (1 + A\cdot T + B \cdot T^2 + C \cdot (T - 100) \cdot T^3), & \text{for } T<0^oC +\end{cases} \\] + +With \\(R\_0\\) the resistance value at 0 degrees (\\(100\\,\Omega\\) for a Pt100 and \\(1000\\,\Omega\\) for a Pt1000). + +Values for A, B, C and D are depending on the exact model. +For a TCR of 3850 ppm/K, the values are: + +- \\(A = 3.9083 \cdot 10^{-3}\ [{}^oC^{-1}]\\) +- \\(B = -5.775 \cdot 10^{-7}\ [{}^oC^{-2}]\\) +- \\(C = -4.183 \cdot 10^{-12}\ [{}^oC^{-4}]\\) + + + +```matlab +%% Pt100 +R0 = 100; % [Ohm] + +A = 3.9083e-3; +B = -5.775e-7; +C = -4.183e-12; + +T1 = -200:0; % [degC] +T2 = 0:850; % [degC] +T = [T1,T2]; % [degC] + +R = [R0*(1 + A*T1 + B*T1.^2 + C*(T1-100).*T1.^3), R0*(1 + A*T2 + B*T2.^2)]; % [Ohm] + +figure; +plot(T, R) +xlabel('Temperature [${}^oC$]'); +ylabel('Resistance [$\Omega$]') +``` + +For temperatures above 0 degrees, the temperature \\(T\\) can be easily computed from the measured resistance \\(R\\) using: +\\[ T = \frac{-A + \sqrt{A^2 - 4 B ( 1 - R/R\_0 )}}{2 B} \\] + +For temperatures below 0 degrees, the equation is harder to solve analytically, and a lookup table is more appropriate. + +```matlab +%% Compute the temperature as a function of the resistance +R_meas_1 = 18:100; +R_meas_2 = 100:390; + + +T_meas = [(-A + sqrt(A^2 - 4*B*(1 - R_meas_2/R0)))/(2*B)]; + +figure; +plot(R_meas_2, T_meas) +xlabel('Resistance [$\Omega$]') +ylabel('Temperature [${}^oC$]'); +``` + + ## Commercial Temperature Sensors {#commercial-temperature-sensors}