Category Archives: Raspberry Pi

Setting up the Raspberry pi for 1-wire access

The entry describes various info on the Raspberry Pi’s 1-Wire interface.

To enable the 1-Wire module (defaults to GPIO4 on the Raspberry run the following from the terminal:

$ sudo modprobe w1-gpio
$ sudo modprobe w1-therm

I guess the first line enables the 1-Wire interface, and the second the automatic reading of the DS18B20 temperature sensor.

As an alternative (if you don’t want to manually enter these every time – which would be very inconvenient in a system that is running unsupervised) you can load these two kernel modules automatically by editing /etc/modules, e.g. “sudo nano /etc/modules” (To save with the Nano editor press Ctrl+O and then press enter to confirm the filename, to quit press Ctrl+x. if you are unable to save, then maybe you forgot the “sudo” at the beginning of the line).

Add/ensure the following two lines can be found in /etc/modules:


Save and close the file, after next reboot the kernel modules will be loaded without intervention.


Sources for the information in this post: