BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

DHT11 Sensor Failed to read from DHT sensor

esp8266
hardware
#1

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:

0 Likes

#2

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

Pete.

0 Likes

#3

Did that and this is what im getting

0 Likes

#4

What version of DHT11 are you using?

0 Likes

#5

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

0 Likes

#6

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

#7

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

0 Likes

#8

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

0 Likes

#9

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.

0 Likes

#10

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

0 Likes

#11

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

#12

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

Pete.

0 Likes

#13

thanks a lot, rummaged through a lot of information

0 Likes