cancel
Showing results for 
Search instead for 
Did you mean: 

interfacing DHT22 sensor with stm32f411re

Reva1605
Associate

I am trying to interface DHT22 sensor with STM32F411RE board. When initially I interfaced I was able to see data (i.e., Temp and Humidity) I am giving 3.3v power supply, data pin connected to PA0 ground and set clock frequency to 50MHZ using Internal oscillator. But when now I am trying to check values, I am not able to get values I haven't change anything in code still I am facing this issue. The code is stuck in while loop of DHT22_response function where it is waiting for pin to be low. I have attached coding file please can anyone help me regarding this??

4 REPLIES 4
STackPointer64
ST Employee

Hello @Reva1605,

Have you tried connecting a pull-up resistor to the data line? Without it, the DHT11 may not be able to pull the line HIGH.

Best regards,

To improve visibility of answered topics, please click Accept as Solution on the reply that resolved your issue or answered your question.
Reva1605
Associate

Yes tried connecting pull-up resistor of value 4.7k still not working

STackPointer64
ST Employee

So, to understand correctly, you created a project and added the functions to interface with the DHT22 sensor. Initially, it worked, but after rebuilding and testing the project again, it got stuck in the DHT22_response function? Have you tried supplying 5V to the sensor or using a different GPIO pin instead of the wakeup pin PA0?

To improve visibility of answered topics, please click Accept as Solution on the reply that resolved your issue or answered your question.
Andrew Neil
Super User

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

In particular, please describe:

  • What board you are using
  • Show schematic of how the DHT22 is connected
  • Show some good, clear photos of your setup
  • Describe what testing/investigation/debugging you've done so far;
    eg, have you looked at the signal line on an oscilloscope?

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.