RTD PT100 solved almost

Status
Not open for further replies.
Joined
Apr 8, 2012
Messages
201
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
0
RTD PT100 and other measurements. The PT100 negative temperature measurement is giving a 4-7 degree C variance for the range (-200 - 0 degree C). I don't know why RA1/AN1 is not working. (you can check by shorting RA0 and RA1). RA1 is not giving any measurement values. You have to replace 2.5 V Battery by 5V Vin - 2.5V Vout type Precision voltage regulator/reference
 

Attachments

  • pic18f4523_1v_2lm35_2pt100.rar
    90.6 KB · Views: 390
Last edited:

Hi,

Just out of interest, why a PT100 sensor ? What are you measuring that needs such a vast temp range ?

Seems a lot of additional hardware and program code to give an accurate result.

Then you go the the LM35, again a linear device.

Did you ever consider the DS18B20 or SHT11 sensors, both digital and a temp ranges of over -40c to +120c.
The Ds18b20 having the advantage it will work on very long cables.
 
I did that project for someone else. He said that he was going to use 2 PT100's to measure temperatures of boiling water and oil.
I am not sure wheather I can use DS18B20 or SHT11 with boiling oil. I could have used DS18B20 instead of LM35 but he said he wanted LM35 only.
 

Your post is missing any information for detail help with your questions.

Regarding voltage references, you'll possibly remember my previous comment that Pt100 measurment is essentially ratiometric and doesn't need a stable voltage reference, if Pt100 circuit and ADC are using the same reference voltage. Apparently, you didn't yet think about the point.

I am not sure wheather I can use DS18B20 or SHT11 with boiling oil.
You can't.
 
No, I didn't get a 2.5V reference component in isis. So, I've used battery. I will try to use a potential divider to divide the +5V to 2 x 2.5V for op amp reference.

---------- Post added at 03:32 ---------- Previous post was at 03:24 ----------

I did the interpolation this way......... for negative temperatures.

Ref http://en.wikipedia.org/wiki/Linear_interpolation

Code:
[syntax = c]

//Negative Temperatures (-200 degree C to 0 degree C)
           if (pt100_r1 < 100.00) {
              /*
              x = r = 72.33
              xo = ro = 18.52
              x1 = r1 = 100
              y= t = ?
              y0 = t0 = -200
              y1 = t1 = 0
              t = t0 + ((r-r0)t1 - (r-ro)t0) / (r1-r0)
              */
              r = pt100_r1;
              r0 = 18.52;
              r1 = 98.44;
              t0 = -200.00;
              t1 = 0.0;
              t = t0 + ((r-r0)*t1 - (r-r0)*t0) / (r1-r0);
              pt100_t1 = t;
           }

[/syntax]

but it is giving 5-7 degree C variance.


and there was a typo in the code... It was not displaying AN1 channel. Now I've fixed it.
 

Attachments

  • pic18f4523_1v_2lm35_2pt100_fixed.rar
    90.7 KB · Views: 259
Last edited:

It's a linear interpolation, not accurate enough for the large temperature range. You should use a polynomial or a multi-point linear interpolation.
 

You have read the Analog Devices AN. They suggested a polynomial for the negative temperature range, supplementing the "direct methode" for positive temperatures. There can be no doubt about the principle correctness of this solution, it's just a matter of implementation in your code.

Table interpolation methods are probably better in terms of code execution time.
 
You are right FvM. There was a mistake in my calculation. The equation for negative pt100 temperature measurement works fine.
 

The equation for negative pt100 temperature measurement works fine.
can you please share the program am also working on the same.
 

Hi,
If we want to take values in F fahrenheit so what should be the changes
Thanks
 

Use Celcius to Fahrenheit conversion formula you learnt in Physics. If you don't remember then google for it.

Anyways. Here is the formula.

°C x 9/5 + 32 = °F
 
Last edited:

tried that. not working. showing wrong data.
Code:
void Display_Temp(void)
{
  ch = (tlong / 1000) % 10;
   //Lcd_Out(1,3,"Tmp");
  Lcd_Chr(row,position,48+ch);          // Write result in ASCII format
  ch = (tlong / 100) % 10;
  Lcd_Chr_Cp(48+ch);          // Write result in ASCII format
  ch = (tlong / 10) % 10;
  Lcd_Chr_Cp(48+ch);          // Write result in ASCII format
  Lcd_Chr_CP('.');
  ch = (tlong ) % 10;     // Extract hundreds of millivolts
  Lcd_Chr_CP(48+ch);           // Write result in ASCII format
  Lcd_Chr_CP('/');
  Delay_ms(100);
}
/*******************************************************************************/
/****************************  Get_Temp   **********************************/
/*******************************************************************************/
 void Get_Temp(void)
 {
  ADCON0 = 0x01;// select channel 0
  for(i=0;i<5;i++)
  {
   adc_rd0 = ADC_Read(0);
   sample[i] = adc_rd0;
   Delay_ms(50);
  }
  average = 0;
  for(i=0;i<5;i++)
  {
   average += sample[i];
  }
  average/=5;

  Temp = (float)average*1.00/1024.00;// using 1V ref.
  Temp = Temp/1.4; // found that PT100 changes voltage of 1.4mV/C with a voltage divider with 1K.
  Lcd_Out(1,1,"TEMP<");
  Lcd_Chr_Cp(223);
  Lcd_Out(1,7,"C>");
  tlong = Temp*1000;
  row = 1;
  position = 9;
  Display_Temp();
 }
 

Calculation is not clear to me. Can anyone explain the calculation? Is Op-Amp need to use to amplify the voltage?
Which calculation for which circuit?
 

Where is you circuit? Zip and post your project files. It will save time to create a new project and test the code. Give as much details as you can regarding your adc and pt100 circuit. You are using a simple adc calculation which will not work. Where have you implemented the RTD PTC100 equation for temperature measurement? You have to use a constant current source and PT100's resistance vary depending upon temperature. You find resistance first and use it in the equation to calculate temperature.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…