Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PT100 and ATMEGA (nonlinearities)

Status
Not open for further replies.

waqas_here

Junior Member level 2
Joined
Jan 20, 2008
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,463
PT100 and ATMEGA

Guyz i have been asked to develop a temperature controller using PT100 and ATMEGA8515. So far i have developed a constant current source of 10mA and will read analog voltage using Internal ADC of micro controller. After reading voltage i can have current resistance of PT100 using R=V/I (as I is constant). But on the basis of this resistance how can i predict or calculate the temperature as PT100 doesn't seem to have a linear response. Do i have to implement whole of PT100 chart or is there any other way of doing this. In case i dun have any other option than tell me how to implement that whole chart in ATMEGA.

Thanks in anticipation.
 

Re: PT100 and ATMEGA

Using a look-up table is always an option but it takes (in some cases) a heck of a lot of memory ..
Table is at:
https://www.thermocouple.co.uk/TD_TV_PT1A.pdf

But, there is a solution that seems to compensate the PT100 non-linearity ..
It is described in the Maxim application note at:
**broken link removed**
Have a look at it and don't worry about this specific opamp used by Maxim in this circuit ..
You can use any other (similar) opamp and because of strong feedbacks the result should be identical ..

Rgds,
IanP
 
PT100 and ATMEGA

One more thing other than what Ianp has replied. Reduce your current to 1mA or less. 10mA is very high it will cause the PT100 to heat up i.e. it will take up SELF-HEATING, & your results will be very incorrect.
 

Re: PT100 and ATMEGA

10mA is very high it will cause the PT100 to heat up.
It depends on. It's no problem with a Pt100 mounted with good thermal conductivity to a heater block, but a problem e.g. with
an air thermometer. I would also use 1 - 2 mA.

I also think, that a ratiometric circuit, as used in the above Maxim application, is better suited for an ADC with a supply voltage
reference. The accuracy only depends on resistance ratios in this case. Using an OP scaling amplifier has the additional avantage
of utilizing the full range of a low resolution 10 bit ADC.

Instead of an analog compensation of Pt characteristic, a polynomial approximation can be used. It doesn't need a
lot of memory, but some arithmetic effort. It's pretty easy with float and a bit tricky with fixed point, but feasible though.
The equivalent to the shown circuit would be a 2nd order (quadratic) polynomial. For wide range Pt100 and thermocouple
characteristics, a higher order is recommended. Polynomial fitting is a feature e.g. of spreadsheet calculators as MS Excel.
 

Re: PT100 and ATMEGA

Basically i was interested to know how can i implement PT100 table in programming. I m programming in C using Codevision AVR. How can i do this. Give me an idea
 

PT100 and ATMEGA

A very basic solution would map each 10 bit ADC coding to a 16 bit temperature value, unfortunately requiring 2 kB of Flash memory.
A more sophisticate solution uses a limited number of table points and interpolates the intermediate values with a straight line (it's a
kind of rule of three calculus).
 

Re: PT100 and ATMEGA

Dear FVM 2kB of flash isn't a huge cost for me as i dun have so many tasks to b taken from controller. The problem is how can i make table in C and how to access its values assuming i have calculated current resistance by taking voltage and applying ohms law. How will my controller calculate what's gonna be temperature for particular resistance value. Currently only idea that is generated in my mind is to use hundreds of IF >= and <= conditions to accomplish it. Is there any easy way of doing this.
 

Re: PT100 and ATMEGA

If you use look-up tables controller does not calculate anything ..
It just takes the value of resistance (in hex), adds it to the address of the table (where the relevant temperature value are stored, for example, each temperature occupies 4 bytes – 00h, 00h, 00h, 00h => 000.0, 00h;; 00h, 00h, 01h = > 000.1;; - etc.) and reads (using equivalent od DATA POINTER) 4 consecutive memory locations for temperature display ..
That’s it ..

Rgds,
IanP

PS. In the look-up table, instead of having decimal values you can implement directly (if required) ASCII values, for example: 30h, 30h, 30h, 31h – that’s equivalent (in ASCII) of 000.1 ..
 

PT100 and ATMEGA

According to what's been said about limited memory space, having a table of decimal or ASCII values isn't an option, I think.

Nothing has been said however about temperature range, resolution and accuracy. So all suggestion must stay general.
It's useless to suggest e.g. particular number formats up to now.

I mentioned a look-up table containing a limited number of points, e.g. with a 10 or 20 °C spacing. An interpolation routine
calculating temperature from resistance first searches the table entry below the actual measurement. This is preferably done
by a for loop rather than a chain of if statements. Then the actual temperature is calculated from actual resistance by assuming a
straight line between two table points. You may want to use paper and pencil to visualize possible calculation methods.

As I previously mentioned, a polynomial approximation of the Pt100 characteristics usually involves less effort to
achieve the intended result.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top