Sheepwalk Electronics

RPI1 Software Details

The RPI1 is designed to work with the 1-Wire driver built into the Linux kernel.

To get it to work you need to ensure you have a kernel with the w1_gpio module in it. Most of the kernels available for the Raspberry Pi have this support already built in.

To load the modules required do the following:
pi@raspi:~$ sudo modprobe w1_gpio
pi@raspi:~$ sudo modprobe w1_therm
pi@raspi:~$

You should then be able to do the following:
pi@raspi:~$ ls /sys/bus/w1/devices
28-000004184bfb 28-000004186eb3 w1_bus_master1
28-000004184dc3 28-000004193944
pi@raspi:~$

The four directories starting with 28- in this example are four DS18B20 temperature sensors. To read the temperature from one of the sensors you can do the following:
pi@raspi:~$ cat /sys/bus/w1/devices/28-000004193944/w1_slave
2d 01 4b 46 7f ff 03 10 39 : crc=39 YES
2d 01 4b 46 7f ff 03 10 39 t=18812
pi@raspi:~$

In this example the temperature being reported by that sensor is 18.812C.

When writing software to read this data it is recommended to check the crc gives a "YES" response or sanity check the value is within the expected range (or both) before accepting it as you do sometimes get readings that are way out.

Sheepwalk Electronics is a trading name of Sheepwalk Cottage Limited, registered in England number 06303042.