Hi James! How are you powering the DHT22 with 5V or 3.3V? What’s the error message that you see in the Arduino IDE Serial monitor?
The set up is exactly like you show in your course. I’m basically getting ‘Nan’ though your scratch prints ‘failed’. I used a different DHT library without failed readings.
But can you double-check and let me know. How are you powering the DHT22 with 5V or 3.3V?
Thanks for your patience,
Rui
Hum… Can you try to power it with 5V (with the Vin pin)? How are you powering your ESP32 board with a USB port from your computer?
Hello
I have such problem too. My ESP32 and AM2302 don’t work with DHT.h .The sensor work well with Arduino board.
I try the ESP32 and AM2302 with libraries DHTesp.h and Ticker.h (exaples from github.com). Examle work well. I think, that it is need to correct time intervals in library DHT.h.
I am sorry, my English is imperfect.
Ceslavas
Hello Ceslavas. Can you try to power it with 5V (with the Vin pin)?
How are you powering your ESP32 board with a USB port from your computer?
Yes, I do. I try power sensor with 3,3 in first, then from 5V. The answer was “Nan” both times. I am powering ESP32 with USB port from computer.
The examples with libraries “DHTesp.h” and “Tickers.h” I try with 5V only .
Did those examples work with your ESP “DHTesp.h”?
Can you try to power your ESP32 with an external power source or with like a phone charger to see if it’s a power problem.
Thanks!
I don’t understand what happened. ESP32 and AM2302 begin work with DHT.h when I trying it again today. I wantetd to load a program at first so I powered ESP32 with USB port from computer. Program with DHT.h begin work well ! I did not renew the schemes. Many times I loaded the programs with DHT.h and DHTesp.h a few days ago. ESP32 and AM2302 don’t worked with DHT.h. I wonder how it will be tomorrow?
Forgive me for unnecessary disturbance.
Hello, so is it working now? The DHT can crash due to poor wiring (unstable cables that might get disconnected) or insufficient power…
Hello,
I have the same problem. The DHT22 works well with Arduino UNO.
With ESP32 not.
I tested it with 3.3V, 5V from ESP32 and I tested it with 5V external power for the DHT22.
I tested also the pin 14 with the code pushbutton_led.py, the pin works.
Also tested with the ESP8266 it works well with 3.3V internal power.
Regards
Franz
Hello Franz, I need a few more details:
- How are you powering your ESP Franz? How much amperage did the external power supply provided?
- Can you add a 10uF to 22uF electrolytic capacitor to your Vin and GND pins?
Does that work for you? Thanks!
Hello Rui,
the powersupply provides 2000mA / 5V, connected to the micro USB.
I tested it with 3.3V and 5V for the DHT22 and with 10µF and 20µF.
No succes. I get always “Failed to read sensor”. Again: with EPS8266 it works.
Regards
Franz
Heureca!
I tested the same configuration with the scetch from:
ESP32 DHT11/DHT22 Web Server – Temperature and Humidity using Arduino IDE
It works fine
And it works with 3.3V and 5V connected with USB – PC and without capacitors and no additional powersupply. Power consumption is 0.138A
Summary:
I tested the DHT22 with ESP32 and ESP8266-12E and I tested it with microPython-Code from the course and the Arduino IDE with Your code three posts before.
Also I tested it with different power (3.3V and 5V) and with added capacitors.
The ESP32 and DHT22 don’t works with microPython!!
But it works with Arduino IDE.
And it works with ESP8266 microPython and Arduino IDE
And now:
Suddenly I can’t flash the ESP32 with MicroPython anymore. But with the Arduino IDE I can program the ESP32.
The serialmonitor gives a read error on 0x1000.
I’m sorry
regards Franz
Hello Franz, there seems to be multiple problems that you’re having and to be honest I can’t replicate those on my end. When the DHT11/DHT22 failed to read from DHT sensor doesn’t work, it’s usually:
- Power issue
- Wrong wiring
- Faulty DHT
- Faulty ESP8266
Please read our DHT11/DHT22 Troubleshooting Guide.
I’ve re-tested the code on my ESP (both with Arduino IDE and MicroPython) and it works for me. Once in a while, one of the reading fails, but after that it starts reading again.
The problems that you’re facing are an unknown reason for me and I would have to personally test your circuit. Based on that information I don’t know what it can be…
The “The serialmonitor gives a read error on 0x1000.” seems like you didn’t flash the MicroPython firmware to the ESP32 in the right address.
The MicroPython firmware for the ESP32 must be flashed in that address (0x1000).
Thank you for your patience throughout this process. Regards,
Rui
Hello Rui,
Thank you for your!!! patience.
It seems, I found the solution. I bought a new breadboard.
Now it works.
Thanks again
I’m glad it’s working now! It was probably some wiring issue. I’ll mark this thread as resolved, if you have more questions feel free to post them here: https://rntlab.com/ask-question/