Hi everyone,
I use the portenta machine control for reading a PT100 sensors.
I use the same sketch of machine control library, but the value of resistance is wrong. In fact the real value is 110 ohm, instead the arduino reads 117 ohm
At what temperature? You do realise that the sensor measures temperature by varying its resistance? What are you measuring it with and how?
Hi the temperature is 26°C and so the PT100 has 100 ohm. I measure it with a tester.
Instead the arduino reads 117 ohm
#include <Arduino_MachineControl.h>
using namespace machinecontrol;
#define RREF 430.0 // For PT100
#define RNOMINAL 100.0 // temp min
void setup() {
Serial.begin(9600);
Serial.println("MAX31865 PT100 Sensor Test!");
temp_probes.rtd.begin(THREE_WIRE);
temp_probes.enableRTD();
}
void loop() {
temp_probes.selectChannel(0);
Serial.println("CHANNEL 0 SELECTED");
uint16_t rtd = temp_probes.rtd.readRTD();
float ratio = rtd;
ratio /= 32768;
// Check and print any faults
uint8_t fault = temp_probes.rtd.readFault();
if (fault) {
Serial.print("Fault 0x"); Serial.println(fault, HEX);
if (temp_probes.rtd.getHighThresholdFault(fault)) {
Serial.println("RTD High Threshold");
}
if (temp_probes.rtd.getLowThresholdFault(fault)) {
Serial.println("RTD Low Threshold");
}
if (temp_probes.rtd.getLowREFINFault(fault)) {
Serial.println("REFIN- > 0.85 x Bias");
}
if (temp_probes.rtd.getHighREFINFault(fault)) {
Serial.println("REFIN- < 0.85 x Bias - FORCE- open");
}
if (temp_probes.rtd.getLowRTDINFault(fault)) {
Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");
}
if (temp_probes.rtd.getVoltageFault(fault)) {
Serial.println("Under/Over voltage");
}
temp_probes.rtd.clearFault();
} else {
Serial.print("RTD value: "); Serial.println(rtd);
Serial.print("Ratio = "); Serial.println(ratio, 8);
Serial.print("Resistance = "); Serial.println(RREF * ratio, 8);
Serial.print("Temperature = "); Serial.println(temp_probes.rtd.readTemperature(RNOMINAL, RREF));
}
Serial.println();
delay(100);
}
And how is your Arduino measurement calibrated?
Hi,
the error is 430, insted the resistance is 400.
My five cents:
When you use a resistive measurement probe (PT100) - the resistance of the cable, connectors and connections along the line contributes.
So, from 100 Ohm to 117 Ohm means: you have 7 Ohms in wiring. Which sounds reasonable (possible): think about cable length, soldering an extension cable, flying wires used on MCU board pins.
You have to calibrate your entire system (with real cables, their length, connectors). You cannot go with PT100 datasheet - all the cables matter).
And if you get "hot wires" close to MCU they will change also resistance (and temperature).
Also, bear in mind: when you use ADC for PT100 - the accuracy of the ADC (its ADC reference) matters.
Best is really: "calibrate your final system" - do not assume PT100 datasheet values is what you get.