UNO give wrong resistance read for pt100

Hi there,

I am trying to use Arduino UNO to measure the temperature using Pt100. So far I developed the ReadAnalogVoltage program to calculate the resistance. The program works fine for usual resistances. I tried it with 10K Ohm,it read 9912 Ohm and with 20K Ohm it read 19938 Ohm, but when it comes to Pt100 it gives 58 ohm :astonished:. Here is the program I use (the circuit is described within). Can you please help me figure out what is wrong? Thanks

/*
  resistance_ino
  Reads an analog input from the pt100 circuit on pin 0, converts it to voltage and then calculate the resistance, and prints the result to the serial monitor.
  Attach one pin of pt100 to a 20k Ohm resistance and attach both to pin A0, attach the other pin of pt100 to ground and the other pin of the resistor to +5V.

 This example code is developed from ReadAnalogVoltage by Amel S. A. Alhassan a.alhassan@aims.edu.gh.
 */

    // defining the source voltage
  const int involtage = 5;
   // defining the external resistance
  const int exresistance = 20000;


// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {

    // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  double voltage = sensorValue * (5.0 / 1023.0);
  // calcuate the resistance of pt100
  float resistance = (voltage * exresistance) / (involtage - voltage); 
  // print out the value you read:
  Serial.println(resistance);
}

Somebody succeeded with this about six months ago. You might be able to trawl it up.

RTDs are usually used with amnplifiers

http://openenergymonitor.org/emon/node/75

What does the resistance of the PT100 measure with a DMM? Also with the PT100 in circuit, measure the voltage at A0 with DMM, if you are down to less than 1volt, and I think you will, then you will not have the resolution to get accurate reading. Use ohms law and do some basic cals on paper to see what voltage readings you will be getting. You only have 5/1023= 4mV resolution from the AtoD converter. I have commented on this situation in another thread, voltage divider solution unfortunately doesn't give the required resolution. Search PT100 in the forum search box. Tom

Thank you guys :)

In the code: "Attach one pin of pt100 to a 20k Ohm resistance..."

100ohm:20,000ohm is not really going to work. The PT is only a fraction of the fraction.

Don't know what temp range you're after. Try a 470ohm pullup resistor to 3.3volt and the PT100 to ground. And read the A/D value with 1.1volt Aref enabled. https://www.arduino.cc/en/Reference/AnalogReference One degree readout should be possible now. Leo..