I made the great project of "Digital thermostat (080090-11)" from Elektor july_august 2008 ; unfortunate I do not have DS1820 but DS18B20. The temperature show on display is like "xxx.xx 'C" !.
I read this : "In order to convert the HEX code to a temperature value, first you need to identify if you are using a DS18S20, or DS18B20 series sensor. The code to read the temperature needs to be slightly different for the DS18B20 (and DS1822), because it returns a 12-bit temperature value (0.0625 deg precision), while the DS18S20 and DS1820 return 9-bit values (0.5 deg precision)".
I try millions different routines, but the result is verry bad...because of this section, I think :
"DisplayTemp:
If V >= 10000 then ' Above 0 C.
Temperature=V-10000
Else
Temperature=10000-V ' Below 0 C.
EndIf
LcdOut $FE, $C0, Sign, DEC (Temperature / 100), ".", DEC2 Temperature, " ",223,"C "
Return"
All the codes I try change the Temperature set and Hysteresis, and the display show the temperature (ex. 24.56'C) , but useless function of thermostat...(Set temperature = 2000.00 and Hysteresis = 200.00).
And the temperature is different (+24.67 'C) by other device (DS18B20 + PIC 12F675 + LCD Nokia = 23.1'C ; LM35DZ + mV = 23.1 'C)
It is possible to increase the accuracy of this thermometer/thermostat ?
Can somebody help me to modify the source for using DS18B20 ?
Thanks in advance !
Bookmarks