I've built a system to regulate the temperature and humidity in my cellar, using 2 DS18B20 for the temp and 2 DHT21 for the humidity. To regulate the temperature, it has an ext to int fan and an electric heater for the winter ; and a classic dehumidifier for the humidity.
It has worked really fine since October 2013, but I recently decided to log the different sensors and output state using the serial port (and a PC) to see what the system was doing during the night... And this morning, when I entered the cellar, it was like 25°C and the heater was on ! When I looked up the log file from the night, I saw that suddenly both external and internal temperature (from the 2 DS18B20) fell to zero, and stayed that way for the rest of the night (which explains the heater...). After rebooting and resetting the EEPROM, it return to normal... I managed to get the problem once again doing the following : - Powering the arduino with its usual AC-DC adapter (9V) AND plugging the USB on the PC - (As the temp was to high, the fan was automatically on) - Turning manually ON the electric heater using a simple switch mounted on the arduino
Instantaneously, both temp fell down to zero and the heater stayed automatically on... I tried the same thing with only the AC-DC adapter or the USB, and no problem. However, when I tried again with both power source, no problem either !
In short, I suspect a failure from the 2 DS18B20, but I read that in that case we usually get -127 (no device found) or 85 (start-up value)... In which case could they return a constant exact zero value (0.00°C) ? They are powered with the +5V pin (and GND), and the data wire is connected to the PIN 7 using a 4.7kOhm resistor.
I hope this isn't too long and clear enough... Please ask if you have any question !
Thanks in advance