node-red-contrib-htu21d-2 0.1.0

Connect a Measurement Specialties HTU21D humidity sensor to Node-RED

npm install node-red-contrib-htu21d-2

This is an updated version of Maxwell's plugin which uses a different underlying library in order to support more recent versions of nodejs/node-red. This was tested with nodejs v6.9.4 and node-red v0.16.1. It was also expanded to include

Vapor Pressure calculations.

A Node-RED node to query and receive data from Measurement Specialities HTU21D humidity and temperature sensors. These pre-calibrated sensors are interfaced using the I2C bus. The node also calculates the dew point temperature from the measured humidity and temperature.


Use npm to install this package locally in the Node-RED data directory (by default, $HOME/.node-red):

cd $HOME/.node-red
npm install node-red-contrib-htu21d-2

Alternatively, it can be installed globally:

npm install -g node-red-contrib-htu21d-2

The nodes will be added to the palette the next time node-RED is started.


This node uses the htu21d-i2c npm package to access the device over an I2C bus. This is generally supported only on Linux. The bus device name (e.g. /dev/i2c-1) is configurable: only one actual sensor is allowed on each bus, but the bus can be shared with any other I2C device not using the (7-bit) address 0x40.


The output message payload holds the following properties:

humidity - relative humidity in %

temperature - temperature in ˚C or ˚F as configured

dew_point - calculated dew point in ˚C or ˚F as configured

vapor_pressure - calculated equilibrium vapor pressure in millibar

Measurements are repeated at a configurable interval: each measurement takes just over 0.1 second.

Node Info

Version: 0.1.0
Updated 11 months, 3 weeks ago
License: BSD-2-Clause


1 in the last day
4 in the last week
30 in the last month


  • htu21d


  • node-red
  • htu21d
  • humidity
  • sensor


  • alexschwantes


  • Alexander Schwantes