almost human fully human

SOLUSIPSE

/var/log

DS18B20 in two-wire mode on Raspberry Pi

Since recently Raspberry Pi used Device Tree for deciding which kernel modules should be loaded. This makes most instructables on the Internet outdated.

I wanted to connect DS18B20 thermometer using only two wires. This circut use 1-wire protocol to communicate, so it has to be connected with three lines for normal operation: VCC, GND and DATA.

But there is an option to connect a device in so-called parasitic mode, which requires only two lines: DATA and GND. But it will not probably work unless you set a pullup option for 1-wire in /boot/config.txt:

dtoverlay=w1-gpio,gpiopin=4,pullup=on

It worked for me like a charm.