Hello everyone.I would like to help me if you could.
Well the problem is that i want to count temperature with accurate 1 digit.Ok until now?
I was looking Arduino's site and i found the dht11 and dht22 library.
#include <dht.h>
dht DHT;
#define DHT22_PIN 16
void setup()
{
Serial.begin(9600);
Serial.println("DHT TEST PROGRAM ");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHT_LIB_VERSION);
Serial.println();
Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}
void loop()
{
// READ DATA
Serial.print("DHT22, \t");
int chk = DHT.read22(DHT22_PIN);
switch (chk)
{
case DHTLIB_OK:
Serial.print("OK,\t");
break;
case DHTLIB_ERROR_CHECKSUM:
Serial.print("Checksum error,\t");
break;
case DHTLIB_ERROR_TIMEOUT:
Serial.print("Time out error,\t");
break;
default:
Serial.print("Unknown error,\t");
break;
}
// DISPLAY DATA
Serial.print((float)DHT.humidity);
Serial.print(",\t");
Serial.println((float)DHT.temperature);
delay(1000);
The dht11 library works fine but i don't have accurate result like:
23.5 C
28.7 C etc.
On the other hand dht22 works too but i'm taking results like :
e.g
Humidity %, Temperature C
1166.20 692.2
1484.60 716.8
Could you help me to corrext my problem please???
My Arduino is ATMEGA 2560
and my dht sensor is the Grove - Humidity & Temperature sensor v1
http://www.seeedstudio.com/wiki/Grove-_Temperature_and_Humidity_Sensor
An other test example which displays me the same result is the source code from this site:
http://www.ajpdsoft.com/modules.php?traducir=es-en&name=News&file=article&sid=572#programasensorarduino
I can't understand why dht22 lib displays these results.
Thanks a lot!