Reading Temperature From PT100 Using Arduino
Reading Temperature From PT100 Using Arduino
by Roboro
The PT100 is a resistance temperature detector(RTD) accurate and have low drift over time. What I'm going
which changes its resistance depending on its to show you in this Instructable wouldn't be up to
surrounding temperature, it's used widely for industrial standard but it'll expose you to an alternate
industrial processes with slow dynamics and way to measure temperature than using the LM35
relatively wide temperature ranges. It's used for slow which a lot of hobbyists would be familiar with and the
dynamic processes because RTDs have slow circuit theory shown can be applied to other sensors.
response times (which I talk more about later) but are
1x 5kohms Potentiometer same as above but if there's a pair of resistors i.e. the
3.9Kohms, if you swapped them for let's say 5k, you'd
1x Two Terminal Power Supply or 8x 1.5V AA need to swap both for 5k as then need to be the
Batteries same. When we get the circuit I'll say the effect of
choosing different values. For the operation amplifiers
I'm using a two wire PT100, three and four wire (op amps) you can use other op amps but these are
PT100s will have different circuits. The resistor the ones I used.
values for most of these don't have to be the exact
the circuit is just the gains multiplied together. Let's say we keep Ra, Rb and Rc as 8.2k, 47k and
3.9k, we just need to find the value for the pot Rgain:
This is the last step of the circuit, you might have THE GNDs OF THE TWO SUPPLIES ARE
noticed the Vcc+ and the Vcc- on the op amp circuits, SEPARATED OR IT'LL DAMAGE YOUR POWER
this is because they need both positive and negative SUPPLY. All commercial power supplies would have
voltage to function properly, you can get single rail separated GNDs but if you want to check, use the
op-amps but I decided to use these amp as that's continuity tester on your multimeter, if it buzzes, don't
what I had lying around. So we'll supply +6V and -6V, use this setup and use the next one. On my
there're three ways we can do this. The first is shown homemade supply, I blew the fuse doing this.
in the first picture where we have to two power
supplies or two output terminals from a single power In the second picture is the second setup we can
supply, have both at 6V and have one positive output have, it does require one supply to have double the
connected to the negative of the other. The 6V of the voltage of other but won't damage the supply if the
top supply will be our +6V, the positive of the bottom GNDs are connected. We have two supplies, one at
supply is the GND and the negative of the bottom 12V and other at 6V. The 12V will act as our +6V, the
supply is the -6V. ONLY CONNECT IT LIKE THIS IF 6V out of the second supply will act as the GND and
the two actual GNDs out of the supplies will act as - If you want to use batteries, I'd suggest the first setup
6V. but a problem with batteries is that the voltage will
drop as they start to die and the voltage out of the
This last setup is for the power supplies with only one bridge will drop as well, giving wrong temperature
output, it uses a buffer amplifier of gain 1 to create a readings. You could of course read the voltage from
virtual ground by passing half the supply voltage the batteries and include them in the calculations or
through the buffer amp. Then the 12V will act as the use regulators and more batteries. In the end, it's up
+6V and the actual GND terminal will be -6V. to you.
The full circuit is shown above and it was made in Autodesk's new Circuits.io which lets you created circuits on
breadboard, edit circuit diagram(shown in picture 2) and PCB diagrams and the best part, lets you simulate the
circuit from the breadboard and can even program an Arduino and connect it in the breadboard mode, further down
the page is the simulation and you can play around with two pots. If you want to duplicate the circuit and put in
your own values, you can find the circuit here. The first pot is 70ohms and in series with an 80ohm resistor which
simulates the PT100 with a range of 80-150ohms, the second pot is the gain of the instrumentation amp. Sadly I
used a library I downloaded for my code, so the Arduino isn't included in the circuit below but the there's only two
extra wires you need to connect. If you are more comfortable with LTspice, I included an asc file with the circuit.
Connect the GND of the Arduino to the GND of the circuit(NOT THE -6V)
And that's the circuit done, now onto the code. Earlier I mentioned that we'll be using the formula y=mx+c, well
now we're going to calculate m(the slope) and c(the offset). In the Arduino, we'll be reading voltage but the
temperature equation needs us to know the resistance of the PT100 so a way we can do this is by replacing the
Serial.println(temp) with Serial.println(V) and record the voltage and resistance at two temperatures. When doing
The first point we can take is room temperature, when you have the circuit connected and working, record the
voltage(Vt1) read by the Arduino on the serial monitor and quickly disconnect the PT100 and record its
resistance(Rt1), do not put your hands on the probe when disconnecting as this will change the resistance. For the
second temperature, we could place the probe in ice water or hot water(be careful if using hot water) and repeat
what we did before finding Vt2 and Rt2. Just after you place the probe in the liquid wait a minute or two for the
resistance to settle. If you're interested in the time response of the PT100, record the voltage off of the serial
monitor every 2 seconds or so and we can draw a graph from this and I'll explain it later. Using the two voltages
and resistances, we can calculate the slope as follows:
Rt1 and Rt2 are the resistances at the two temperatures and same it true for the voltages Vt1 and Vt2. From the
slope and one of the two sets of points you recorded we can calculate the offset:
C should be close to your real Roff, From my simulation I calculated these values:
From this resistance we can find our temperature using the formula we had at the start:
And that's it, the code for the Arduino is below, if you have any problems, just leave a comment and I'll try to help.
There are no pictures of the circuit I made as I made it a while ago and don't have the PT100 anymore to remake
and test but you'll just have to believe me that it works. There isn't much about the PT100 on Instructables that I
found so that's why I made this ible.
In the next step I'll be talking about the time response of the PT100 and if you're not interested in the maths, when
you're measuring a temperature change, let the PT100 settle for a minute or so before taking the reading.
Blog: Roboroblog
If the HTML messes with the code below, the code is attached
// Define Variables
float V;
float temp;
float Rx;
void loop() {
t.update(); // Update Timer
}
void takeReading(){
// Bits to Voltage
V = (analogRead(Vin)/1023.0)*5.0; // (bits/2^n-1)*Vmax
// Voltage to resistance
Rx = V*slope+C; //y=mx+c
// Resistance to Temperature
temp= (Rx/R0-1.0)/alpha; // from Rx = R0(1+alpha*X)
// Uncommect to convet celsius to fehrenheit
// temp = temp*1.8+32;
Serial.println(temp);
}
Download
https://www.instructables.com/ORIG/FDA/UORS/IUKEO4GC/FDAUORSIUKEO4GC.ino
…
So I mentioned that the PT100 has a slow response a step in temperature so we're going to have to
but we can get a formula for the current temperature perform an inverse Laplace transform of a step into
read by the PT100 at any time t. The response of the the system. The transfer function of a first-order
PT100 is a first order response which in can be system with an input of a step is as follows:
written in Laplace terms i.e. transfer function, as:
Would you use a PT100 for measuring temperature of a piece of copper being submerged from
0ºC to -196ºC in liquid nitrogen? Would i have a quick response there?
Yes you could use a pt100 but the response will be relatively slow, the pt100 I used would take
around 40s to settle at the new temperature
using LM324 ?
Yes a LM324 will work as well
Very good.
Cesario
Hello. Do have the schematic for pt100 4-wire(two pairs)?
Roboro : How about measuring temperature from pt100 3 wire using arduino? could you share the
schematic circuit?
Hi King Le, sorry about the delay, you can keep nearly everything the same, you just need to
connect you wheatstone bridge and PT100 like below. Also refer to the second picture in step 2
perfect documentation
Thanks