• Dear all,

    I just tried the module HTU21D (http://www.espruino.com/HTU21D) and it seems that I can get the temperature quite accurately but the humidity ever returns -6.
    I figured out that the HTU21D may be compatible with the Sensiron SHT21. I tried to used the module SHT2xinstead. As before, temperature is correctly read but humidity returns null.
    Did anyone use this/those modules recently and can confirm they work as expected?

    Thank you!

    my code:

    var i2c = new I2C();
    i2c.setup({scl: D17, sda: D19});//NRF52
    var htu = require('HTU21D').connect( i2c );
    var temperature;
    var humidity;
    function HTU21DRead() {
      htu.getTemperature( function(temp) {
        htu.getHumidity( function(hum) {
          temperature = temp;
          humidity = hum;
      } );

    And when I ask for temperature and humidity I get:

  • Hi Jean

    I had the semi-same problem with HTU21D. It returned with open circuit humidity and temperature a lot of times. After it worked again (or not :)).
    The I2C line uses 3 eeproms which work fine all time...
    I reviewed my code.. the library...the eeprom... bus frequency...datasheet... my 4 htu sensors, everything... the fault and instability stayed the same.

    The final solution was: I used 1K resistors to pull up the bus lines because of 4 devices on it. This was the mistake. with 0.5K it also did not worked, but with 2.7K all of my sensors became available immediately.


Avatar for user122043 @user122043 started