Hello,
After trying out waterproof DS18B20 temperature sensor cables from 2 unknown vendor cables and 1 from Adafruit, and the behavior remained the same - when room temperature reaches >= 24 C / >= 75 F - the temperature drops to 8 C / 46 F, then I had finally went back and debugged my code.
Before that, I corresponded with Maxim DS18B20 IC maker and they asked me to find out the cable's ROM ID when I only had the old cables on hand. So I added a short function at the very beginning of my FRDM-K64 project, to read the 64-bit (8 byte) ROM ID of each old cable.
Both old cables read and gave a "fake" ROM ID, FF-FF-FF-FF-FF-FF-FF-FF pattern. So I tried tracing where we bought them. It so happen it was from 2015 and no one here knows from which vendor.
So blamed the big drop in temperature readings on the fake DS18B20. We purchased new waterproof sensor cables from Adafruit and this one read ROM ID pattern which is more valid pattern, starting with family 28-XX-XX-XX-XX-XX-XX-XX. STILL, the temperature dropped at >= 24 C.
Background explanation (skip if not interested):
That's when I had to debug and fix my code. You see, I created my own driver functions in C-language instead of using the C++ drivers like from Arduino libraries. I based everything as far as timing is and command and memory functions to send out into very basic function calls of reset(), write(), read(), delays in between, as such. As far as the reading of MSB and LSB temperature and combining into full 16-bit Word, I was overly confident there's nothing wrong with it because ALL OTHER TEMPERATURES below 24 C, as well as when I calibrate against, ICE CUBES at 0.5 C/31.5 F, as well as piping hot water temperature >= 98 C - my temperature read function WORKS! The simple function works to combine MSB and LSB. So I didn't look there before.
After testing 3 cables, and I looked, I did step by step breakpoints code trace in MCU Xpresso and that's when I saw the MSB read is "0000 0001" at >=24 C. Whether I left shift that 8x or *256, that MSB byte becomes zero. Solution was to first convert both MSB and LSB to 16-bit Words before any shifting and adding to combine full 16-bit temperature value.
Now you know what happened.
FYI and thanks.
MI