-
Notifications
You must be signed in to change notification settings - Fork 8
Need testing on arduino platforms with different sensor types. #1
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
Comments
Hi @ADiea, I am using a SainSmart Mega2560 and a SainSmart AM2302 sensor (DHT22 variant), but your library sadly returns 0.00 for temp and humidity. It probably connects fine, because when it's disconnected, it reports an error. Secondly, the lib from @RobTillaart gives me normal values.. |
Hi @Maxr1998 please enable debug in dht.h and tell me what you get on the console. I also use the AM2302 sensor for testing.
Thanks |
Make sure to use the latest code, I fixed some cornercases |
@ADiea this is my log output atm:
Here's my code, just to be sure: #include "DHT.h"
#define DHTPIN 5
TempAndHumidity th;
DHT dht(DHTPIN);
void setup() {
Serial.begin(9600);
Serial.println("DHT22 test");
dht.begin();
}
void loop() {
delay(2000);
if(!dht.readTempAndHumidity(th)) {
Serial.print("Failed to read from DHT sensor for reason: ");
switch(dht.getLastError())
{
case errDHT_Timeout:
Serial.print("TIMEOUT (no sensor?) \n");
break;
case errDHT_Checksum:
Serial.print("CHECKSUM (are cables secured?) \n");
break;
case errDHT_Other:
Serial.print("UNKNOWN \n");
break;
};
return;
}
Serial.print("Temperature: ");
Serial.println(th.temp);
Serial.print("Humidity: ");
Serial.println(th.humid);
double dp = dht.getDewPoint(DEW_ACCURATE);
Serial.print("Dew point: ");
Serial.println(dp);
} Also, it seems the Arduino IDE doesn't know debugf(), or is my Version just to old (1.5.6 r2)? |
Looking at your sensor's picture on the internet it seems it already has a pullup.... In dht.cpp try replacing the line
with
and write back if this helps... |
Unfortunately I have no other idea at the moment I will try comparing the code to Rob's when I have some free time. |
Ok, thanks for your efforts though :) |
Any updates? |
Nothing yet sorry. I am planning a clean-up and a bit of restructuring of the code to make it simpler but 5B12 not on the priority list unfortunately - so can't promise anything yet |
Hi guys and girls,
This lib needs people with some spare time and Arduino hardware to help test it. Comments are welcome
Cheers!
The text was updated successfully, but these errors were encountered: