From 5ae0eb88ac4ddd14441300b40251ee61c81da78e Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Fri, 8 Nov 2019 20:31:55 +0300 Subject: [PATCH] sensor/dht: increase the delay per DHT22 datasheet Operating specifications / Communication and signal "Data-bus's free status is high voltage level. When communication between MCU and DHT22 begin, program of MCU will transform data-bus's voltage level from high to low level and this process must beyond at least **1ms** to ensure DHT22 could detect MCU's signal, then MCU will wait 20-40us for DHT22's response." --- code/espurna/sensors/DHTSensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/sensors/DHTSensor.h b/code/espurna/sensors/DHTSensor.h index 93bca039..9084f81c 100644 --- a/code/espurna/sensors/DHTSensor.h +++ b/code/espurna/sensors/DHTSensor.h @@ -149,7 +149,7 @@ class DHTSensor : public BaseSensor { if ((_type == DHT_CHIP_DHT11) || (_type == DHT_CHIP_DHT12)) { nice_delay(20); } else { - delayMicroseconds(500); + delayMicroseconds(1100); } digitalWrite(_gpio, HIGH); delayMicroseconds(40);