pt100 = rage !

hey guys

hopefully somone here can help me out, i come to you defeated mostly haha !

I started developing a 6 channel thermo logger, that logs 6 values and a datestamp to SD card, while also sending the values over serial to live graph (real time monitoring check it out it rocks), so anyway after a while of playing around i got it all working, was pretty happy with myself, considering this was my first major project I starting with K-type thermal sensors an then decided on an RTD as i had seen some good results from thoose chips (no CJCs involved etc) in my initial development i used the Thermistor2 tutorials:

http://www.arduino.cc/playground/ComponentLib/Thermistor2

and i was using a bunch of crappy ceramic 3% 1k thermistor, all was well (1k pad resistor used)

so as i moved my development on I purchased some thin film pt100's (-50c -> 200c), im only concerned with -50c -> 150c, I'm happy to accept 0.19c steps (200/1024)

I had to get pretty deep into IEC 751 / DIN A to get a resistance table/check accuracy and work out my values for the Steinhart-Hart ABC values (seriously o_O hart-hart .. har har)

once i plucked them in things were going ok, however my returned value in C is 48-50 degrees C

so after all that hard work .. Failure, i checked the calculation and the reading im getting should be accurate

i sense it is a result of self-heating, as currently my circuit is basically a voltage divder with a pad resistor of 100 ohm

I am at a loss on how i should proceed i know the answer wont be to complex however my brain has shut down the new idea factory and searching pt100 input circuit on the ole google returns few to no results, my project seemed so close to completion but is now so very far away :frowning:

5V               100 ohm               Signal Wire        PT 100            0V

[ + ] ---------- [VVVV] -----------------[A0]-------------[VV/VV] -------- [ - ]

float pad = 100;                       // balance/pad resistor value

float Thermistor(int RawADC) {
  long Resistance;  
  float Temp;  // Dual-Purpose variable to save space.

  Resistance=((1024 * pad / RawADC) - pad); 
  Temp = log(Resistance); // Saving the Log(resistance) so not to calculate  it 4 times later
  Temp = 1 / (3.8529E-02 + (-9.6409E-03 * Temp) + (9.7575E-05 * Temp * Temp * Temp));  // SH-H Values Calculated from -10c, 10c & 30c
  Temp = Temp - 273.15;  // Convert Kelvin to Celsius                      
  return Temp;                                      // Return the Temperature
}

hopefully somone with a different insight/knowledge can help me out !

help me arduino-uno-kenobi's your my only hope

Luke

I think your calculation of resistance is wrong. I make it:

Resistance = (rawADC * pad)/(1023 - rawADC);

If self-heating is an issue, you can reduce it by about half by connecting the 100 ohm resistors to +3.3v instead of +5v and connecting the ADC reference to 3.3v also (be sure to call analogReference before you make your first analogRead call, see the reference).

Thanks DC !

will try it out !

before i set the aref i just want to confirm

link 3.3v rail direct to the ref rail ? (dont need to switch the adc between two i dont think anyway haha !)

yes, but then you MUST make the appropriate call to analogReference to set the reference to external (to disconnect AREF from +5v internally) before you make any analogRead calls. Otherwise you'll be shorting +5v and +3.3v together.

You can connect them via a resistor instead, but then the reference won't be quite 3.3v. See analogReference() - Arduino Reference.

i tried the calculation, it seemed to give me some crazy -40 reading :confused:

however i did implement your 1023 rather than 1024 i had written !

do i need to connect in a resistor ?

Alternatively, you can connect the external reference voltage to the AREF pin through a 5K resistor, allowing you to switch between external and internal reference voltages.

my reading of that is i only need to connect the resistor if i want to switch the ref back and forth from 5v to 3.3v within my project , i am only concerned with establishing AREF Once

  1. I just noticed: 1023pad (your calc) and rawADCpad (my calc) will both overflow an int, so you need to convert to long, unsigned long or float e.g.:

float Resistance;

Resistance = ((float)rawADC * (float)pad)/(1023 - rawADC);

  1. You are right about not needing the resistor if you always want the reference to be 3.3v.

dc42:

  1. I just noticed: 1023pad (your calc) and rawADCpad (my calc) will both overflow an int, so you need to convert to long, unsigned long or float e.g.:

float Resistance;

Resistance = ((float)rawADC * (float)pad)/(1023 - rawADC);

  1. You are right about not needing the resistor if you always want the reference to be 3.3v.

The Calc as before still ends up returning a temp of -40+c

also perhaps a little gremlin in what ive coded ?

analogReference(EXTERNAL);

returns:

Temp_Logger_V3:16: error: expected constructor, destructor, or type conversion before '(' token

Re the calc, you might like to print the value of Resistance it gives, and compare it with the value you measure on a multimeter.

Re the analogReference call, did you put this at the start of setup(), or somewhere else?

A pt100 sensor is normally used in a full bridge circuit rather than a half bridge the way you are using it. Also, with a 100 Ohm series resistance, you will get more error from self-heating than is normally considered acceptable with a pt100. As long as you are all right with that, everything is fine. If you are looking for the precision one normally uses a Pt RTD for though, you might want to reconsider. On the other hand, the ADC in the Arduino is likely to be the largest source of error in your design. And 1024 was correct as opposed to 1023. The largest voltage you can measure with a particular Vref is (Vref - 1 LSB).