I recently got my hands on a Keyes 18b20 temperature sensor.
These are great little modules but it took awhile to figure out how to get it connected to the raspberry pi and the necessary Raspberry pi config.txt changes.
The Module already has the 4.8 K pull-up resistor you'd typically have to wire up along with the DS18b20 so the only components you need are the Keyes module and a Raspberry pi.
The Module also has an LED that will flash when the temperature is read.
For the GND we'll use Pin# 06.
For the 5v we'll pick Pin #02
Keyes GND -> Pin# 06.
Keyes 5V -> Pin #02
Keyes Signal -> Pin #07
To enable w1-gpio open the config.txt file in nano with the command:
sudo nano /boot/config.txt
Add the following line to the config.txt file.
dtoverlay=w1-gpio
save and exit nano.
Reboot your Pi.
Go to the directory that contains the 1 wire devices and list the contents.
cd /sys/bus/w1/devices
ls
There will be a list of the devices on the 1 wire bus.. You will see something like 28-031465885cff.
To read the data you'll read the contents of the w1_slave file substituting the ID of your device for 28-031465885cff.
cat "/sys/bus/w1/devices/28-031465885cff/w1_slave
The temperature will be at the second line of the file in the form
t=22300
Value is in Celcius*1000 so in the above example it would be 22.3 degrees celcius.