Skip to content

Commit afd8d06

Browse files
authored
Include delay until data is expected to be ready
Without this delay the host is sending continuous read requests to the sensor. However the sensor is busy producing the data and does not respond to those requests. Observations with an oscilloscope indicate that each request deteriorates the SDA and SCL and potentially affects the sensor's and potentially the hosts' life time. SCA and SCL signal high level decreases and fluctuates when 0x40(R) is produced, indicating that hosts can not maintain a stable signal level on the i2c bus.
1 parent d42c36e commit afd8d06

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_htu21d.py

+2
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ def relative_humidity(self):
9797
"""The measured relative humidity in percent."""
9898
self.measurement(HUMIDITY)
9999
self._measurement = 0
100+
time.sleep(0.016)
100101
return self._data() * 125.0 / 65536.0 - 6.0
101102

102103
@property
103104
def temperature(self):
104105
"""The measured temperature in degrees Celcius."""
105106
self.measurement(TEMPERATURE)
106107
self._measurement = 0
108+
time.sleep(0.050)
107109
return self._data() * 175.72 / 65536.0 - 46.85
108110

109111
def measurement(self, what):

0 commit comments

Comments
 (0)