Quick way to get the DS18B20 temperature sensor to work on a Raspberry Pi

The DS18B20is a very easy to use temperature sensor with the Raspberry Pi.

There are lots of articles explaining how to get things working.  Below the way I’m doing it – with reference to the source articles.

A bit of a rough and dirty guide 🙂

Follow process as described in Raspberry Pi 1- Wire Digital Thermometer Sensor

Make the modprobe statements permanent:

sudo nano /etc/modules

add the following lines at the bottom

w1-gpio
w1-therm

and save.

(Reference Adding Modprobe w1-gpio / Modprobe w1-therm to boot)

If required, configure Python:

sudo apt-get install python-pip
sudo pip install w1thermsensor

reference and sample code is available at https://github.com/timofurrer/w1thermsensor

This entry was posted in Computing and tagged , , . Bookmark the permalink.

Leave a comment