sensor-htu21d
Version:
Library to read out a HTU21d humidity/temperature sensor connected via I2C. It depends on the "i2c-bus" library and is tested on a Raspberry Pi 3.
33 lines (24 loc) • 729 B
Markdown
Library to read out a HTU21d humidity/temperature sensor connected via I2C. It depends on the "i2c-bus" library and is tested on a Raspberry Pi 3.
```javascript
let Htu21d = require('./htu21d.js');
let htu = new Htu21d(1, 1000);
htu.start();
htu.on('readout-complete', (data) => {
console.log(data); // e.g. { temperature: 26.39, humidity: 16.45 }
});
htu.on('error', (error) => {
console.log(error);
});
```
The HTU21d is capable of measuring humidity with a resolution of 0.04 %rel and temperature with a resolution of 0.01 °C.
npm install sensor-htu21d
node test.js
Mejsel (marcel.indlekofer@gmail.com)
GPL license.