DHT22 with wemos D1

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
remko2000
Normal user
Posts: 65
Joined: 28 Dec 2017, 15:56

DHT22 with wemos D1

#1 Post by remko2000 » 06 Oct 2019, 19:58

I use a wemos D1 with a loose DHT22 to measure humidity. I connect the dht22 with a 10K resistance. Pin 3 (NC) is not connected. I use GPIO 14 for data. I also have tried different esp megabuilds. I also tried to power the dht22 with 5V and 3,3V. I nothing change to the part 'hardware' in esp. Everything I try results in the same problem: within a couple of hours I get 'nan' as value. I googled on this problem but I don't see a clear solution. I am about to give up but maybe someone here have a solution?

TD-er
Core team member
Posts: 3408
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DHT22 with wemos D1

#2 Post by TD-er » 06 Oct 2019, 23:23

Please have a look at the more recent discussions about this in the GitHub issues list: https://github.com/letscontrolit/ESPEas ... open+dht22

remko2000
Normal user
Posts: 65
Joined: 28 Dec 2017, 15:56

Re: DHT22 with wemos D1

#3 Post by remko2000 » 08 Oct 2019, 14:27

thats more recent yes but I see no solution. The last build have problems with the dht22 too so what can I do?

TD-er
Core team member
Posts: 3408
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DHT22 with wemos D1

#4 Post by TD-er » 08 Oct 2019, 14:30

You can revert to an older build of about a month ago, to see if the current issue is caused by one of the more recent changes.
If not, then it is not yet fixed.
I know Uzi18 was working on it, but I have no idea what the current status is.

chromo23
Normal user
Posts: 13
Joined: 10 Sep 2020, 16:02

Re: DHT22 with wemos D1

#5 Post by chromo23 » 19 Sep 2020, 14:26

Same problems here. Except that i use a Sonoff S20.
Did you ever find a solution?
I need to do a hardware restart? but thats not the best workaround for such a device. :|

User avatar
Ath
Normal user
Posts: 245
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DHT22 with wemos D1

#6 Post by Ath » 19 Sep 2020, 15:03

What version of ESPEasy is installed on the Sonoff S20?

Does the DHT22 have a pull-up resistor installed? (the internal pull-up resistor of the ESP is too high, should be 4k7 - 10k)
Did you disable the serial port?
What error(s) do you see in the web log?
/Ton

TD-er
Core team member
Posts: 3408
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DHT22 with wemos D1

#7 Post by TD-er » 19 Sep 2020, 16:51

Ah you also mentioned it here...
Same questions though :)

What is needed to make it work again? Save the settings of the task again, or do you need a power cycle?

chromo23
Normal user
Posts: 13
Joined: 10 Sep 2020, 16:02

Re: DHT22 with wemos D1

#8 Post by chromo23 » 19 Sep 2020, 21:18

Unfortunately i need to power cycle. No clue in the log.
extra pullup an 100nf across the powerrail are present.
harware is sonoff s20. gpio3(rx) is used and i also tried gpio4.

i don´t believe its related but after a while i get this "FS : Error while reading/writing config.dat in 933"
this problem disappears when i reload the settings via the config.dat so it´s maybe not hardware related?
Last edited by chromo23 on 19 Sep 2020, 21:34, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 245
Joined: 10 Jun 2018, 12:06
Location: NL

Re: DHT22 with wemos D1

#9 Post by Ath » 19 Sep 2020, 21:28

You might want to replace the Sonoff (or its flash chip), as this looks hardware related. Got another guinee pig to test?
/Ton

TD-er
Core team member
Posts: 3408
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DHT22 with wemos D1

#10 Post by TD-er » 19 Sep 2020, 21:33

Is it posioned in above average humidity?

chromo23
Normal user
Posts: 13
Joined: 10 Sep 2020, 16:02

Re: DHT22 with wemos D1

#11 Post by chromo23 » 19 Sep 2020, 22:42

Ath wrote: 19 Sep 2020, 21:28 You might want to replace the Sonoff (or its flash chip), as this looks hardware related. Got another guinee pig to test?
no...not here where i am right now. but i will try tor replace the flash chip when nothing works.
TD-er wrote: 19 Sep 2020, 21:33 Is it posioned in above average humidity?
i am not sure what you mean by that?
but if you mean, that it always gives readings that are around 10-15 percent higher than they supposed to be, than yes. but that seems to be a disease of every dht22/am2302

TD-er
Core team member
Posts: 3408
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: DHT22 with wemos D1

#12 Post by TD-er » 19 Sep 2020, 22:45

No, what I mean is what's the humidity of the environment where the module is positioned.
For example, is it positioned in an evironment where the relative humidity is above 80%?

chromo23
Normal user
Posts: 13
Joined: 10 Sep 2020, 16:02

Re: DHT22 with wemos D1

#13 Post by chromo23 » 19 Sep 2020, 23:22

TD-er wrote: 19 Sep 2020, 22:45 No, what I mean is what's the humidity of the environment where the module is positioned.
For example, is it positioned in an evironment where the relative humidity is above 80%?

no. it is inside and only was once above 80.

Ton_vN
Normal user
Posts: 173
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: DHT22 with wemos D1

#14 Post by Ton_vN » 20 Sep 2020, 10:48

See https://www.letscontrolit.com/wiki/inde ... HT11_DHT22
and also https://randomnerdtutorials.com/esp8266 ... nce-gpios/

Perhaps kicking open doors, but
- why connected DHT22-data to GPIO3 or GPIO4 of the WEMOS?
Suggested to follow the example of the setup as described in the 1st weblink above.
The 2nd weblink explains why certain pins should better be avoided, unless you are well aware of the consequences.
- did you also set the related GPIO as match in the setup under the device-tab for the DHT22?

chromo23
Normal user
Posts: 13
Joined: 10 Sep 2020, 16:02

Re: DHT22 with wemos D1

#15 Post by chromo23 » 21 Sep 2020, 13:02

I found a workaround for me. It’s called bme280 :D
Just read the specs of the DHT22:
"With 3.3V supply voltage, cable length shall not be greater than 100cm."

Mine was nearly 2,5 meters.
But apart from this i often had problems with the dht22/am2302. Often i got faulty units or the measured values where completely wrong or shifting heavily over time.
I guess i stay with the bme280.....

thank you for the help!

Ton_vN
Normal user
Posts: 173
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: DHT22 with wemos D1

#16 Post by Ton_vN » 23 Sep 2020, 10:47

;-) Be aware of the characteristics of the I2C-interface as applied by the BME280!
Also this interface is not intended to have long cabling.
If using the 3.3V from WEMOS to power the BME280, therefore cable length should not be exaggerated.
Your cable length of 2.5m probably can be handled, but sometimes attention to be paid to selection & fitting of pull-up resistors for the SCL- and SDA-lines:
explanation for proper configuration can be found on internet.
Sometimes addition of an I2C-buffer may help, dividing the I2C-bus in 'manageable' segments.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests