Hi guys,
I am relativley new to PIC AXE system and have found learning basic a bit of a challenge, since i am used to programing in C and Assembler.
I am working on a project currently that is using the DS18B20 digital temprature sensor with the PIC AXE 18X. and trying to use the sensor as a kind of thermostat ie trigger some outputs when the temprature reaches a certain temprature, say 40 Degrees Celcius.
With a ambient temprature of around 25 degrees.
and am using the following code and the 3 wire connection set up shown on the DS18B20 datasheet(http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2812) for a single DS18B20 connected to input pin 0 of the PIC AXE 18X on a cable length of aprox 2m(computer ribbion data cable) at this length i would not of expected any significant effect from capacitance betwen the cables or voltage drop from cable resistance.
From reading the the second part of the manual, the DS18B20 data sheet, and some forum posts I thought that the value returned by DS18B20 would be near 25 degrees when the ambient temprature was close to this (no heat source in contact with the sensor). However after using the "debug" command i discovered the sensor was returing a value of 80 instead of 25.
I am puzzled as to what could cause such a large difference for a sensor that is suposed to reflect the temprature it is in contact with almost the same value ie if the temprature of a piece of pipe connected to the sensor was 50 degrees the DS18B20 should return close to 50 degrees.
Am I missing something, does the DS18B20 need to be initalised so that it gives 25 degrees when it is in an environment of 25 degrees?
Is there any way to correct the difference in actual temp and measured temp?
Any thoughts or possible solutions would be greatly appreciated.
Thanks in Advance,
Keith22
I am relativley new to PIC AXE system and have found learning basic a bit of a challenge, since i am used to programing in C and Assembler.
I am working on a project currently that is using the DS18B20 digital temprature sensor with the PIC AXE 18X. and trying to use the sensor as a kind of thermostat ie trigger some outputs when the temprature reaches a certain temprature, say 40 Degrees Celcius.
With a ambient temprature of around 25 degrees.
and am using the following code and the 3 wire connection set up shown on the DS18B20 datasheet(http://www.maxim-ic.com/quick_view2.cfm?qv_pk=2812) for a single DS18B20 connected to input pin 0 of the PIC AXE 18X on a cable length of aprox 2m(computer ribbion data cable) at this length i would not of expected any significant effect from capacitance betwen the cables or voltage drop from cable resistance.
Code:
readtemp12 0, b1
pause 750
I am puzzled as to what could cause such a large difference for a sensor that is suposed to reflect the temprature it is in contact with almost the same value ie if the temprature of a piece of pipe connected to the sensor was 50 degrees the DS18B20 should return close to 50 degrees.
Am I missing something, does the DS18B20 need to be initalised so that it gives 25 degrees when it is in an environment of 25 degrees?
Is there any way to correct the difference in actual temp and measured temp?
Any thoughts or possible solutions would be greatly appreciated.
Thanks in Advance,
Keith22