## Accuracy of Temperature measurement {#accuracy-of-temperature-measurement}
### Accuracy of the resistance measurement {#accuracy-of-the-resistance-measurement}
#### Resistor measurement principle and associated errors {#resistor-measurement-principle-and-associated-errors}
Measurement is typically performed using a [wheatstone bridge]({{< relref "wheatstone_bridge.md" >}}), and the accuracy depends on:
- the quality of the ADC measuring the voltage in the bridge
- the values of the resistors in the bridge
For measuring ranges from \\(200\\,\Omega\\) to \\(5\\,k\Omega\\), the measurement accuracy can be in the order of +/-50ppm to +/-100ppm (here based on the [ELM3704](https://www.beckhoff.com/en-en/products/i-o/ethercat-terminals/elmxxxx-measurement-technology/elm3704-0001.html)).
For a Pt100 at \\(0^oC\\), this corresponds to an accuracy of \\(< \pm0.04\\,K\\).
#### 2, 3 and 4 wires sensors {#2-3-and-4-wires-sensors}
The measured resistance is the sum of the resistance of the sensitive element and the resistance of the wires.
This corresponds to the 2-wire measurement ([Figure 1](#figure--fig:temperature-sensor-rtd-2-wires)).
The errors associated with this effect are large when the resistance of the sensitive element is small and then the resistance of all cables and connectors are large.
For instance, the effect of contact/wire resistance less important for the PT1000 than for the PT100.
The use of 2 wire PT1000 is possible (whereas for PT100, 4 wire is more accurate).
The effect of the resistance of the wires (cables, connectors, etc..) can be mitigated by using the 4-wire configuration ([Figure 2](#figure--fig:temperature-sensor-rtd-4-wires)).
{{<figuresrc="/ox-hugo/temperature_sensor_pt100_resistance.png"caption="<span class=\"figure-number\">Figure 3: </span>Resistance of a PT100 as a function of the temperature">}}
The coefficient of resistance \\(\alpha\\) is defined as the ratio of the rate of change of resistance with temperature to the resistance of the thermistor at a specified temperature:
{{<figuresrc="/ox-hugo/temperature_sensor_pt100_sensitivity.png"caption="<span class=\"figure-number\">Figure 4: </span>Sensitivity of a PT100 as a function of the temperature">}}
### NTC {#ntc}
A NTC is much more non-linear than a PT100 as shown in [Figure 5](#figure--fig:temperature-sensor-rtd-resistance).
The NTC used here is "Type F" from Amphenol Thermometrics.
{{<figuresrc="/ox-hugo/temperature_sensor_rtd_resistance.png"caption="<span class=\"figure-number\">Figure 5: </span>Resistance of a RTD as a function of the temperature">}}
The huge advantage of RTD compared to PT100 is that the sensitivity is much larger than Pt100 as shown in [Figure 6](#figure--fig:temperature-sensor-rtd-sensitivity).
{{<figuresrc="/ox-hugo/temperature_sensor_rtd_sensitivity.png"caption="<span class=\"figure-number\">Figure 6: </span>Sensitivity of a RTD as a function of the temperature">}}
{{<figuresrc="/ox-hugo/temperature_sensor_pt100_curve.png"caption="<span class=\"figure-number\">Figure 7: </span>Resistance as a function of the temperature for a Pt100">}}
The error is less than 0.1mK over the full range, validating the use of a lookup table to convert the resistance to temperature ([Figure 9](#figure--fig:temperature-sensor-lut-errors)).
where \\(T\\) is the temperature in kelvins, \\(R\_{25}\\) the nominal resistance at \\(25^oC\\), \\(A\\), \\(B\\), \\(C\\) and \\(D\\) are coefficients which are specific for a given thermistor.
Typically, coefficients A, B, C and D are varying with temperature as shown in [Table 2](#table--tab:temperature-sensor-ntc-coefs).
{{<figuresrc="/ox-hugo/temperature_sensor_ntc_curve.png"caption="<span class=\"figure-number\">Figure 8: </span>Resistance as a function of the temperature for a given NTC">}}
T_meas_linear = interp1(R_lut_linear,T_lut_linear,R_true,interp_method); % interpolate the resistance using the LUT to find the corresponding temperature
T_meas_makima = interp1(R_lut_makima,T_lut_makima,R_true,interp_method); % interpolate the resistance using the LUT to find the corresponding temperature
{{<figuresrc="/ox-hugo/temperature_sensor_lut_errors.png"caption="<span class=\"figure-number\">Figure 9: </span>Interpolation errors in two cases when using a LUT for a Pt100">}}
NTC thermistors are more non-linear and therefore require finer LUT to have low accuracy errors.
In order to have less than 0.1mK of accuracy, a LUT with linear interpolation requires approximately one point every 0.1 degree ([Figure 10](#figure--fig:temperature-sensor-lut-errors-ntc)).
```matlab
%% "Perfect" temperature and resistance of NTC (DC95F202VN)
T_meas_linear = interp1(R_lut_linear,T_lut_linear,R_true,interp_method); % interpolate the resistance using the LUT to find the corresponding temperature
T_meas_makima = interp1(R_lut_makima,T_lut_makima,R_true,interp_method); % interpolate the resistance using the LUT to find the corresponding temperature
{{<figuresrc="/ox-hugo/temperature_sensor_lut_errors_ntc.png"caption="<span class=\"figure-number\">Figure 10: </span>Interpolation errors in two cases when using a LUT for a NTC">}}
From (<ahref="#citeproc_bib_item_2">Neto et al. 2022</a>), UHV compatible:
> **Ceramic Amphenol DC95F202WN negative temperature coefficient (NTC)** sensors were used above 270 K, usually at room temperature components equal to 297 K.
> The part-though-hole (PTH) sensors were soldered to thin, 30 AWG, varnish insulated copper wires with small amounts of tin-lead (70/30) alloy.
From (<ahref="#citeproc_bib_item_2">Neto et al. 2022</a>)
> The temperature sensors also had design iteration since the beginning of the commissioning of the first cryogenic beamline instrumentation.Initially, **10k Ohm (0°C nominal) Platinum thin-film RTD sensors from IST (P10K.520.6W.B.010.D)** were used for parts in operating temperature below 123 K, whereas ceramic Amphenol DC95F202WN negative temperature coefficient (NTC) sensors were used above 270 K, usually at room temperature components equal to 297 K. The part-though-hole (PTH) sensors were soldered to thin, 30 AWG, varnish insulated copper wires with small amounts of tin-lead (70/30) alloy.
> The set was then encapsulated with the same Stycast resin into small aluminium cases for thermal conductivity and mounting features.
>
> [...]
>
> Furthermore, the thin platinum wire of the 10 kΩ RTDs presented bad solderability and its assembly process was too laborious, resulting in unreliable mechanical bonds and a failure rate beyond acceptable for a robust beamline instrumentation.
> The alternative was to use **2 kΩ IST RTDs (P2K0.232.3FW.B.007)** with custom-made flat gold-platted terminals, resulting in a full range sensor with better solderability and temperature **resolution below 0.4 mK** over the entire measurable range
<divclass="csl-entry"><aid="citeproc_bib_item_1"></a>Ebrahimi-Darkhaneh, Hadi. 2019. “Measurement Error Caused by Self-Heating in Ntc and Ptc Thermistors.” <i>Tex. Instrum. Analog. Des. J. Q</i> 3: 001–7.</div>
<divclass="csl-entry"><aid="citeproc_bib_item_2"></a>Neto, Joao Brito, Renan Geraldes, Francesco Lena, Marcelo Moraes, Antonio Piccino Neto, Marlon Saveri Silva, and Lucas Volpe. 2022. “Temperature Control for Beamline Precision Systems of Sirius/Lnls.” <i>Proceedings of the 18th International Conference on Accelerator and Large Experimental Physics Control Systems</i> ICALEPCS2021 (nil): China. doi:<ahref="https://doi.org/10.18429/JACOW-ICALEPCS2021-WEPV001">10.18429/JACOW-ICALEPCS2021-WEPV001</a>.</div>