I am creating a thermostat for a refrigerator that has separate compressors for the freezer and the refrigerator compartments. I am using two waterproof DS18B20 sensors to measure the temperature in each compartment hooked up to an Arduino Mega. The 2m cables are extended by another 1m cable. I have the black wires hooked up to digital pin 20 pulled low, the red wires hooked up to pin 19 pulled high and the yellow wires hooked up to pin 21. There is a 1.1k resistor between pin 19 (5v power) and pin 21 (data). I am using pins 16 and 17 to turn solid state relays on and off which are hooked up to the compressors. Everything seems to work fine until the sensor in the freezer compartment goes below 3.65 degrees F. Then the sensor just return -196.6, which is an error. I originally had a 4.7k pullup resistor but read that a conversion takes 1.5mA, so I changed it to a 1.1k resistor, but that did not help. I have tried 9, 10, 11, and 12 bit resolutions with the same result. I have tried
tempFD = sensors.getTempF(freezerThermometer);
with freezerThermometer as the hex serial number, and I have tried
tempFD = sensors.getTempFByIndex(0);
to get the temperature by Index.
I have even tried a different sensor ( I bought a five pack) but everything yields -196.6 when the temp drops below 3.65F.
Any ideas?