Skip to Content

Reading temperature with a PT100 sensor and an industrial PLC

How a PT100 works, 2, 3 and 4 wire probes, transmitter wiring and code
July 19, 2024 by
Reading temperature with a PT100 sensor and an industrial PLC
Boot & Work Corp. S.L, Bernat Brunet Pedra

How to read a PT100 with a PLC: a PT100 is a platinum RTD with 100 Ω at 0 °C that gains about 0.385 Ω per °C. A PLC analog input cannot measure that resistance directly, so connect the probe to a PT100 transmitter that converts it to 0-10 V or 4-20 mA. Then read the analog input and scale it linearly over the range of the transmitter: with a -50 to 100 °C transmitter and a 0-10 V input, temperature = 15 × voltage - 50.

This guide covers how a PT100 works, the difference between 2-wire, 3-wire and 4-wire probes, how to wire a head-mounted transmitter to an Industrial Shields PLC, and the code to convert the analog reading to °C.

What you need

Raspberry PLC industrial controller, one of the Industrial Shields PLCs with 0-10 V analog inputs
24 Vdc DIN rail power supply for the PLC and the PT100 transmitter
Head-mounted PT100 transmitter with 0-10 V output
  • An Industrial Shields PLC with a 0-10 V analog input: Arduino based PLC (M-Duino, Ardbox), ESP32 PLC or Raspberry PLC
  • A 24 Vdc power supply for the PLC and the transmitter
  • A PT100 probe (2-wire, 3-wire or 4-wire)
  • A PT100 transmitter with 0-10 V output. In this guide: 24 Vdc supply, range -50 to 100 °C, accuracy 0.2 % of full scale, as printed on its label

How does a PT100 sensor work?

A PT100 is a resistance temperature detector (RTD). Inside there is a platinum element whose resistance rises with temperature. "PT" stands for platinum and "100" for its resistance at 0 °C: 100 Ω. The standard curve of IEC 60751 gives a mean slope of 0.00385 Ω/Ω/°C between 0 and 100 °C, about 0.385 Ω per °C.

The curve is close to linear but not exactly linear. IEC 60751 describes it with the Callendar-Van Dusen equation. These values come from that equation:

TemperaturePT100 resistance
-50 °C80.31 Ω
0 °C100.00 Ω
25 °C109.73 Ω
50 °C119.40 Ω
100 °C138.51 Ω
150 °C157.33 Ω
200 °C175.86 Ω

A PT1000 works the same way with 1000 Ω at 0 °C. Its larger change per degree makes the lead wire resistance less important, but the transmitter must be made for PT1000.

2-wire, 3-wire and 4-wire PT100: which one to use

The wires between the probe and the transmitter add their own resistance, and the transmitter reads it as temperature. One ohm of extra resistance is about 2.6 °C of error. For example, 10 m of 0.5 mm² copper cable has about 0.69 Ω in the loop of a 2-wire probe, close to 1.8 °C of error.

TypeHow it handles the lead resistanceTypical use
2-wireNot compensated. The lead resistance adds to the readingShort cables, or when an error of about one degree is acceptable
3-wireThe third wire lets the transmitter subtract the lead resistance, if the three wires are equalThe usual choice in industrial plants
4-wireTwo wires carry the current and two measure the voltage, so the lead resistance does not countLaboratory, calibration and the highest accuracy

The probe also has its own tolerance class. According to IEC 60751, class B allows ±(0.3 + 0.005 × |t|) °C and class A ±(0.15 + 0.002 × |t|) °C, so at 100 °C a class B probe can read up to ±0.8 °C off.

From resistance to an analog signal: the PT100 transmitter

The analog inputs of the PLC measure 0-10 V, not resistance. A PT100 transmitter feeds a small current through the probe, measures the voltage across it and gives an output proportional to the temperature over its range. The transmitter in this guide is a head-mounted unit with 24 Vdc supply, PT100 input, range -50 to 100 °C and 0-10 V output.

PT100 transmitter label: Pt100 input, 24 VDC supply, 0-10 V output, range -50 to 100 °C, 0.2 % FS
Head-mounted PT100 transmitter: 24 Vdc supply, -50 to 100 °C range, 0-10 V output, 0.2 % FS.

Other ranges and outputs exist, for example 0 to 300 °C, or a 4-20 mA output. A 4-20 mA loop is better for long cables and noisy plants. To read it with a 0-10 V input, see how to convert a 4-20 mA signal to 0-10 V in an Arduino PLC.

Wiring the PT100 and the transmitter to the PLC

3-wire PT100 probe wired to the transmitter: two red wires and one white wire on the probe terminals, 24 Vdc supply and 0-10 V output cable
Wiring of a 3-wire PT100: 24 Vdc on the two top terminals, 0-10 V output to the PLC, and the probe on the bottom terminals.
  1. Supply. Connect 24 Vdc to the two top terminals of the transmitter, + and -.
  2. Output. Connect the 0-10 V output terminal to an analog input of the PLC, here I0.7, and connect the 0 V of the transmitter supply to the GND of the PLC.
  3. Probe. Connect the PT100 to the terminals under the resistor symbol. In a 3-wire probe, the two wires of the same colour (red in this probe) go to the same end of the element; connect them to the paired terminals, and the single wire (white) to the other one. For a 2-wire probe, bridge the paired terminals. Follow the drawing of your own transmitter.

Check the probe before you power on. Measure the probe with a multimeter between the single wire and one of the paired wires: at about 20 °C it must read near 108 Ω. Between the two paired wires it must read almost 0 Ω.

Convert the analog reading to temperature

The analog inputs of the Industrial Shields PLCs measure 0-10 V, with a different resolution in each family. The datasheets give these values:

PLC familyResolutionMaximum count°C per count with a 150 °C range
M-Duino and Ardbox10 bit10230.15 °C
ESP32 PLC11 bit20470.07 °C
Raspberry PLC12 bit40950.04 °C

The transmitter output is linear over its range, so two steps give the temperature:

voltage     = raw × 10 / maximum count
temperature = (T_max - T_min) / 10 × voltage + T_min

For -50 to 100 °C, (100 - (-50)) / 10 = 15 °C per volt, so temperature = 15 × voltage - 50. For example, 5 V gives 25 °C.

This sketch reads I0.7 once per second without blocking the loop and prints the raw value, the voltage and the temperature:

// PT100 transmitter -50 to 100 C, output 0-10 V, on analog input I0.7
// ADC_MAX: M-Duino and Ardbox 1023 (10 bit), ESP32 PLC 2047 (11 bit), Raspberry PLC 4095 (12 bit)
const float ADC_MAX = 1023.0;
const float V_MAX = 10.0;      // full scale of the PLC input, V
const float T_MIN = -50.0;     // transmitter range, C
const float T_MAX = 100.0;
const unsigned long PERIOD = 1000;  // ms between readings
unsigned long lastRead = 0;

void setup() {
  Serial.begin(115200);
  pinMode(I0_7, INPUT);
}

void loop() {
  unsigned long now = millis();
  if (now - lastRead >= PERIOD) {
    lastRead = now;
    int raw = analogRead(I0_7);
    float volt = raw * V_MAX / ADC_MAX;
    float temp = (T_MAX - T_MIN) / V_MAX * volt + T_MIN;  // 15 C per volt for -50 to 100 C
    Serial.print("Raw: ");
    Serial.print(raw);
    Serial.print("  Voltage: ");
    Serial.print(volt, 2);
    Serial.print(" V  Temperature: ");
    Serial.print(temp, 1);
    Serial.println(" C");
  }
}

We compiled it for the M-Duino 21+ with avr-gcc and the Industrial Shields AVR board package 1.2.1, without errors or warnings. We did not run it with a probe for this edition. For an ESP32 PLC, set ADC_MAX to 2047, as the first version of this post did. For another transmitter range, change T_MIN and T_MAX.

Troubleshooting a PT100 reading

SymptomWhat to check
The reading is a few degrees high with a 2-wire probeLead resistance. Use a 3-wire probe, shorter or thicker cable, or subtract a fixed offset measured at a known temperature.
The value jumps by several countsNoise on the 0-10 V line. Keep the signal cable away from power cables, use shielded cable grounded at one end, and average several readings.
The reading stays at the top or bottom of the rangeBroken or short-circuited probe, or the probe on the wrong terminals. Measure the probe resistance.
The temperature is always off by the same factorWrong maximum count for your PLC family, or wrong range in the code.

Temperature sensors on a PLC, in working code. The PLC Solution Library has an example that reads 4-20 mA pressure and temperature transmitters on an ESP32 PLC. To see temperature sensors read over Modbus RTU and TCP, read the Modbus temperature network case study.

See the 4-20 mA sensors exampleRead the case study

FAQ about PT100 sensors and PLCs

Can I connect a PT100 directly to a PLC analog input?

Not to a 0-10 V or 4-20 mA input. The PT100 changes its resistance, not a voltage or a current, so you need a transmitter or an RTD input module in between.

What is the resistance of a PT100 at 0 °C and at 100 °C?

100.00 Ω at 0 °C and 138.51 Ω at 100 °C, according to the IEC 60751 curve.

2-wire or 3-wire PT100?

Use 3-wire for most industrial installations. It compensates the resistance of the cable if the three wires are equal. A 2-wire probe is fine only with short cables or when an error of about one degree is acceptable.

0-10 V or 4-20 mA transmitter?

0-10 V is simpler to read with the analog inputs of the Industrial Shields PLCs. 4-20 mA resists noise better on long cables and shows a broken loop as 0 mA.

Why is the formula linear if the PT100 curve is not?

Because the transmitter gives an output proportional to the temperature over its range. The PLC only scales the voltage. If you measure the resistance yourself, use the Callendar-Van Dusen equation.

​Search in our Blog

Reading temperature with a PT100 sensor and an industrial PLC
Boot & Work Corp. S.L, Bernat Brunet Pedra July 19, 2024
Share this post
Tags

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.

PLC Comparison