DHT11 Sensor Failed to read from DHT sensor

Hi so I keep getting “Failed to read from DHT sensor” in the serial monitor and nothing is happening on blynk. So I am very new to blynk and Im trying to display temperature and humidity. So I created 2 gauges one for temperature (V6) and one for humidity (V5) and I’m using the following code: [Here](https://examples.blynk.cc/?board=NodeMCU&shield=ESP8266%20WiFi&example=More%2FDHT11 317)
And here’s my circuit:

Swap your red wire from D2 (GPIO4) to D4 (GPIO2)

Pete.

Did that and this is what im getting

What version of DHT11 are you using?

not sure how can I check ? Thats the one I bought https://cnclablb.com/index.php?route=product/product&product_id=703&search=DHT11

Well the link shows the “hardware” that you have ie DHT11. My question is regarding the library that you using. Looking at your code, the blynk example, you have the:

#include <DHT.h> 

that is the library. IF you use the https://github.com/adafruit/DHT-sensor-library { Adafruit DHTsensor Library }
then you should use release 1.3.1 and not the latest 1.3.4 THAT IS NOT WORKING WITH ESP8266, so, please download the library from this link: https://github.com/adafruit/DHT-sensor-library/archive/1.3.1.zip delete yours and put this.

Is it working now? Please report back

1 Like

No it still gives me failed to read even though I intalled 1.3.1

I see… please post all of your sketch to test it when possible.

I think it’s probably still a wiring problem.
Your photo of the breadboard has quite a few resistors scattered around, none of which are needed for the DHT. I’d suggest stripping everything else out and just having the NodeMCU and the DHT, then double-check the connections are good with a meter.

Pete.

Try this:
#define DHTPIN 2 -----> #define DHTPIN D2

It is quite useless to change the #define, if as per photo it is connected on the D4, it is right #define DHTPIN 2 (which is the GPIO2). Rather check the power supply (use the same color for the VCC and the GND is not the best, in addition to the photo is cut and we can not see if the connection is right).

1 Like

The OP hasn’t been back since 30th March, so I think he’s probably lost interest.

Pete.

thanks a lot, rummaged through a lot of information