Step 1: connect DS18B20 sensor to Arduino as per following Circuit Connection Graph


Step 2: Download OneWire libray and import the zip file into Arduino IDE. If you already have the OneWire Library, skip this step.
To import library into Arduino IDE, click Sketch ->Import and then select OneWire.zip file from your download folder. See following picture:

Step 3: Download DS18B20 sketch code and load it into Arduino IDE.

Step 4:Click the serial monitor window on the upper right corner, you will see temperature results in the monitor window.

Project Result Video: