Wemos and DHT11 four pin

  • Hi,

    I would like to get temperature from pure DHT11 device ( four pin , no extra board on it ) i connect to wemos D1 mini, however it doesnt work with any library which i tried..

    otherwise i have to use arduino nano & esp8266 & DHT11.. no need this much device to take temperature and humidity values.. i can buy DHT shields for wemos board however i bought these DHT11 many so that i want to work with these..

    anyone have any idea about it?

  • Have you added a 4.7k resistor across pins VCC and data pins?

  • For the record it should look something like this:

    The usual dht11 library from adafruit worked when I last tried it: https://github.com/adafruit/DHT-sensor-library

    but remember to change the library default from the dht-22 to dht-11 by uncommenting!

  • @manyakos

    @lackdaz has offered good suggestions. One thing I'd add is that if you haven't bought the sensors, you consider switching from the DHT11 to a BME280. The DHT series are less accurate, and their accuracy gets dramatically worse or the sensors fail completely after about two years.

    The BME280 costs a bit more but is still under $4 and is much more stable and reliable.

  • @manyakos I've been "playing" with Wemos / DHT / BME / HTU etc for a year now... my advice DONT buy a Wemos Shield with the sensor / much is writen about this as it is inaccurate as too close to the Wemos / heat.

    I started here - @PaulRB was on the "Old Forum" and this was really useful to get me started.


    Good luck....

  • I have currently running a DHT11 but I don't like only a 1 degree granularity. I wasn't aware of just 2 years warranty.

    I started with the Wemos DHT shield. It has a great accuracy but temperature is always 2 extra degrees. If set as a shield it is unusable.

    I will need to try the BME280.

  • @guillemsola

    If you just need temperature, consider the DS18B20.

  • Thanks @Roo-ster, this one I've seen people using it. Which encapsulate is works better, the water resistant or the transistor like one.

  • @guillemsola
    You can also try DHT22. It is much accurate.
    But BME280 is the best.

  • @guillemsola

    I prefer the one with the metal cap, and not just because it offers some water resistance. These sensors are very sensitive so the added thermal mass makes it respond less to small, temporary temperature changes e.g. from my breath, or when I walk by.

  • @Roo-ster good point the mass to avoid small changes.

  • I would be interested in knowing what is required to get the DHT11 to work with my Wemos D1 (supposedly R2) board too. I can run this device with Blynk only if I set it in the Arduino IDE as the D1 (Retired) board but Blynk can then light an LED on the digital ports 2 thru 7 for me, so it must be pretty close to right. However, when I hook up my DHT11 to an Arduino MEGA 2560 it runs great but the same setup doesn't work on my Wemos D1 board, it never returns the relatively accurate data my MEGA 2560 does, even if I hookup a breadboard power supply to put 5 volts on the DHT11 and then run the signal pin output through a bidirectional level shifter to take it down to 3.3v going back to the Wemos.
    So there is more than the original poster interested, any suggestions?

    Here is a picture link of the board I have, it is advertised as a Wemos D1 R2 ..


  • @SteveMacLeodNS

    The DHT sensors work best at 5V, rather than 3.3, but the ESP8266s don't like 5V. So how should you use a DHT sensor with a 3.3V ESP8266?

    Connect the respective power pins on the DHT sensor to 5V and ground. The Data pin on the DHT never outputs a positive signal on it. It can only pull the pin to ground or release it. So connect the Data pin of the DHT to the input of your ESP8266 and also connect it to a 4.7K or 10K resistor. Connect the other end of the resistor to the 3.3V (not the 5V) power from the Wemos D1.

    In this configuration, the resistor will hold the data pin at 3.3V, which both devices will interpret as a 'high' logic level. When either device has control of the data line, they can do nothing (logic 'high') or pull the line low (logic 'low'); thereby sending and receiving 1s and 0s using different internal voltages.

Log in to reply

Looks like your connection to WEMOS Forum was lost, please wait while we try to reconnect.