RPi Node-Red: DHT11 Temperature and Humidity Sensor

Please wire up your DHT11 sensor as below:

To be able to use the DHT11 temperature and humidity sensor we will have to install the Node-Red node and the BCM2835 library to support it, the easiest way is explained below.

First open a terminal  window and copy and paste the entire code block and press enter.

#install bcm2835 library
cd ~/
curl http://www.airspayce.com/mikem/bcm2835/bcm2835-1.56.tar.gz > bcm2835-1.56.tar.gz
tar zxvf bcm2835-1.56.tar.gz
cd bcm2835-1.56
sudo make check
sudo make install

#install node
cd ~/
sudo npm install --unsafe-perm -g node-dht-sensor
sudo npm install --unsafe-perm -g node-red-contrib-dht-sensor

After the commands finish running press enter again to make sure the last one has been run.

Restart your raspberry pi, start Node-Red and search for “dht” you should find a node called “rpi dht22” this indicates that the node has been installed correctly.

The node must be setup as in the below image – make sure you select DHT11

image_pdfGenerate PDFimage_printPrint
Posted in Node-Red, Raspberry Pi.

Leave a Reply