DS18B20 Temperature Sensor is a 1-wire digital sensor which can reach the digital data resolution up to 12bits and has ±0.5°C accuracy from -10°C to +85°C. A pull-up resistor is added to get stable data from the data line.
This DS18B20 Temperature Sensor is a semiconductor temperature. It includes an analog-to-digital converter to convert the analog signal to the digital output with the resolution up to 12 bits. The sensor uses a 1-wire interface so digital output data can be received by a single digital pin on the microcontroller board, you can also connect many other 1-wire devices on the same pin. The sensor can work under the voltage of 3-5V, you must check the sensor VCC pin connect the right power supply.
We also add a 4.7k resistor for you to use as a pull-up resistor on the 1-wire line. In this case, you will get stable data transmitting from the data line.
To start up, please view the 1-wire library for Arduino using DS18B20 Temperature Sensor in the document column.
Dallas Temperature Control Arduino library