Temperature Measurement

I recall looking at using an NTC thermistor for temperature measurement and finding it was a bit of a PITA because of the messy equation for temperatu re which was more complicated by the voltage divider formula (not linear). I recall seeing circuits mentioned here using various devices, some of whi ch were low cost voltage sources that gave linear voltage vs. temperature. I just can't recall the part numbers. I want to say it was a three termin al device and the data sheet even gave a circuit for use in measuring tempe rature.

That or is there a simple way to use a thermistor? I guess driving it wit h a constant current source would help compared to the voltage divider. Th e calcs are being done on an 8 bit MCU with a 10 bit ADC, so it would be ni ce to simplify the software and get as much accuracy out of the 10 bits as practical.

--
  Rick C. 

  - Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricketty C
Loading thread data ...

Reply to
Pimpom

Or, if you want all digital, there's also the DS18B20.

--
RoRo
Reply to
Robert Roland

You can linearize a thermistor by choosing the right value bias resistor--you get a Chebyshev-ish curve whose maximum error can be traded off against the temperature range. I have a mathcad file that makes that easier.

Except for really low-performance applications, IC temperature sensors are poor--slow, inaccurate, and prone to giving reasonable-looking wrong answers because they can only measure their own temperature.

An 0603 thermistor with one side soldered to a copper pour that's in intimate contact with the DUT has a thermal TC of around 100 milliseconds.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
 Click to see the full signature
Reply to
Phil Hobbs

I read this article recently:

Maybe those devices are what you want.

There are plenty of small digital temperature sensors that save you most of the effort in conversion - what suits will depend on other aspects of the system (cost, accuracy, calibration, whether the temperature you

sensors are often cheap and simple.

If you have something non-linear on the ADC, try to get the bias resistors to get it fairly close to linear - or if you have a specific temperature range in mind, make that range match as much of your measurement area as possible. Then use a table and linear interpolation for calculating the voltage - it should be simple even in a small microcontroller.

Reply to
David Brown

LM34 for Fahrenheit, TMP36 for Celsius with an offset - to make below zero measurements a bit easier. Watch out with the LM34 - it has almost no drive capability and can be a problem with sampling A/D converters.

I now use mostly the digital DS18B20 One Wire interface if I'm connecting to a micro.

Reply to
Dennis

here

e

he

ng

tage

ADC,

The one wire parts from Dallas/Maxim are pricey. The DS18B20 is no excepti on, $2 at quantity. I was looking at the TMP236 which is only $0.20 in qty .

It's just that there is a three terminal part intended for current or volta ge control that has a well established temperature offset so that it can be used to measure that temperature. It might not be a sub dollar part, so i t may not be useful here either. I just don't recall what it is, but it w as discussed in a thread recently. Seems everyone knows about it but me.

--
  Rick C. 

  + Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricketty C

I'm hanging a thermistor on a thick-film DPAK 50 ohm resistor, to shut down a pulse generator if the user programs some outrageous voltage and duty cycle, then shorts my output.

That just takes a resistor and a comparator, but we also use thermistors on PCBs to really measure temperature. The math isn't bad. I have a thermistor Spice model, so I can take points of a thermistor-resistor divider and do a table for interpolation. Yes, I know, you'd do the actual math.

LM35 is a tricky, actually treacherous, part. It can oscillate and latch up and rectify spikes. Bob Pease promised to fix it for me, but never got around to it.

LM71 is cool, an SPI temp sensor, but it's more expensive than a thermistor. Lots of FPGAs have temp sensors inside.

Diodes/Zetex makes an interesting nickel RTD in a sot-23 package. Nickel curves up so you can linearize it with a resistive load.

--
John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  
 Click to see the full signature
Reply to
John Larkin

Voltage dividers are the common thing. I believe the other R should be a similar value for linearity.

Here's a script for generating a LUT.

Reply to
Johann Klammer

nd finding it was a bit of a PITA because of the messy equation for tempera ture which was more complicated by the voltage divider formula (not linear) . I recall seeing circuits mentioned here using various devices, some of w hich were low cost voltage sources that gave linear voltage vs. temperature . I just can't recall the part numbers. I want to say it was a three term inal device and the data sheet even gave a circuit for use in measuring tem perature.

ith a constant current source would help compared to the voltage divider. The calcs are being done on an 8 bit MCU with a 10 bit ADC, so it would be nice to simplify the software and get as much accuracy out of the 10 bits a s practical.

Is there something wrong with some points in a look up table and then linear interpolation between points?

George H.

Reply to
George Herold

and finding it was a bit of a PITA because of the messy equation for tempe rature which was more complicated by the voltage divider formula (not linea r). I recall seeing circuits mentioned here using various devices, some of which were low cost voltage sources that gave linear voltage vs. temperatu re. I just can't recall the part numbers. I want to say it was a three te rminal device and the data sheet even gave a circuit for use in measuring t emperature.

with a constant current source would help compared to the voltage divider. The calcs are being done on an 8 bit MCU with a 10 bit ADC, so it would b e nice to simplify the software and get as much accuracy out of the 10 bits as practical.

Personally I find it a PITA. The software guys are using the Arduino CPU w ith 2 kB RAM and 32 KB Flash. I would not want to waste memory for somethi ng so simple. The thermistor is very cheap, but the TMP236 is only $0.20 i n quantity and is linear. One multiplication and done! Why screw with a t hermistor?

They are controlling a brushed motor with PWM through an H-bridge with feed back from pressure gauges and flow rates. They have to do a bunch of calcu lations using 64 bits. There may be plenty of horsepower to do it all, but why muck with this to save less than $0.20? Let them focus on the importa nt tasks.

Hell, if I was calling the shots I'd give them a processor with 64 bit floa ting point. It would still be the lowest cost part of the overall system.

Not sure I can support that statement though. There are lots of cheap 32 b it floating point CPUs, but I'm not sure about 64 bit floating point. I th ink there are a lot fewer and they may get a premium price. I need to sear ch for a part.

--
  Rick C. 

  -- Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricketty C

nt and finding it was a bit of a PITA because of the messy equation for tem perature which was more complicated by the voltage divider formula (not lin ear). I recall seeing circuits mentioned here using various devices, some of which were low cost voltage sources that gave linear voltage vs. tempera ture. I just can't recall the part numbers. I want to say it was a three terminal device and the data sheet even gave a circuit for use in measuring temperature.

t with a constant current source would help compared to the voltage divide r. The calcs are being done on an 8 bit MCU with a 10 bit ADC, so it would be nice to simplify the software and get as much accuracy out of the 10 bi ts as practical.

with 2 kB RAM and 32 KB Flash. I would not want to waste memory for somet hing so simple. The thermistor is very cheap, but the TMP236 is only $0.20 in quantity and is linear. One multiplication and done! Why screw with a thermistor?

A good "interchangable" thermistor is a better temperature sensor than any semiconductor temperature sensor that I know about. It's also an order of m agnitude less noisy (though this rarely matters). You can trade-off the siz e of the look-up table against the size of the routine that translates A/D output into temperature.

formatting link

with three parameters, can be accurate to about a milli-degree, and doesn't require any lookup table at all.

edback from pressure gauges and flow rates. They have to do a bunch of cal culations using 64 bits. There may be plenty of horsepower to do it all, b ut why muck with this to save less than $0.20? Let them focus on the impor tant tasks.

The focus should be on getting the information you need, to the accuracy yo u need. In general, extra processing power and memory is a lot cheaper than extra parts.

oating point. It would still be the lowest cost part of the overall system .

bit floating point CPUs, but I'm not sure about 64 bit floating point. I think there are a lot fewer and they may get a premium price. I need to se arch for a part.

Why not do all the processing in an FPGA and program the FPGA so that it in cludes a version of the processor you like?.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

ment and finding it was a bit of a PITA because of the messy equation for t emperature which was more complicated by the voltage divider formula (not l inear). I recall seeing circuits mentioned here using various devices, som e of which were low cost voltage sources that gave linear voltage vs. tempe rature. I just can't recall the part numbers. I want to say it was a thre e terminal device and the data sheet even gave a circuit for use in measuri ng temperature.

it with a constant current source would help compared to the voltage divi der. The calcs are being done on an 8 bit MCU with a 10 bit ADC, so it wou ld be nice to simplify the software and get as much accuracy out of the 10 bits as practical.

PU with 2 kB RAM and 32 KB Flash. I would not want to waste memory for som ething so simple. The thermistor is very cheap, but the TMP236 is only $0.

20 in quantity and is linear. One multiplication and done! Why screw with a thermistor?

y semiconductor temperature sensor that I know about.

Define "better". I think we all know "better" is the enemy of good enough.

You can trade-off the size of the look-up table against the size of the rou tine that translates A/D output into temperature.

't require any lookup table at all.

More than a thousand times "better" than required and many, many times "bet ter" than the components themselves. Then there is the fact that the equat ion you mention is not the whole solution.

feedback from pressure gauges and flow rates. They have to do a bunch of c alculations using 64 bits. There may be plenty of horsepower to do it all, but why muck with this to save less than $0.20? Let them focus on the imp ortant tasks.

you need. In general, extra processing power and memory is a lot cheaper th an extra parts.

That is my point. They have added at least three MSI chips to multiplex in terfaces because of I/O count limitations. I/Os are not terribly expensive either in a 64 pin QFP.

floating point. It would still be the lowest cost part of the overall syst em.

32 bit floating point CPUs, but I'm not sure about 64 bit floating point. I think there are a lot fewer and they may get a premium price. I need to search for a part.

includes a version of the processor you like?.

That question answers itself I believe. I guess only you would think to as k it.

I'm sure you will come back with an equally banal reply that no one will re ad.

--
  Rick C. 

  -+ Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricketty C

with 2 kB RAM and 32 KB Flash. I would not want to waste memory for somet hing so simple. The thermistor is very cheap, but the TMP236 is only $0.20 in quantity and is linear. One multiplication and done! Why screw with a thermistor?

You can ratio the thermistor with a fixed resistor, so the cost and noise of a voltage reference is... nil.

Reply to
whit3rd

any semiconductor temperature sensor that I know about.

h.

I don't have to. The actual quote is "the best is the enemy of the good".

. You can trade-off the size of the look-up table against the size of the r outine that translates A/D output into temperature.

sn't require any lookup table at all.

etter" than the components themselves.

It's still perfectly adequate even if you don't need that level of precisio n.

ution.

It is - for converting the resistance of the sensor of the temperature it i s registering. There are lots of other "whole solutions" around, so that if a pretty silly observation, even for you.

h feedback from pressure gauges and flow rates. They have to do a bunch of calculations using 64 bits. There may be plenty of horsepower to do it al l, but why muck with this to save less than $0.20? Let them focus on the i mportant tasks.

y you need. In general, extra processing power and memory is a lot cheaper than extra parts.

Really? You were wittering on about the difficulty of coping with a mnon-li near sensor, which is entirely computational

of I/O count limitations. I/Os are not terribly expensive either in a 64 p in QFP.

So they've fixed on a familiar processor in a familiar package, when they m ight have got a better solution with a less familiar part?

t floating point. It would still be the lowest cost part of the overall sy stem.

p 32 bit floating point CPUs, but I'm not sure about 64 bit floating point. I think there are a lot fewer and they may get a premium price. I need t o search for a part.

t includes a version of the processor you like?.

ask it.

Your somewhat under-informed beliefs are the problems here.

read.

Quite likely - you are starting to sound like John Larkin, where every resp onse he can't be bothered (or isn't equipped) to understand, is a droning i nsult.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

Are you thinking of LM334?

piglet

Reply to
piglet

The AVR in standard Arduino's is not a powerful cpu by modern microcontroller standards, and the RAM and Flash can be limiting if you are doing a lot of work. It is not a good fit for 64-bit calculations (whether integer or floating point). It is surprising that you'd want

64-bit for this kind of thing, but obviously I don't know your specs.

Hardware support for 64-bit floating point is rare in microcontrollers - you see it on some PPC chips, and occasional high-end ARM microcontrollers. 32-bit hardware floating point is a lot more common. But you can do the floating point in software in 32-bit or 64-bit, it just takes a little longer.

Reply to
David Brown

ed here

the

the

ving

oltage

t ADC,

y
t

eption, $2 at quantity. I was looking at the TMP236 which is only $0.20 in qty.

oltage control that has a well established temperature offset so that it ca n be used to measure that temperature. It might not be a sub dollar part, so it may not be useful here either. I just don't recall what it is, but it was discussed in a thread recently. Seems everyone knows about it but m e.

He probably was. It certainly came to my mind. but I couldn't recall the pa rt number.

The odd thing about the LM334 data sheet is that they don't mention that if you used a current-setting resistor whose resistance was proportional to a bsolute temperature you'd get a constant current, and if you used a platinu m resistance sensor as that resistor you'd come pretty close.

Of course the cheapest Pt sensor on the Newark website costs $2.67 (though Digikey has one for $0.92), and the cheapest LM334 costs $0.645.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

ed here

the

the

ving

oltage

t ADC,

y
t

eption, $2 at quantity. I was looking at the TMP236 which is only $0.20 in qty.

oltage control that has a well established temperature offset so that it ca n be used to measure that temperature. It might not be a sub dollar part, so it may not be useful here either. I just don't recall what it is, but it was discussed in a thread recently. Seems everyone knows about it but m e.

not so cheap either at over a buck at qty 1000. So the TMP236 is the righ t way to go I think. It also has twice the slope so it makes for better re solution using a crap ADC.

--
  Rick C. 

  +- Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricketty C

I don't know the details of the calculations either, so I take them at thei r word.

It's not really a "fit" issue in that it can't be done. I think no one yet knows how much processing will be required, so there is concern that this MCU may run out of oomph. That's an SI unit you know.

I seem to recall when the CM4F devices were coming out there was a lot of m ention that they were only single precision. Then after a year or so some CM4F devices came out with double precision. I don't think that is going t o be an expensive chip no matter what. I've also seen CM7 devices on the m arket, but have not had a chance to read anything about them.

These devices may be far overkill, but I won't know until I dig in and see what is offered.

Someone was talking about having the CPU "verifed" as in approved. I assum e that is as part of the overall design. He seemed to think this would be harder for a higher end CPU. I know nothing about medical approval process other than it is hard.

We'll see. We have a live meeting coming up so that may be interesting.

--
  Rick C. 

  ++ Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricketty C

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.