Hi,
I have DS18B20 connect to arduino UNO. it read out temperature right when temp is not changing. the problem is when temperature rises, the temp value change to 85C, then back to right value. I wonder if anybody else has same case as mine.
note: when change to 85C, the CRC is right. this means no read error happened when read from 1 wire bus.
This may be just a case of bad timing. You could be going round the loop too quickly to get a proper read. If this is is indeed the case and happened by accident, you can fix it for sure by inserting a delay in the loop to ensure a reading at one second intervals.
In the unlikely event that you really need a faster loop, you can do the above just prove it's OK and then get more serious about it. You can ensure a faster read by selecting a lower resolution and by not using parasitic power.
The problem might also be caused by bad cables, particularly if they are very long, but this only merits examination if the above comments are irrelevant!.
IIRC, 85C is what you get before the chip has read anything, so unless you are using it in a very hot environment, it's generally a sign that something is wrong - for me, that's usually been wiring too.
There is a footnote on page 4 which says "The power-on reset value of the temperature register is +85°C."
so if you read 85 degrees it means it hasn't done a conversion since the last power on.
You hadn't wired it up properly so the sensor was being powered off and on periodically, which resets the register to 85 and that is why you got a valid CRC from it.