readinternaltemp question

In a previous thread (READINTERNALTEMP RAW clarification needed, Started by premelec, 05-12-2011), Hippy wrote "The IT_5V0 and other options apply an appropriate equation which converts the raw temperature reading to an approximate temperature for a specific voltage and an offset can be applied as part of those commands."

I'm using an 08M2 breadboard circuit with a +5V supply, and a DS18B20 so that I can compare the internal and external temperature readings. Using this setup, I have determined the necessary offset parameter that results in equal internal and external temperature readings at a room temperature of +23 degrees C.

I would like to be able to use the circuit (without the DS18B20) to monitor the temperature of a shed during winter, especially if the temp drops below 0 degrees C. My question relates to the format of the temperature value returned by the readinternaltemp command. Is it the same format that's used in the readtemp variable? In other words, is bit7 of the value set to 1 whenever the temperature is below 0 degrees C? If not, how are negative values represented? Thanks...




 

hippy

Ex-Staff (retired)
The raw reading will be some always positive value which rises, approximately linearly, with temperature.

For negative temperatures it's probably best to calibrate and convert the raw sensor values to Kelvin then adjust to Centigrade or Fahrenheit. Then how negatives are represented or dealt with / avoided is entirely in your own hands.

I suspect the non raw reading equations invoked would fail for negative values when calibrated for positive temperatures.
 
Thanks for your usual fast reply. I was afraid you might say something like that! Maybe I'll just stick with the DS18B20 for this project. :)
 
Svejk: The MCP9700 certainly looks like an interesting alternative to the DS18B20.

I read your paper and the Microchip data sheet, and I think I might mention the MCP9700 in a future Nuts & Volts column. If I do, would it be OK with you if I make your paper available to my readers?
 
Thanks - I'll hang on to a copy of your paper, and include a link to it on my website when I write about the MCP9700.
 
Top