DHT11 + ESP8266 | Time Out Error | -999 return value

Hello everyone!

I’ve been playing around with some of the microcontrollers and sensors I have at home.
I’m currently using the following setup:
KY-015 Temperature Humidity Sensor Module (DHT11)
ESP8266-01

I’ve got the ESP8266 hooked up to my computer with a micro usb.
The pins are connected like this:
The 5V pin from the ESP is connected to a breadboard. From there it further connects to the Sensor (middle pin). It also connects a 10k resistor with the datapin from the sensor as well as a connection back to the ESP. Last but not least, the GND from the ESP is hooked up with the GND from the sensor as well.
I’ve been following this tutorial here: Tutorial (I used the examples on the github page and adjusted them to fit for my sensor instead)

Here is the code that is currently running on my ESP:
My code
And attached is a screenshot of the exact output I’m getting

The problem I’m currently encountering is apparently a Time out error. Everytime the ESP checks the sensors humidity, it’s return value is always -999. Everything else appears to be working just fine (the website, graph, etc)

I’ve searched far and wide but couldn’t really find an answer to the problem. Hopefully someone on here can enlight me?

What I’ve tried so far:

  • Used an Arduino Uno - return values were fine
  • Tried different libraries (first worked with DHT-sensory-library, currently trying with DHTstable)
  • Different Pin-layouts

Thank you and have a nice day!

Capture.PNG

I've searched far and wide but couldn't really find an answer to the problem. Hopefully someone on here can enlight me?

Wrong voltage. The ESP runs on 3.3V. If you power the DHT11 with 5V it's data pin will have the same voltage. This might have fried your ESPs data pin (you didn't tell us which one you used).

Here is the code that is currently running on my ESP:

Code is posted to this site! We don't follow links to temporary external storage websites. If the code is not posted to the forum we treat it as not available.

pylon:
Wrong voltage. The ESP runs on 3.3V. If you power the DHT11 with 5V it’s data pin will have the same voltage. This might have fried your ESPs data pin (you didn’t tell us which one you used).

Good to know, thanks! I’ve found multiple sites while searching that said to use 5V. I’ll try again with 3.3V.

pylon:
Code is posted to this site! We don’t follow links to temporary external storage websites. If the code is not posted to the forum we treat it as not available.

I did try to copy my code into the original post but when trying to publish, I was told that I had exceeded the character limit. That’s why I created a pastebin link. Sorry if that was not right, most forums have different etiquettes on how to post code, and since the majority seems to prefer having code posted to pastebin, I went that way.
Is there any alternative way I could upload the code?

Is there any alternative way I could upload the code?

You can attach the code to post if it's too large to be included into the text.