Why is there periodic success when continuously reading SHT31?

Why is there periodic success when continuously reading SHT31?

  • Hello,

    The error code 0x0BAE0001 corresponds to NRFX_ERROR_DRV_TWI_ERR_ANACK, which means that there was an address NACK (Not Acknowledged) on the bus when trying to perform a read/write operation. This usually happens when the device is not ready to communicate, which could be the case if the delay is too short.
     
    In your case, it seems like the SHT3X sensor is not ready to communicate when the delay is less than 1000 ms. This could be due to the sensor needing more time to process or prepare the data before it can be read. See this old thread, which discusses the same issue.
    I am not familiar with this sensor, but have you checked the data sheet to see if there are any specific timing requirements for reading data?
     
    Kind Regards,
    Abhijith
  • The Sensor SHT3x doesn't exhibit such behavior when used under the Arduino framework, especially with a cycle period of exactly 1000ms. I believe the issue doesn't originate from the SHT3x.

    Additionally, I found the link you provided at the time of my inquiry. I can confirm that the I2C connection is correct; otherwise, no temperature and humidity data would be obtained.

  • Hello,

    I am not sure why this is happening. Can you share the overlay file? I will take a look. How are you powering the DK and the sensor? I doubt if this is because of any power issue. I also recommend power cycling the board and sensor to clear the I2C bus if it's stuck. Have you tried probing the I2C lines? If so, what does it show?

    Kind Regards,

    Abhijith

  • Every 1000ms, you can get the following data normally

    when it is less than 1000ms, the data in the second chapter will appear,
    you can't get the data again until the last successful i2c communication is 1000ms away.

    For faster communication I created a github based on the lbs add sht3x project.

    github.com/.../nrf52_lbs_with_sht3x

    You can refer to the configuration and overlay files there.

    You can try to change the sleep value in line 284 of main.c. If the sleep is less than 1000ms, an error occurs.

  • I submitted a commit to my github as 'Reading sht3x without Zehpyr driver' and he was able to read the temperature and humidity at a very high speed, but with the Zehpyr Sht3x driver, you have to wait for a second to get the value.

Related