-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DHT22 sensor. #2
Comments
@mbeacom No plan, I have no time to play, 😄 |
Honestly, I was just excited to see your DHT11 package, since I've been following you on GH as of lately and I'm in the middle of working on a personal, side project using the DHT11 and 22s. Haha Regardless, Thanks for everything @winlinvip ! |
So you are using Arduino to Sample the temperature and humidity by DHT11/22? |
👍 Ongoing sampling with a raspberry pi and Arduino to monitor temperature/RH! |
It works~ I have done that. You can use Serial for Raspberrypi to communicate with Arduino. https://github.com/winlinvip/SimpleSerial |
It seems the protocol between DHT22 and DHT11 is not very different, I can support DHT22, but I haven't get a DHT22, can you test it for me? The major difference of DHT22 and DHT11 is the startup signal, DHT11 PULL LOW 18ms+, while DHT22 PULL LOW 500us+ or 1ms+. |
@winlinvip I will test the patch sometime this evening and let you know! |
Great, what's the result? |
I'm trying to use this lib with an DHT22 without success. I get error 101 / 102 while trying to fetch temperature. I can make some tests if you want! |
@equake Please do some tests. |
I will refine the protocol according to http://akizukidenshi.com/download/ds/aosong/AM2302.pdf |
I have verify the v1.0.5, it works with DHT11:
With DHT22:
|
Doesn't work below freezing. Returns an absurd answer -2856. This with DHT22. |
* Fixing issue #2 (timing problems Mega2560 r3 + DHT11). Added method for more precise time measurement of the level states. Simplified interface dropping 'pin' from most methods (keeping overloaded methods for interface compatibility). * Adding constructors without parameters (for backward interface compatibility), #2 * Cleaning-up old and debug code, corrected comments, #2 * Default value defined already in .h, #2 * Correcting timing in DHT11:sample(), error threshold value lowered to work properly on ESP2866, #3 * Simplifying the code of the time measurement methods (#2, #3). * Preventing potential inf. loop in levelTime() and levelTimePrecise(), #5 Adjusting pin level times for DHT11, needed after the fix above (-> need to adjust times after any change in the time measurement code...), #3 * Adjusting timing for mega2560_r3 after changes for #5 (also: cont. #2). * Correcing comments / api doc. (#2, #3).
@winlinvip Do you anticipate extending this to support the DHT22 model?
The text was updated successfully, but these errors were encountered: