The DS18B20 is a so called 1-wire digital temperature sensor. The words “digital” and “1-wire” make this sensor really cool and allows you, with a super simple setup, to read the temperature of one or more sensors. You can even connect multiple devices together, utilizing only one pin on your Arduino. The more I play with the Arduino, the more fun it gets … 94 Arduino and DS18B20 Temperature Sensor The DS18B20 comes in different forms and shapes, so you have plenty of choice when deciding which one works best for you. There are 3 variations available: 8-Pin SO (150 mils), 8-Pin µSOP, and 3-Pin TO-92. If you look at eBay or Amazon, some of our Chinese friends have packaged the TO-92 version in a waterproof housing so you can use it directly in your fish-tank, water boiler, outside your house or even your freezer, without having to worry about water/moisture shortcutting your electronics (these have 3 wires: Black (GND), Red (Vdd) and white or yellow (Data)). DS18b20 – Available Packages DS18B20 in a waterproof casing The DS18B20 is quite versatile. It can be powered through the data line (so called “parasite” mode, which requires only 2 wires versus 3 in normal mode), it operates in a 3.0V to 5.5V range, measures Temperatures from -55°C to +125°C (-67°F to +257°F) with and ±0.5°C Accuracy (from -10°C to +85°C). It converts a temperature in 750ms or less to a up to 12 bits value. Another cool feature is that you can connect up to 127 of these sensors in parallel, and read each individual temperature. Not sure what I’d do with that, but the ability to combine one or two, for example for the temperature of your fridge and freezer, is a nice option, specially when other pins of your Arduino are being used for other things …

Source: Tweaking4All.com - How to measure temperature with your Arduino and a DS18B20 (http://www.tweaking4all.com/hardware/arduino/arduino-ds18b20-temperature-sensor/)

 

Wiring Arduino and DS18B20 The wiring, this is the beauty of a 1-wire interface, is super simple. The GND pin of the DS18B20 goes to GND on the Arduino. The Vdd pin of the DS18B20 goes to +5V on the Arduino. The Data pin of the DS18B20 goes to a (digital) pin of your choice on the Arduino, in this example I used Pin 2. The only thing we need to add is a pull-up resistor of 4.7 KΩ. I have seen ther values, but it seems this is the most commonly used value

Source: Tweaking4All.com - How to measure temperature with your Arduino and a DS18B20 (http://www.tweaking4all.com/hardware/arduino/arduino-ds18b20-temperature-sensor/)