1 wire temperature
Lars50
Posts: 23
Hi
I'm trying to achieve better temperature resolution than the 1 degree that follows most of the code for DS18S20. I recall seeing this code at Parallax·webpage but can't find it again.
Any hint is appreciated...
I'm trying to achieve better temperature resolution than the 1 degree that follows most of the code for DS18S20. I recall seeing this code at Parallax·webpage but can't find it again.
Any hint is appreciated...
Comments
Part of the dilemma is that the 18S20 offers more numerical accuracy than the actually measurement seems to accomodate. I am not sure if the variation is in calibration of individual units or if there is a problem with drift in the actual measurments due to the ambient temperature.
If it is a calibration problem, the information is useful - you have to compensate each one to your own benchmark.
If it is a drift problem, you get a big useless number.
There are platinum resistive elements that are highly accurate and can get down to -100 degrees C.
The Art of Electronics discusses the inherent problems with temperature measurement in silicon devices. While it is wonderful to be able to put a thermometer inside a device for shut down and measurement, there are better older technologies based on very simple physics.
The appeal of the ONE WIRE device is that you can have a network of addressible and confirmible temperature guages. If you have a chemical plant to check the whole network, verify the identity and proper operation of each one AND feel secure in knowing what is really operating.
But, it seem to be a 'ball park' figure -- not a nitty gritty one.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Post Edited (Kramer) : 1/30/2006 5:11:00 AM GMT
search.parallax.com
#82 was not the article·I recall, but you right it was properly from the N & V I got it previously.
Thanks
http://www.parallax.com/dl/docs/cols/nv/vol6/col/nv123.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 1/29/2006 4:26:18 PM GMT
in the spec' sheet for the device.
Look at your BS2p code that reads the temperature from the device.
Notice the 0xBE command that you send to the 18S20? Notice that
the program reads only two bytes for the temperature. The 0xBE
command tells the 18S20 to spit out it scratch pad memory. There
are eight bytes plus a CRC byte available to be read. If you read
bytes 7 & 8, these values allow the reader to perform something akin
to linear interpolation an extract a fractional portion of the temperature.
Well, really "more of the fractional portion....".
Here's a quote from the spec' sheet:
Higher resolutions may be obtained by the following procedure. First, read the temperature,
COUNT_REMAIN, AND COUNT_PER_C registers from the scratchpad. Truncate the 0.5°C bit
(the LSB) from the temperature value. This value is TEMP_READ. The actual temperature may
be calculated by using the following:
TEMPERATURE = TEMP_READ - 0.25 + (COUNT_PER_C - COUNT_REMAIN)/COUNT_PER_C
Keep in mind that obtaining more RESOLUTION (or PRECISION) may not increase the
ACCURACY of your data! The spec' sheet does state that accuracy of the device is
+/-0.5°C from -10°C to +85°C. (Emphasis is mine).
Bon appetite!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
Post Edited (Fe2o3Fish) : 1/29/2006 7:08:06 PM GMT
I'll give it a try.
Lars
But you see, that accuracy of +/- 0.5 keeps coming back as a damning reality.
I supose you begin to get statistically random numebrs around the true value.
If you can somehow do a statistical analysis, it might be worthwhile, but you are getting into 'random walk theory' and ozcam's razor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan