DS18B20 temperature sensor

Pinout DS18B20 sensor

DS18B20RPI functieRPI pin
RoodVCC 3.3V1
Geel of Wit (DATA)GPIO #47
ZwartGND 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

RJ11 connector
Black = Ground
Green = Data
Yellow = Vcc
RJ11 connector
Black = Ground
Green = Data
Yellow = Vcc
TO-92
3 pin JST
Black = Ground
Yellow = Data
Red = Vcc
JST to Raspberry PI GPIO
Brown = Vcc = PIN 1
Yellow = Data = PIN 7
White = Gnd = PIN 9