Pinout DS18B20 sensor
| DS18B20 | RPI functie | RPI pin |
|---|---|---|
| Rood | VCC 3.3V | 1 |
| Geel of Wit (DATA) | GPIO #4 | 7 |
| Zwart | GND | 9 |
Plaats tussen DATA en VCC 3v3 een weerstand van ~4.7K-10K.
Activate One Wire GPIO
sudo raspi-config
Interfacing Options
1-Wire enable
Reboot as suggested
DS18B20 function test
Use the two commands below to ativate ‘one-wire’ at GPIO #4
sudo modprobe w1-gpio sudo modprobe w1-therm
Go to the directory below to check the DS18B20
cd /sys/bus/w1/devices
Display the content of the direcory:
ls
When the new sensor is discovered then there is a new directory with the name of the sensor :
cd 28-xxxxxx
Use the two commands below to readout the value of the sensor.
cat w1_slave
Install node for DS18B20 sensor
To use the DS18B20 sensor in Node Red
Manage palatte from the menu
Install
search for node-red-contrib-sensor-ds18b20
Connections

Black = Ground
Green = Data
Yellow = Vcc


Black = Ground
Yellow = Data
Red = Vcc

Brown = Vcc = PIN 1
Yellow = Data = PIN 7
White = Gnd = PIN 9
