This week i decided to give a look at resistance temperature detectors (RTDs) which are sensors used to measure temperature. The main advantages over thermocouples are higher accuracy and repeatability. The sensor i'm going to use is a standard PT100 that measure 100 ohm at 0° C, the more the temperature increase the more the resistance increase.
The resistance value can be converted to degree using the following linear formula:
Rt = Ro*(1+alpha*T)
The Atmega328p ADC have a 10 bits resolution that mean, given 5V voltage reference, an accuracy of 4.88 mV ( 5000 mV / 1023 ).
If we read the PT100 using a voltage divider with another 100 ohm resistor the output voltage at 0° will be 2,5V and the output at 400° ( 249,56 ohm ) will be around 3.5 V so in the range [ 0 - 400 ] C° the voltage span is 1000 mV.
This way we use only 20% of the ADC scale and the resolution we can read is really poor: 400 / ( 1023 / 5 ) = 2 C° .
To increase the resolution we have to create a conditioning circuit.
The optimal scenario is to have an output of 0V at 0° C and 5V at 400° C meaning 400 / 1023 = 0,39° C accuracy; way better than the 2°C we had before.
The first step is to convert resistance change into a voltage change. We have to options:
To balance the bridge at 0° C R4 have to be 100 ohm and i calculated R1 = R2 so that the max current flowing to the sensor is < 3mA.
I = Voltage Ref / ( R1 + Rt ) worst case when Rt is at the min temp ( 0°C -> 100 ohm ).
I = 5v / ( R1 + 100 ) => 1566 ohm very close to the standard 1.49k ohm.
So R1 = R2 = 1.49k ohm.
To check if everything was working as expected i simulated the circuit with National Instruments Multisim. I emulated the PT100 using a 300 ohm potentiometer, when the pot is at 33% ( 100 ohm ) i get a voltage output of 5mV ( close enough to 0 ) and when the pot is at 100% ( 300 ohm ) i get 528mV.
NOTE: 300 ohm = 500°C more than i need.
Now i’ve got my voltage starting from 0 and going up to 500mV around 450 degree. I need to amplify this range to fit the full 328p ADC scale of 0-5 V. The gain i need to have is around 10x.
Since the signal i have is measured across the two bridge outputs and not from a terminal to ground i can't use a normal non inverting op-amp but i have to use a differential op-amp.
If R1 = R2 and Rf = Rg the differential op-amp gain can be calculated with the following formula:
Vout = Rf / R1 * ( V2 - V1 )
So to have a gain of 10x i chose Rf and Rg to be 10k ohm and R1 and R2 1k ohm.
Next i simulated the circuit using the rail-to-rail AD8605 op-amp, we have in the FabLabs inventory list, and the resistors calculated above.
AD8605 Datasheet
As you can see the range now goes from 50mV to 4.73V.
I used eagle to create the schematic and route the traces. I added a power led.
I milled the board using a Roland SRM-20; 1/64 end mill to isolate the traces and 1/32 end mill to cut the holes and the outline.
After i soldered the board, it was very challenging because i had to use the ancient method of the “series pyramid resistors”. :D ( in our lab we dont have the 1.47k ohm resistors so i used 1k + 500 ohm. )
Next i powered the board using a stabilized power supply, setted at 5.00V i connected the PT100 sensor and measured the voltage output using the voltmeter.
The output at 23° C ( ambient temp ) was around 70mV and using an air gun i heated the sensor around 200° C reading an output of 2.3V. The board looks like it’s working but to use it with a microcontroller it have to be calibrated using fixed temps like a container with melting ice for the 0°C and boiling water for the 100°C.