DS18B20 strange readings

Hi all
I have been messing about with one of these for a while with an 18x chip using:
Main:
readtemp 0 , w1
sertxd ("the temp is:" #w1,13,10)
pause 1000
goto main
this has been displaying the temperature in centgrade of anything i put in front of it from my thumb to (near) my soldering iron. No negatives.
Having got to grips with this I decided to build an egg incubator so ordered an lcd display and an 18m2 to control the fan, light, motor etc.
have wired up the lcd display and connected it to a new project board with the 18m2 and the following:

main:
readtemp C.0, w1
serout B.7,N2400, (254,128)
serout B.7,N2400, ("temp is: " #w1)
pause 3000
serout B.7,N2400, (254,1)
pause 30
goto main

this works fine until the temp goes over 25or 26 then the display alternates the real temp with 85 as it gets hotter the display just stays on 85
if i use "sertxd" a similar thing happens in the terminal.

if i reconnect to the 18x on its project board using "sertxd" everything is fine

there must be a simple answer but I cant find it!!!
best wishes
 
its all wired on two picaxe project boards
the 18m2 is on a new board and is giving the problem, the 18x is on an old board and works perfectly, I have just connected the lcd display to this and all is spot on. not really knowing what a decoupling capacitor is or where it goes I cant really say.!
what size should it be and where does it go??? I will find out what it does in the meantime....
many thanks
 
now i'm embarrassed cos nick12ab told me about decoupling capacitors on another project a couple of years ago. I have just gone back to the thread on the forum! so I will try that!
the board is the picaxe-18 standard project board CH1030
afraid I will have to come back to this tomorrow.
best wishes
 
OK cracked it! literally
cut the pulldown resistor, made no difference, still alternating readings, put a 4k7 pullup just a constant 85 reading, so back to the original set up, this time there was an occasional 0 in the output, this had only happened before when a wire was disconnected so I started looking at the sensor itself, It was sealed inside some heat shrink tube from another project, the movement was enough to give the occasional 0 reading,while I was looking, more movement and the gnd cable parted. So my conclusion is that this connection was damaged in my previous project (it was underwater for a long time). So although it worked, the movement of my hand holding it or the heat from my soldering iron was enough to expand the heat shrink enough to break the connection but on cooling it was made again. I have connected a new DS18B20 removed the pulldown and installed a pullup and all is fine with the 18m2. So I can continue on my quest to hatch eggs.
with many thanks to you all as usual!
Happy Christmas
Doggington
 
Top