Skip to content

Commit 85a02c7

Browse files
committed
Removed "End the start signal by setting data line high for 40 microseconds"
Reference: adafruit#48 (comment)
1 parent edcd0e0 commit 85a02c7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: DHT.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,13 @@ boolean DHT::read(bool force) {
152152
InterruptLock lock;
153153

154154
// End the start signal by setting data line high for 40 microseconds.
155-
digitalWrite(_pin, HIGH);
156-
delayMicroseconds(40);
157-
155+
// digitalWrite(_pin, HIGH);
156+
// delayMicroseconds(40);
157+
// WEB: This is an error. DHT tries to pull the line low as soon as it came back to high.
158+
// therefore the low-high transition after the start signal "low" needs to be realised by
159+
// the pullup resistor only, uC pin must already be in INPUT mode.
160+
// ref: https://github.com/adafruit/DHT-sensor-library/issues/48#issue-119801608
161+
158162
// Now start reading the data line to get the value from the DHT sensor.
159163
pinMode(_pin, INPUT_PULLUP);
160164
delayMicroseconds(10); // Delay a bit to let sensor pull data line low.

0 commit comments

Comments
 (0)