DHT22 Problem
Moderators: grovkillen, Stuntteam, TD-er
DHT22 Problem
Hello
I use the R57 version. Also in the previous versions of the problem occurred.
On GPIO 14 I have a DHT 22 sensor is connected.
Unfortunately only 11,20 appear to temperature.
Hygro is 29.3%.
The values correspond to about half the correct values
Why is that? What could be the problem?
A 18B20 sensor working properly
I use the R57 version. Also in the previous versions of the problem occurred.
On GPIO 14 I have a DHT 22 sensor is connected.
Unfortunately only 11,20 appear to temperature.
Hygro is 29.3%.
The values correspond to about half the correct values
Why is that? What could be the problem?
A 18B20 sensor working properly
Re: DHT22 Problem
low voltage could be an issue. do you have a pull-up resistor on the data pin?
Re: DHT22 Problem
Hi
The voltage is 3.5 volts
The resistance between VCC and the Data pin is 4.7K
The voltage is 3.5 volts
The resistance between VCC and the Data pin is 4.7K
Re: DHT22 Problem
I had a similar issue where it would read about half value every few minutes on R39 but updating to never version fixed it.
Other things to try would be a different pin on the ESP, reset command from the serial interface and flash the latest github revision again to do everything fresh.
Other things to try would be a different pin on the ESP, reset command from the serial interface and flash the latest github revision again to do everything fresh.
Re: DHT22 Problem
another GPIO I have already tested without success
How does the reset command from the serial Interace?
How does the reset command from the serial Interace?
Re: DHT22 Problem
in arduino software under tools menu open serial monitor and type reset and press enter, esp will reboot to factory default config.
-
- Normal user
- Posts: 18
- Joined: 08 Oct 2015, 18:02
Re: DHT22 Problem
I also get false readings from AM2302(similar to DHT22), 5k1 resistor to data pin, 3.7v power(single liion cell).
Using this in deep sleep mode, i think the priblem is in a sensor work after *awake* from sleep. temperature readings are 4 degrees error - humidity 50% error. Many people on the web report problems with am2302/dht22.
Solution - i ordered SI7021 and BME280 for my deepsleep mode sensors.
Using this in deep sleep mode, i think the priblem is in a sensor work after *awake* from sleep. temperature readings are 4 degrees error - humidity 50% error. Many people on the web report problems with am2302/dht22.
Solution - i ordered SI7021 and BME280 for my deepsleep mode sensors.
Re: DHT22 Problem
VasilijHCN wrote:I also get false readings from AM2302(similar to DHT22), 5k1 resistor to data pin, 3.7v power(single liion cell).
Using this in deep sleep mode, i think the priblem is in a sensor work after *awake* from sleep. temperature readings are 4 degrees error - humidity 50% error. Many people on the web report problems with am2302/dht22. .
I am experiencing the same - however my module isn't running with deepsleep. I have using AM2302/DHT22 on other ESP8266 modules, with the russian (wifi-iot.ru) software and it's been very reliable, as long as the power is 3.3V - if it drops just slightly below 3.3 it doesn't work and AM2321 or Si7021 is a better fit
- Jan
Jan Chrillesen, Denmark
Re: DHT22 Problem
Same here. I have an AM2320, which runs fine with an Arduino. No results with ESP8266 (nan),
Strange, a DHT11 is running fine with the ESP8266.
Strange, a DHT11 is running fine with the ESP8266.
Re: DHT22 Problem
Same problem here with DHT22 sensors.
I tried two different sensors with multiple boards type ESP-01 and ESP-12. The vallues are allways 0.00.
When i try it with LUA-code its working.
Any suggestions? I would really like to continue with ESPEASY.
I tried two different sensors with multiple boards type ESP-01 and ESP-12. The vallues are allways 0.00.
When i try it with LUA-code its working.
Any suggestions? I would really like to continue with ESPEASY.
Re: DHT22 Problem
Fill in any IDX number not being zero ??
other people, same problem, maybe here?
http://www.esp8266.nu/forum/viewtopic.p ... =755#p3685
or
http://www.esp8266.nu/forum/viewtopic.php?f=5&t=798
other people, same problem, maybe here?
http://www.esp8266.nu/forum/viewtopic.p ... =755#p3685
or
http://www.esp8266.nu/forum/viewtopic.php?f=5&t=798
Re: DHT22 Problem
Helm wrote:Same problem here with DHT22 sensors.
I tried two different sensors with multiple boards type ESP-01 and ESP-12. The vallues are allways 0.00.
When i try it with LUA-code its working.
Any suggestions? I would really like to continue with ESPEASY.
Did you select : DHT Type = "DHT22" in the task-setting of the device tab, and press 'Submit' ?
When you leave it default it will select DHT11 and this will not work.
Re: DHT22 Problem
Bingo, the missing IDX number was the problem.
That cost me some time, thank you tozett for the hint.
That cost me some time, thank you tozett for the hint.
-
- Normal user
- Posts: 31
- Joined: 09 Feb 2016, 22:16
Re: DHT22 Problem
Are you shure that you have connected the right gpio? The pinnumber is not the same as the gpio number (on nodemcu v1 d7 pin is not gpio 7 but 13). I got the "nan" status because of this.orca30 wrote:Same here. I have an AM2320, which runs fine with an Arduino. No results with ESP8266 (nan),
Strange, a DHT11 is running fine with the ESP8266.
-
- New user
- Posts: 7
- Joined: 16 Mar 2016, 20:01
Re: DHT22 Problem
Hi.
If your DHT11/22 reads most of the time 'nan', you have to change a value in the source code of _P005_DHT.ino, around line 98.
Change from "delayMicroseconds(40)" to "delayMicroseconds(20);" :
The value 40 has to be changed to 20, as 40 microseconds is the maximum, and 20 the minimum. Choosing to use the maximum value as not a good choice. I think it really should be changed in the Github trunk code...
If your DHT11/22 reads most of the time 'nan', you have to change a value in the source code of _P005_DHT.ino, around line 98.
Change from "delayMicroseconds(40)" to "delayMicroseconds(20);" :
Code: Select all
pinMode(Plugin_005_DHT_Pin, OUTPUT);
// DHT start condition, pull-down i/o pin for 18ms
digitalWrite(Plugin_005_DHT_Pin, LOW); // Pull low
delay(18);
digitalWrite(Plugin_005_DHT_Pin, HIGH); // Pull high
delayMicroseconds(20); // was 40. With 40, sensor returns NaN most of the time...
pinMode(Plugin_005_DHT_Pin, INPUT); // change pin to input
delayMicroseconds(10);
Re: DHT22 Problem
Seems good in r90 
Edit: woops, is in fact r90...

Edit: woops, is in fact r90...
Last edited by cherowley on 20 Mar 2016, 14:35, edited 1 time in total.
Re: DHT22 Problem
Changed another timing setting in DHT plugin. I got a few incorrect values in the domoticz chart (half the actual value). Seems fixed now in R90.
Re: DHT22 Problem
So, I got the DHT22 and the DHT11 running with a home-brew ESP8266 + USB adapter for power supply. Now I have a NodeMCU board on which I connected the DHT 22 and DHT 11.
I am using pin D7 (GPIO13), I have set the index and the DHT type correctly. I have applied the patch below (set DelayMicroseconds to 20). However, I get NaN most of the time and (very) seldom strange values from the DHT11 (12 degrees instead of 22).
Is it a problem with the 3,3v supply of the NodeMCU board? Did anybody manage to get the DHTs to run with the NodeMCU?
regards,
orca30
I am using pin D7 (GPIO13), I have set the index and the DHT type correctly. I have applied the patch below (set DelayMicroseconds to 20). However, I get NaN most of the time and (very) seldom strange values from the DHT11 (12 degrees instead of 22).
Is it a problem with the 3,3v supply of the NodeMCU board? Did anybody manage to get the DHTs to run with the NodeMCU?
regards,
orca30
-
- Normal user
- Posts: 51
- Joined: 15 Sep 2016, 00:20
Re: DHT22 Problem
I had same problem, you must fill in IDX number, after that works, but this should be fixed.
Re: DHT22 Problem
Please check the voltage going to the DHT-11, and check the data sheet for it as well. It requires a pullup resistor and recommends a capacitor.
I have a nodeMCU(v1) and DHT-22 with a 2A wallwart which puts out 5.5V and I have a big capacitor on the 3.3V rail. Works better, but I think the AMS1117 and diode cut it down too much for the DHT-11 if you do not have really good power. I don't have problems when I use better voltage regulators.
If you really want to stick with NodeMCU I would suggest a BME-280.
I have a nodeMCU(v1) and DHT-22 with a 2A wallwart which puts out 5.5V and I have a big capacitor on the 3.3V rail. Works better, but I think the AMS1117 and diode cut it down too much for the DHT-11 if you do not have really good power. I don't have problems when I use better voltage regulators.
If you really want to stick with NodeMCU I would suggest a BME-280.
-
- Normal user
- Posts: 51
- Joined: 15 Sep 2016, 00:20
Re: DHT22 Problem
My DHT22 is running now a few hours, but the Humidity reading is too high:


Re: DHT22 Problem
I usually have that problem with the DHT11, but no the DHT22... Could be a bad sensor. No idea if all the manufactures test them before they send them out.
Might be cheaper to use a more expensive and reliable sensor.
Might be cheaper to use a more expensive and reliable sensor.
-
- Normal user
- Posts: 51
- Joined: 15 Sep 2016, 00:20
Re: DHT22 Problem
I am now trying to calibrate. 24hour with salt in a jar - it should be around 75%. Then I try to put in a jar filled with water - it should be around 100%.
SI7021 seem to be accurate out of the box.
BMP280 - is measuring +1C out of the box
BMP180 - temp OK, pressure little bit different than BMP280 (+-1hPa) who knows what is closer to reality.
SI7021 seem to be accurate out of the box.
BMP280 - is measuring +1C out of the box
BMP180 - temp OK, pressure little bit different than BMP280 (+-1hPa) who knows what is closer to reality.
Re: DHT22 Problem
Hi adrianmihalko,adrianmihalko wrote: ↑28 Sep 2016, 20:27 I am now trying to calibrate. 24hour with salt in a jar - it should be around 75%. Then I try to put in a jar filled with water - it should be around 100%.
SI7021 seem to be accurate out of the box.
BMP280 - is measuring +1C out of the box
BMP180 - temp OK, pressure little bit different than BMP280 (+-1hPa) who knows what is closer to reality.
I know it's an old post, but...
Did you managed to solve the AM2320 LOW humidity reading without calibration?
I bought 6pcs of it, 2pcs from one seller and 4pcs from another!
First I thought that the sensors are defective regarding the humidity measurement results.
All my sensors attached to one ESPEasy unit are measuring almost the same humidity level from 47% to 51% (HTU21D, SI7021, AM2301, DHT11, DHT22), but those AM2320 sensors always measuring to LOW humidity level from 31% to 33% again attached to the same device.

The AM2320 temperature reading is fine, but the humidity reading are just terrible!
Maybe it's a library issue?
Also, I managed to develop a plugin for the AM2320 sensor on the I2C bus, but again, I got to LOW humidity readings.
Any thoughts?
Kind regards,
Viktor
Who is online
Users browsing this forum: Ahrefs [Bot] and 20 guests