Left here for archival purposes.

User avatar
By dimesp
#29695 I also think that the problem is in LUA software. I can't make my DHT22 (AM2302) to work. I 've tired all the software I 've found during two days of searching.
With exact same setup (same connections to nodemcu and sensor) but using SDK examples compiled on Eclipse, my sensor works perfectly.
User avatar
By pzw
#29751 Try to put a 1000uF capacitor between the 3.3V and GND connection... Possibly with a 100nF ceramic capacitor in parallel.. I am using a DHT22 in a small enclosure right next to a ESP-03 and a small switch mode power supply. No interference detected over a period of 48 hrs... But I am using the 1000uF with 100nF capacitors...
User avatar
By adamjennison
#33642 Hi there, I've just got a nodemcu and a dht11.
I spent a few days going with a similar problem of wildly fluctuating temp/humidity readings from the sensors.
I bought two of them and both were all over the place.

It would work sometimes so I figured it must be the timings so I altered all sorts.

Then I realised the CPU could be set to either 80 or 160MHZ - I set it to 160MHZ using (in Lua):
Code: Select allnode.setcpufreq(node.CPU160MHZ)

and it's been super stable ever since.

The timings for reading the sensor posted across the internet all assume a clockspeed of 160MHZ - give it a bash and let me know if it works..