xref: /freebsd-src/sys/contrib/device-tree/Bindings/iio/afe/temperature-sense-rtd.yaml (revision c9ccf3a32da427475985b85d7df023ccfb138c27)
1*c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*c9ccf3a3SEmmanuel Vadot%YAML 1.2
3*c9ccf3a3SEmmanuel Vadot---
4*c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/afe/temperature-sense-rtd.yaml#
5*c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*c9ccf3a3SEmmanuel Vadot
7*c9ccf3a3SEmmanuel Vadottitle: Temperature Sense RTD
8*c9ccf3a3SEmmanuel Vadot
9*c9ccf3a3SEmmanuel Vadotmaintainers:
10*c9ccf3a3SEmmanuel Vadot  - Liam Beguin <liambeguin@gmail.com>
11*c9ccf3a3SEmmanuel Vadot
12*c9ccf3a3SEmmanuel Vadotdescription: |
13*c9ccf3a3SEmmanuel Vadot  RTDs (Resistance Temperature Detectors) are a kind of temperature sensors
14*c9ccf3a3SEmmanuel Vadot  used to get a linear voltage to temperature reading within a give range
15*c9ccf3a3SEmmanuel Vadot  (usually 0 to 100 degrees Celsius).
16*c9ccf3a3SEmmanuel Vadot
17*c9ccf3a3SEmmanuel Vadot  When an io-channel measures the output voltage across an RTD such as a
18*c9ccf3a3SEmmanuel Vadot  PT1000, the interesting measurement is almost always the corresponding
19*c9ccf3a3SEmmanuel Vadot  temperature, not the voltage output. This binding describes such a circuit.
20*c9ccf3a3SEmmanuel Vadot
21*c9ccf3a3SEmmanuel Vadot  The general transfer function here is (using SI units)
22*c9ccf3a3SEmmanuel Vadot
23*c9ccf3a3SEmmanuel Vadot    V = R(T) * iexc
24*c9ccf3a3SEmmanuel Vadot    R(T) = r0 * (1 + alpha * T)
25*c9ccf3a3SEmmanuel Vadot    T = 1 / (alpha * r0 * iexc) * (V - r0 * iexc)
26*c9ccf3a3SEmmanuel Vadot
27*c9ccf3a3SEmmanuel Vadot  The following circuit matches what's in the examples section.
28*c9ccf3a3SEmmanuel Vadot
29*c9ccf3a3SEmmanuel Vadot           5V0
30*c9ccf3a3SEmmanuel Vadot          -----
31*c9ccf3a3SEmmanuel Vadot            |
32*c9ccf3a3SEmmanuel Vadot        +---+----+
33*c9ccf3a3SEmmanuel Vadot        |  R 5k  |
34*c9ccf3a3SEmmanuel Vadot        +---+----+
35*c9ccf3a3SEmmanuel Vadot            |
36*c9ccf3a3SEmmanuel Vadot            V 1mA
37*c9ccf3a3SEmmanuel Vadot            |
38*c9ccf3a3SEmmanuel Vadot            +---- Vout
39*c9ccf3a3SEmmanuel Vadot            |
40*c9ccf3a3SEmmanuel Vadot        +---+----+
41*c9ccf3a3SEmmanuel Vadot        | PT1000 |
42*c9ccf3a3SEmmanuel Vadot        +---+----+
43*c9ccf3a3SEmmanuel Vadot            |
44*c9ccf3a3SEmmanuel Vadot          -----
45*c9ccf3a3SEmmanuel Vadot           GND
46*c9ccf3a3SEmmanuel Vadot
47*c9ccf3a3SEmmanuel Vadotproperties:
48*c9ccf3a3SEmmanuel Vadot  compatible:
49*c9ccf3a3SEmmanuel Vadot    const: temperature-sense-rtd
50*c9ccf3a3SEmmanuel Vadot
51*c9ccf3a3SEmmanuel Vadot  io-channels:
52*c9ccf3a3SEmmanuel Vadot    maxItems: 1
53*c9ccf3a3SEmmanuel Vadot    description: |
54*c9ccf3a3SEmmanuel Vadot      Channel node of a voltage io-channel.
55*c9ccf3a3SEmmanuel Vadot
56*c9ccf3a3SEmmanuel Vadot  '#io-channel-cells':
57*c9ccf3a3SEmmanuel Vadot    const: 0
58*c9ccf3a3SEmmanuel Vadot
59*c9ccf3a3SEmmanuel Vadot  excitation-current-microamp:
60*c9ccf3a3SEmmanuel Vadot    description: The current fed through the RTD sensor.
61*c9ccf3a3SEmmanuel Vadot
62*c9ccf3a3SEmmanuel Vadot  alpha-ppm-per-celsius:
63*c9ccf3a3SEmmanuel Vadot    description: |
64*c9ccf3a3SEmmanuel Vadot      alpha can also be expressed in micro-ohms per ohm Celsius. It's a linear
65*c9ccf3a3SEmmanuel Vadot      approximation of the resistance versus temperature relationship
66*c9ccf3a3SEmmanuel Vadot      between 0 and 100 degrees Celsius.
67*c9ccf3a3SEmmanuel Vadot
68*c9ccf3a3SEmmanuel Vadot      alpha = (R_100 - R_0) / (100 * R_0)
69*c9ccf3a3SEmmanuel Vadot
70*c9ccf3a3SEmmanuel Vadot      Where, R_100 is the resistance of the sensor at 100 degrees Celsius, and
71*c9ccf3a3SEmmanuel Vadot      R_0 (or r-naught-ohms) is the resistance of the sensor at 0 degrees
72*c9ccf3a3SEmmanuel Vadot      Celsius.
73*c9ccf3a3SEmmanuel Vadot
74*c9ccf3a3SEmmanuel Vadot      Pure platinum has an alpha of 3925. Industry standards such as IEC60751
75*c9ccf3a3SEmmanuel Vadot      and ASTM E-1137 specify an alpha of 3850.
76*c9ccf3a3SEmmanuel Vadot
77*c9ccf3a3SEmmanuel Vadot  r-naught-ohms:
78*c9ccf3a3SEmmanuel Vadot    description: |
79*c9ccf3a3SEmmanuel Vadot      Resistance of the sensor at 0 degrees Celsius.
80*c9ccf3a3SEmmanuel Vadot      Common values are 100 for PT100, 500 for PT500, and 1000 for PT1000
81*c9ccf3a3SEmmanuel Vadot
82*c9ccf3a3SEmmanuel VadotadditionalProperties: false
83*c9ccf3a3SEmmanuel Vadotrequired:
84*c9ccf3a3SEmmanuel Vadot  - compatible
85*c9ccf3a3SEmmanuel Vadot  - io-channels
86*c9ccf3a3SEmmanuel Vadot  - excitation-current-microamp
87*c9ccf3a3SEmmanuel Vadot  - alpha-ppm-per-celsius
88*c9ccf3a3SEmmanuel Vadot  - r-naught-ohms
89*c9ccf3a3SEmmanuel Vadot
90*c9ccf3a3SEmmanuel Vadotexamples:
91*c9ccf3a3SEmmanuel Vadot  - |
92*c9ccf3a3SEmmanuel Vadot    pt1000_1: temperature-sensor0 {
93*c9ccf3a3SEmmanuel Vadot        compatible = "temperature-sense-rtd";
94*c9ccf3a3SEmmanuel Vadot        #io-channel-cells = <0>;
95*c9ccf3a3SEmmanuel Vadot        io-channels = <&temp_adc1 0>;
96*c9ccf3a3SEmmanuel Vadot
97*c9ccf3a3SEmmanuel Vadot        excitation-current-microamp = <1000>; /* i = U/R = 5 / 5000 */
98*c9ccf3a3SEmmanuel Vadot        alpha-ppm-per-celsius = <3908>;
99*c9ccf3a3SEmmanuel Vadot        r-naught-ohms = <1000>;
100*c9ccf3a3SEmmanuel Vadot    };
101*c9ccf3a3SEmmanuel Vadot...
102