-
• #2
Try putting a 1k pullup to Vcc on the data line.
Also, DHT11's are terrible - the temperature is okay, the humidity is very often totally bogus. The DHT22 sucks less. Both of them will instantly fail if you connect power backwards, so don't do that.
I am simply trying to get the DHT11 to display the temperature in the console of the web IDE through my nodemcu. I'm very new at this, but must be doing something wrong. I modified the code found here: http://www.espruino.com/DHT11 It is constantly returning -1 for both temperature and humidity. If I disconnect everything, it still shows "-1" ...so I'm apparently receiving no data?
I've tried to get it working in two ways:
Using "NodeMCU" in the code:
Declaring pins directly:
Attached is a GPIO reference picture that matches my nodemcu.
The DHT11 unit I'm using an Osepp DHT11 unit. More info: http://osepp.com/products/sensors-arduino-compatible/humidity-temperature-sensor/
What am I missing? Do I need some type of resistor in the mix? Have I connected it wrong? This is my first project, an any help you can give me would be greatly appreciated! Thanks!
1 Attachment