The DS18B20 Temperature Probe

The DS18B20 temperature probe is a simple but fairly accurate (±0.5°C over much of the range) Dallas 1-wire digital temperature sensor which can provide up to 12 bits of precision from the onboard digital-to-analog converter. It works great with a variety of microcontrollers using a single digital pin, and you can even connect multiple ones to the same pin since each one has a unique 64-bit ID burned in at the factory to differentiate them. Since the Raspberry Pi has the appropriate header to take advantage of the 1-Wire bus, it's farily simple to get this going and start recording temperature!

Wiring the Probe

First, we need to wire up the probe. The probe itself has 3 wires, Looking at the flat side of the probe, from left to right it's ground, data and power. The chip itself expects to have a pull up resister of 4.7k ohm between power and data. Easily powered off of the Raspberry Pi, that wire up looks like this:

Using the Probe

Assuming you have a nice shiny linux install running on your Raspberry Pi, you'll need do the following:

pull down the latest version of the go language tools

apt-get update; apt-get install golang

setup your GOPATH to tell go where to put things

export GOPATH=~/go/

Go get the ds18b20 library

go get github.com/yryz/ds18b20