Im trying to use my PT100 with an Arduino-based PLC from Industrial Shields, which is basically an Arduino Mega encased in a plastic container. Im using a 250Ω resistor, actually 237Ω resistor between Analog and Ground.
The pt100 range is -200 to 600C & the transmitter according to NFC scanner is -200 to 600C as well.
Here is my code:
int sensorValue = 0;
int temperature = 0;
int ReceivedByte = 0;
float f1 = 0;
float t1 = 0;
void setup() {
Serial.begin(9600);
Serial.println("hi...");
//analogReference(INTERNAL2V56);
}
void loop() {
delay(1000);
sensorValue = analogRead(A2);
Serial.println(sensorValue);
/**
current voltage(250 Ohm) ADC Temperature
-----------------------------------------------------
4 mA 1 V 205 -50 C
20 mA 5 V 1023 +150 C
*
*/
//original 5V adc values from weber 194,971
//SO-weber new values 10 bit ADC 97,485
//204-1023 for 10V ADC with 2x237Ω
// map the signals (using 194-971 for 5V and 97-485 for 10V)
// to get decimal values, because map() doesn't work with floats)
// V = 0.004A x 237Ω = 0.948V => 1024 x (0.948/5) = 194.5 lower bound
// V = 0.020A x 237Ω = 4.74V => 1024 x (4.74/5) = 970.7 upper bound
temperature=map(sensorValue,194,971,-200,600);
f1 = temperature; // Float conversion
Serial.print(f1);
Serial.print("\n");
}
I was also told to try 500Ω (237×2=474Ω) with the full values of 10V (due to the datasheets from IS) instead of 5V but that doesn't pan out either as can seen in the results table below. I tried:
A- 5V full value & 237Ω
B- 10V full value& 237Ω
C- 10V full value& 474Ω
I've tried all the wiring options available with my 3 wire pt100.
So Im wondering about 2 possibilities:
1. Which is the correct wiring configuration, because I want to eliminate that variable.
- Could it be Industrial Shields datasheets are incorrect? I just checked the actual plc box and it reads "Analog 0-10VDC" so I dont think IS datasheet is incorrect.
UPDATING RESULTS:
What I dont like about room temp measurements is that its obviously off because it is no 10C in my office, its 22C with a thermometer. But more importantly that it is wildly erratic, ranging from 0C to 12C at times. An average of 100 measurements yields about 10C. I just stuck it in a cup of coffee and the digital thermometer reads 61C and the 100-average of the pt100 reads 58C, so thats encouraging. But individual readings range as low as 47C so its still erratic.
Thanks
Best Answer
Turns out the transmitter wasn't programmed. It needs to be programmed in order for the readings to work.