The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile userprogrammable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line (and ground) for communication with a central microprocessor. It has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C

# vi /boot/config.txt
dtoverlay=w1-gpio,gpiopin=4
# vi /etc/modules
wire
w1-gpio pullup=1
w1-therm
# reboot
# cd /sys/bus/w1/devices
# cd 28-*
# cat w1_slave
