Arduino and the DS18B20 temperature sensor

So, this is the reason I started with an Arduino in the first place. In summer 2010 I ordered an Arduino and a DS18B20 temperature sensor because I wanted to monitor the water temperature in my aquarium in the summer and have the Arduino start fans if needed. My flat is directly below the roof and gets quite hot.

But I never figured out how to read the temperature from the sensor, every tutorial I followed, every code snippet I found showed either nothing at all or ridiculously wrong temperatures. Nevertheless, I just decided to try it again, wired it up and the third code snippet I tried worked. Of course, it’s the sample code right on the Arduino Playground

A DS18B20 temperature sensor wired up to an Arduino Duemilanove

Continue reading Arduino and the DS18B20 temperature sensor