Searching \ for '[EE:] interfacing a temperature sensor that will f' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/sensors.htm?key=temperature
Search entire site for: 'interfacing a temperature sensor that will f'.

Exact match. Not showing close matches.
PICList Thread
'[EE:] interfacing a temperature sensor that will f'
2003\11\04@181650 by John Murray

picon face
In summary, I am looking for some help on interfacing a temperature
sensor, i.e. 0.25 inch diameter thermistor or similar, that will fit
inside a thermowell immersed in a liquid.



My background is that I have worked with computers on and off for a
hobby since 1976, and I have dabbled in electronics.  I have a very
basic understanding of electronics from the dabbling and one year of
electronics in high school.  I have some some programming over the years
in Basic, Fortran, and Visual Basic.



I am building a home brewing system for beer and am trying to automate
some of the processes.  The two main stages of brewing involve making
the wort and fermenting.  The making of the wort involves several
stainless vessels that I want to install thermowells into, and a
temperature controller will be used to control heating of water and also
regulating several circulating pumps (on/off).  The fermenting stage
involves a stainless fermenter that I want to put a thermowell into to
control the turning on and off of a refrigerator.



I bought an Invensys Ranco ETC temperature controller.  It uses a
resistive element 0.25 inches in diameter that will fit into the
thermowells.  Ranco supplies a temperature vs. resistance curve for the
sensor.  The values range above 300,000 ohms for temps below freezing,
approximately 139,000 ohms at 20 degF, 104,000 at 30 degF, 78,000 at 40
degF, 60,000 at 50 degF, 46,000 at 60 degF, 36,000 at 70 degF, 28,000 at
80 degF, all the way down to 1,500 ohms at 230 degF.  Ranco claims to be
about +/- 1 degF on accuracy.



The temp vs resistance curve is very nonlinear.  I was able to fit it
very well with a 13th order Chebeshev polynomial, and have the Excel
output in ohms per degF.  Near the lower temperature ranges I'm
interested in, the change in resistance per degF is approximately 2,500
ohms per degF - the middle range is approx. 1,000 ohms per degF, and at
the upper range, it is approx. 25-75 ohms per degF.



The Ranco controller is too simple and can't perform all that I need it
to do.  I want to build a couple of temp controllers - one for the wort
making, i.e., the hot end, and one for the fermenting, i.e., the cold
end.  I think that will make the problem easier since splitting into two
(or three) controllers will allow splitting the curve into several
pieces and make the difference in resistance smaller for the temperature
range to be controlled.  I am curious how Ranco can get their controller
to work over such a wide temp range, though.  My preference would be to
use the same logic, hardware, etc for both controllers if they could
work over the whole range.



I need help in figuring out how to read the resistances from the Ranco
sensor and convert the readings into temperatures.  I have the table and
understand at least one way to convert a resistance value into
temperatures.  What I don't understand is how to either use the A/D pins
on a PIC to read the resistance, or how to interface an external A/D
converter.  The resistance range is so large.  It seems like even a 10
bit A/D can't handle the precision necessary to distinguish between one
degF, especially at the high temp part of the curve where the difference
is 25 ohms or so per degF.  I don't know how Ranco does it, but
evidently by the fact they have many of these out in use, it must be
possible.



Help!!



Thanks,

John Murray

Houston, TX




--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\11\04@185150 by Olin Lathrop

face picon face
John Murray wrote:
> The temp vs resistance curve is very nonlinear.  I was able to fit it
> very well with a 13th order Chebeshev polynomial,

Yikes!  How accurate do you need this controller to be?  A simple 3 or 4
order polynomial won't do?  What about a plain old fashioned lookup table
with linear interpolation between the points?

> The Ranco controller is too simple and can't perform all that I need it
> to do.  I want to build a couple of temp controllers - one for the wort
> making, i.e., the hot end, and one for the fermenting, i.e., the cold
> end.

Do these need to be varied in temperature, or is each one held at a fixed
temperature?

> I need help in figuring out how to read the resistances from the Ranco
> sensor and convert the readings into temperatures.

You have a large resistance range, from 1.5Kohms to 300Kohms.  It won't be
easy translating this to an analog voltage and still maitain the
resolution you want everywhere in the range.  You could have the PIC
switch in two or three different pullup resistors to switch which part of
the range gets the best response into the A/D.  Of course your
measurements won't be any more accurate than the resistors unless you do
calibration.  Especially for a one off hobby project it makes sense to
throw in any old resistors, then calibrate one to known temperatures with
values saved in EEPROM.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\11\04@191231 by John Murray

picon face
Olin,

Thanks for the reply to my first post on this list.

It was easy for me to get the curve using a curve fitting program I have
and to write some quick code to generate the resistances for every one
degF step.  I would like the accuracy to be within +/- 1 degF.

> The Ranco controller is too simple and can't perform all that I need
it
> to do.  I want to build a couple of temp controllers - one for the
wort
> making, i.e., the hot end, and one for the fermenting, i.e., the cold
> end.

>Do these need to be varied in temperature, or is each one held at a
fixed
>temperature?

The temps will be fixed at a value for a set interval of time, and then
varied to another temperature, i.e. a step function over an hour or so
on the wort controller and over several days or weeks on the fermenter
controller.

> I need help in figuring out how to read the resistances from the
>Ranco sensor and convert the readings into temperatures.

>You have a large resistance range, from 1.5Kohms to 300Kohms.  It won't
be
>easy translating this to an analog voltage and still maitain the
>resolution you want everywhere in the range.  You could have the PIC
>switch in two or three different pullup resistors to switch which part
of
>the range gets the best response into the A/D.  Of course your
>measurements won't be any more accurate than the resistors unless you
do
>calibration.  Especially for a one off hobby project it makes sense to
>throw in any old resistors, then calibrate one to known temperatures
with
>values saved in EEPROM.

What would the circuit look like that you are suggesting?

Thanks,
John


{Original Message removed}

2003\11\04@192058 by Russell McMahon

face
flavicon
face
> In summary, I am looking for some help on interfacing a temperature
> sensor, i.e. 0.25 inch diameter thermistor or similar, that will fit
> inside a thermowell immersed in a liquid.

You could of course cheat and use google to get things like:

   http://www.alphasensors.com/appnotes.html#fig1

Even Microchip have something to say

   http://www.microchip.com/download/appnote/analog/adc/00685b.pdf



____________________________________________

OR

A quick plot in Excel suggests that the curve is a good * fit to a curve of
the form y = 1/x^2. Mt Chebyshev seems vast overkill.

*  good enough I would have thought - it crosses a pure 1/x^2 curve at 50F
and two points above and below that BUT across the probable range of
interest should be reasonably close to the square curve.

If I was doing this, unless I was committed to the sensor technology for
some independent reason, I'd look first at any of the linear current or
voltage against temperature sensors that are available. The AD590 2 terminal
sensor with 1 uA per degree K output is one such but there are many. (AD590:
Laser trimmed to +/- 0.5C calibration accuracy, +/- 0.3c linearity across
range, -55C to +150C)
This is NOT a recommendation of the AD590 - it was just the first relevant
data sheet I got to.

As far as reducing the dynamic range of the thermistor. If you used an
analog square rooting circuit (an opamp and a transistor) this would greatly
reduce the dynamic range. But I'd try very hard to cheat and use a packaged
device where someone else has done the work.

NB: There are standard tables available for imlementing thermistor
linearisation. (???Taylor curve???)



       Russell McMahon.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\11\05@071219 by Olin Lathrop

face picon face
John Murray wrote:
> The temps will be fixed at a value for a set interval of time, and then
> varied to another temperature, i.e. a step function over an hour or so
> on the wort controller and over several days or weeks on the fermenter
> controller.

Since you only need 4 different temperatures total, you could manually
determine the four A/D readings and save these in EEPROM.  This is
assuming a thermostat type on/off controller is good enough.

Simple temperature control algorithms can be quite effective.  I made a
temperature controller once for a darkroom water bath.  Every 64 power
line cycles it would compare the thermister signal to the setpoint and
either turn a relay on or off.  The relay switched in an off the shelf
immersion heater, the kind for heating cups of coffee in the cup.  A fish
tank pump kept the water circulating.

The whole setup worked remarkably well.  Once the water bath reached the
set point, I couldn't see a temperature variation anymore on the Kodak
darkroom thermometer.  I think that means the temperature was kept within
1/4 degree C.  The setpoint was set with a pot that I would adjust until
the desired temperature was reached as indicated by the thermometer.

Sometimes simple and stupid works well.

> What would the circuit look like that you are suggesting?

A voltage divider with the thermistor in the bottom leg and an known
resistance in the top leg.  The output could either go straight into an
A/D pin, or buffered by an opamp depending on impedence.  This will give
you the most resolution when the thermister value equals the fixed
resistor value.

For that reason, I was suggesting using several different fixed resistors,
with the top end of each one tied to a separate PIC output pin.  The PIC
would drive only one of these high at a time with the rest in high
impedence mode.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\11\05@090623 by John Murray

picon face
Thanks to Russell, Tony, Olin, and Mohit.  I will look at your suggestions
and try implementing them.  I may have some more questions on details as I
get into it.



John


--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\11\05@100530 by hael Rigby-Jones

picon face
{Quote hidden}

(Resent due to Outlook mangling subject again)

You say you require 1degF resolution, and you have mentioned the range of
the sensor you wish to use.  However, what range will your brewing process
typically use?  I suspect it dosen't (or at least shouldn't) get anywhere
near 20degF or 230degF.  This dynamic range obviously dicates the resolution
of your ADC.

A 13th order polynomial seems like massive overkill.  The "standard"
polynomial for curve fitting thermistors is a 3rd order poly, known as the
Steinhart-Hart equation.  Searching for this name should yield many hits.
Performing polynomials on a mathematicaly challenged micro such as the PIC
can be quite slow and is very often unnecessary.  Once you have your nicely
fitted curve, you can use it to produce a table of values, which the PIC can
use to interpolate temperature from the ADC value.  I have used this method
to get 0.1degC resolution over a 10-60degC range with no problems.

You mention that the thermistor curve is very non-linear, and also how to
convert resistance into a voltage for the ADC.  By using the thermistor as
one element of a potnential divider, the curve is significantly
straightened, and the resistance to voltage conversion is done for you.
Typicaly, you would make the fixed resistance value the same as the
thermistor value at the center of your working range, (which gives the best
linearity over this range).

One point worth noting if you wish to achieve high accuracy, is that of self
heating.  You must keep the current through the thermistor low enough that
it's power dissipation does not significantly affect it's temperature.  The
datasheet for the device will (should!) give you this parameter know as the
Thermal Dissipation Constant.  Generaly, the larger the sensor, the more
power it can dissipate without affecting accuracy too badly.

The Betatherm web site has a great deal of usefull thermistor theory and
practice.  You may have to register to get some information though.
http://www.betatherm.com/thermistortheory/dc.htm

Hope that helps

Mike




=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
postmasterspamKILLspambookham.com.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\11\05@124932 by Olin Lathrop

face picon face
Michael Rigby-Jones wrote:
> One point worth noting if you wish to achieve high accuracy, is that of
> self heating.  You must keep the current through the thermistor low
> enough that it's power dissipation does not significantly affect it's
> temperature.

The PIC can help here but only turning on the thermistor long enough for
the A/D voltage to settle, then off again next reading.  Since
temperatures don't change that fast, you could easily turn on the
thermistor for 100uS every 100mS.  The average current will then be 1/1000
of the current used during a reading.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\11\06@025424 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Olin Lathrop [.....olin_piclistKILLspamspam.....EMBEDINC.COM]
>
> The PIC can help here but only turning on the thermistor long
> enough for
> the A/D voltage to settle, then off again next reading.  Since
> temperatures don't change that fast, you could easily turn on the
> thermistor for 100uS every 100mS.  The average current will
> then be 1/1000
> of the current used during a reading.

That's a good plan, and one I have used.  You do have to be carefull with
timing if the thermistor is decoupled to reduce noise.  Also some ceramic
capacitors often used for decoupling (notably X7R or Z5U material) have a
very poor temperature coefficient, so the timing must make allowances for
this.

Using the Microchip AN512 style method of measuring resistance via a bit
bashed single slope ADC is also surprisingly accurate, especialy if the PIC
has a comparator input.

Mike




=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
EraseMEpostmasterspam_OUTspamTakeThisOuTbookham.com.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...