Jump to content
Roger

Problem with DHT22

Recommended Posts

I can not get the DHT22 libray to work with my devices(I have two of them). I am just learning C but I think it is a timing issue with my devices. This is what I get when I run test sketch from the libary.

 

debug     bits received     35
debug     42, 0, 1D, 5F, 4 =? BE
debug      checksum     NO
debug     RH%     16896
debug     oC     7519
Failed to read from DHT
 

DHT22_430.cpp

DHT22_430.h

DHT22_430_main.ino

Share this post


Link to post
Share on other sites

I was able to get  the sensor to work but I had to edit the .cpp file where it pulled the data pin low for 20ms to start the data transfer. I changed it to 2 ms. I know that is not what the data sheet says but that is what worked.

 

 pinMode(_pin, OUTPUT);
  digitalWrite(_pin, LOW);
  delay(2);//changeg from 20ms

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...