sht31-sensor

A Node.js I2C module for the SHT31 Humidity and Temperature Sensor.

Usage no npm install needed!

<script type="module">
  import sht31Sensor from 'https://cdn.skypack.dev/sht31-sensor';
</script>

README

sht31-sensor

Welcome to sht31-sensor, a Node.js I2C module for the Sensirion SHT31 Humidity and Temperature Sensor. Adafruit sells a SHT31 breakout board and here is the datasheet.

This module uses i2c-bus which should provide access with Node.js on Linux boards like the Raspberry Pi Zero, 1, 2, or 3, BeagleBone, BeagleBone Black, or Intel Edison.

Since sht31-sensor needs to talk directly to the I2C bus and requires access to /dev/i2c, you will typically need run Node with elevated privileges or add your user account to the i2c group: $ sudo adduser $USER i2c

Disclaimer

A lot of code snippets, inspiration and even this README was largely taken from the BME280 implementation from Skylar Stein (actually almost everything). It is recommended to mostly follow the instructions on this site to also get the SHT31 to work on whatever breakout board available. The code was only tested on a custom board implementation available from AR4 GmbH.