Dan LaRue

If the HTS221 Temperature / Humidity Sensor Stops Working

Discussion created by Dan LaRue on Feb 28, 2018
Latest reply on Mar 14, 2018 by larue.dan

We use the HTS221 sensor to provide indoor temperature and humidity data in an IoT environmental monitor. In general it is easy to use. For power conservation we use the sensor in one-shot mode. We have found a scenario that will lock up the sensor's temperature and humidity measurements (sensor stops working).

 

Scenario description: We tell some of our sensors to shut-down "now" if the battery is in critical need of a recharge. During this mode, if a one-shot conversion is in progress, and the HTS221 is told to power-down (PD bit = 0), the sensor will become unresponsive to future, proper, one-shot readings. It appears that only shutting off the supply voltage (removing the battery) will restore the sensor to full operation.

 

Recommendation: Before powering down the HTS221 sensor (using PD bit), verify that a one-shot conversion is NOT in progress.

 

C Code example:

bool powerDown()

{

    char reg;

 

    register_read(CTRL_REG2, &reg, 1);

    // check if one-shot conversion in progress

    if((reg & ONE_SHOT) == 0)
    {
        // one-shot conversion NOT in progress, can power down
        register_read(CTRL_REG1, &reg, 1);

        // set power down bit to zero

        reg &= ~PD;
        register_write(CTRL_REG1 , reg);

        return true;
    }

    else

    {

        // one-shot conversion IS in progress, did not power down

        // will try again later

        return false;

    }

}

Outcomes