18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 28cc087a1SEmmanuel Vadot--- 38cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/hwmon/ntc-thermistor.yaml# 48cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 58cc087a1SEmmanuel Vadot 68cc087a1SEmmanuel Vadottitle: NTC thermistor temperature sensors 78cc087a1SEmmanuel Vadot 88cc087a1SEmmanuel Vadotmaintainers: 98cc087a1SEmmanuel Vadot - Linus Walleij <linus.walleij@linaro.org> 108cc087a1SEmmanuel Vadot 118cc087a1SEmmanuel Vadotdescription: | 128cc087a1SEmmanuel Vadot Thermistors with negative temperature coefficient (NTC) are resistors that 138cc087a1SEmmanuel Vadot vary in resistance in an often non-linear way in relation to temperature. 148cc087a1SEmmanuel Vadot The negative temperature coefficient means that the resistance decreases 158cc087a1SEmmanuel Vadot as the temperature rises. Since the relationship between resistance and 168cc087a1SEmmanuel Vadot temperature is non-linear, software drivers most often need to use a look 178cc087a1SEmmanuel Vadot up table and interpolation to get from resistance to temperature. 188cc087a1SEmmanuel Vadot 198cc087a1SEmmanuel Vadot When used in practice, a thermistor is often connected between ground, a 208cc087a1SEmmanuel Vadot pull-up resistor or/and a pull-down resistor and a fixed voltage like this: 218cc087a1SEmmanuel Vadot 228cc087a1SEmmanuel Vadot + e.g. 5V = pull-up voltage (puv) 238cc087a1SEmmanuel Vadot | 248cc087a1SEmmanuel Vadot +-+ 258cc087a1SEmmanuel Vadot | | 268cc087a1SEmmanuel Vadot | | Pull-up resistor 278cc087a1SEmmanuel Vadot | | (puo) 288cc087a1SEmmanuel Vadot +-+ 298cc087a1SEmmanuel Vadot |-------------------------o 308cc087a1SEmmanuel Vadot +-+ | ^ 318cc087a1SEmmanuel Vadot | |/ | 328cc087a1SEmmanuel Vadot | / | 338cc087a1SEmmanuel Vadot |/| Thermistor | Measured voltage (mv) 348cc087a1SEmmanuel Vadot / | | "connected ground" 358cc087a1SEmmanuel Vadot /| | | 368cc087a1SEmmanuel Vadot +-+ | 378cc087a1SEmmanuel Vadot |-------------------------o 388cc087a1SEmmanuel Vadot +-+ ^ 398cc087a1SEmmanuel Vadot | | | 408cc087a1SEmmanuel Vadot | | Pull-down resistor | Measured voltage (mv) 418cc087a1SEmmanuel Vadot | | (pdo) | "connected positive" 428cc087a1SEmmanuel Vadot +-+ | 438cc087a1SEmmanuel Vadot | | 448cc087a1SEmmanuel Vadot | v 458cc087a1SEmmanuel Vadot + GND GND 468cc087a1SEmmanuel Vadot 478cc087a1SEmmanuel Vadot The arrangements of where we measure the voltage over the thermistor are 488cc087a1SEmmanuel Vadot called "connected ground" and "connected positive" and shall be understood as 498cc087a1SEmmanuel Vadot the cases when either pull-up or pull-down resistance is zero. 508cc087a1SEmmanuel Vadot 518cc087a1SEmmanuel Vadot If the pull-up resistance is 0 one end of the thermistor is connected to the 528cc087a1SEmmanuel Vadot positive voltage and we get the thermistor on top of a pull-down resistor 538cc087a1SEmmanuel Vadot and we take the measure between the thermistor and the pull-down resistor. 548cc087a1SEmmanuel Vadot 558cc087a1SEmmanuel Vadot Conversely if the pull-down resistance is zero, one end of the thermistor is 568cc087a1SEmmanuel Vadot connected to ground and we get the thermistor under the pull-up resistor 578cc087a1SEmmanuel Vadot and we take the measure between the pull-up resistor and the thermistor. 588cc087a1SEmmanuel Vadot 598cc087a1SEmmanuel Vadot We can use both pull-up and pull-down resistors at the same time, and then 608cc087a1SEmmanuel Vadot the figure illustrates where the voltage will be measured for the "connected 618cc087a1SEmmanuel Vadot ground" and "connected positive" cases. 628cc087a1SEmmanuel Vadot 638cc087a1SEmmanuel Vadotproperties: 648cc087a1SEmmanuel Vadot $nodename: 658cc087a1SEmmanuel Vadot pattern: "^thermistor(.*)?$" 668cc087a1SEmmanuel Vadot 678cc087a1SEmmanuel Vadot compatible: 688cc087a1SEmmanuel Vadot oneOf: 698cc087a1SEmmanuel Vadot - const: epcos,b57330v2103 708cc087a1SEmmanuel Vadot - const: epcos,b57891s0103 718cc087a1SEmmanuel Vadot - const: murata,ncp15wb473 728cc087a1SEmmanuel Vadot - const: murata,ncp18wb473 738cc087a1SEmmanuel Vadot - const: murata,ncp21wb473 748cc087a1SEmmanuel Vadot - const: murata,ncp03wb473 758cc087a1SEmmanuel Vadot - const: murata,ncp15wl333 768cc087a1SEmmanuel Vadot - const: murata,ncp03wf104 778cc087a1SEmmanuel Vadot - const: murata,ncp15xh103 78e67e8565SEmmanuel Vadot - const: samsung,1404-001221 798cc087a1SEmmanuel Vadot # Deprecated "ntp," compatible strings 808cc087a1SEmmanuel Vadot - const: ntc,ncp15wb473 818cc087a1SEmmanuel Vadot deprecated: true 828cc087a1SEmmanuel Vadot - const: ntc,ncp18wb473 838cc087a1SEmmanuel Vadot deprecated: true 848cc087a1SEmmanuel Vadot - const: ntc,ncp21wb473 858cc087a1SEmmanuel Vadot deprecated: true 868cc087a1SEmmanuel Vadot - const: ntc,ncp03wb473 878cc087a1SEmmanuel Vadot deprecated: true 888cc087a1SEmmanuel Vadot - const: ntc,ncp15wl333 898cc087a1SEmmanuel Vadot deprecated: true 908cc087a1SEmmanuel Vadot 918cc087a1SEmmanuel Vadot "#thermal-sensor-cells": 928cc087a1SEmmanuel Vadot description: Thermal sensor cells if used for thermal sensoring. 938cc087a1SEmmanuel Vadot const: 0 948cc087a1SEmmanuel Vadot 958cc087a1SEmmanuel Vadot pullup-uv: 968cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 978cc087a1SEmmanuel Vadot description: Pull-up voltage in micro volts. Must always be specified. 988cc087a1SEmmanuel Vadot 998cc087a1SEmmanuel Vadot pullup-ohm: 1008cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1018cc087a1SEmmanuel Vadot description: Pull-up resistance in ohms. Must always be specified, even 1028cc087a1SEmmanuel Vadot if zero. 1038cc087a1SEmmanuel Vadot 1048cc087a1SEmmanuel Vadot pulldown-ohm: 1058cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1068cc087a1SEmmanuel Vadot description: Pull-down resistance in ohms. Must always be specified, even 1078cc087a1SEmmanuel Vadot if zero. 1088cc087a1SEmmanuel Vadot 1098cc087a1SEmmanuel Vadot connected-positive: 1108cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 1118cc087a1SEmmanuel Vadot description: Indicates how the thermistor is connected in series with 1128cc087a1SEmmanuel Vadot a pull-up and/or a pull-down resistor. See the description above for 1138cc087a1SEmmanuel Vadot an illustration. If this flag is NOT specified, the thermistor is assumed 1148cc087a1SEmmanuel Vadot to be connected-ground, which usually means a pull-down resistance of 1158cc087a1SEmmanuel Vadot zero but complex arrangements are possible. 1168cc087a1SEmmanuel Vadot 1178cc087a1SEmmanuel Vadot # See /schemas/iio/adc/adc.yaml 1188cc087a1SEmmanuel Vadot io-channels: 1198cc087a1SEmmanuel Vadot maxItems: 1 1208cc087a1SEmmanuel Vadot description: IIO ADC channel to read the voltage over the resistor. Must 1218cc087a1SEmmanuel Vadot always be specified. 1228cc087a1SEmmanuel Vadot 1238cc087a1SEmmanuel Vadotrequired: 1248cc087a1SEmmanuel Vadot - compatible 1258cc087a1SEmmanuel Vadot - pullup-uv 1268cc087a1SEmmanuel Vadot - pullup-ohm 1278cc087a1SEmmanuel Vadot - pulldown-ohm 1288cc087a1SEmmanuel Vadot - io-channels 1298cc087a1SEmmanuel Vadot 1308cc087a1SEmmanuel VadotadditionalProperties: false 1318cc087a1SEmmanuel Vadot 1328cc087a1SEmmanuel Vadotexamples: 1338cc087a1SEmmanuel Vadot - | 134*cb7aa33aSEmmanuel Vadot thermistor { 1358cc087a1SEmmanuel Vadot compatible = "murata,ncp18wb473"; 1368cc087a1SEmmanuel Vadot io-channels = <&gpadc 0x06>; 1378cc087a1SEmmanuel Vadot pullup-uv = <1800000>; 1388cc087a1SEmmanuel Vadot pullup-ohm = <220000>; 1398cc087a1SEmmanuel Vadot pulldown-ohm = <0>; 1408cc087a1SEmmanuel Vadot #thermal-sensor-cells = <0>; 1418cc087a1SEmmanuel Vadot }; 142