Hi all !
I'm writing here because i'm facing a problem that i can't bypass ...
Let me explain :
For those who managed to get the DHT11 (Temperature & Humidity digital sensor) working with the Arduino MEGA2560, let me tell you : GREAT, YOU'RE A BOSS !
My problem :
I make a capture with the "Pulsein()" command to get the duration of the HIGH states.
Based on this, i should be able to gather 41 bits corresponding to :
[1 bit of DHT11 telling communication is about to start] + [8 bits : Integral RH data] + [8 bits : Decimal RH data] + [8 bits : Integral TEMPERATURE data] + [8 bits : Decimal TEMPERATURE data] + [8 bits : Checksum]
The problem is that what i gather looks like this :
81,24,24,24,71,24,23,24,25,24,71,24,23,23,24,24,25,24,70,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
86,23,23,24,70,23,23,24,25,24,71,24,24,24,24,24,25,23,70,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,24,24,24,70,24,24,24,25,24,70,24,24,23,23,24,25,24,70,23,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
86,23,23,24,70,18,23,24,25,24,71,24,24,24,24,24,25,24,71,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,23,23,70,24,24,24,25,24,71,23,23,24,24,24,25,24,71,23,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,24,24,71,23,23,18,24,24,71,23,23,20,24,24,25,23,70,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,24,23,23,70,24,24,24,25,24,71,24,24,24,24,24,25,24,71,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,23,23,70,23,23,24,25,18,70,24,24,24,24,23,24,23,71,24,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,24,24,71,24,24,24,25,24,71,23,23,24,24,24,25,24,70,23,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,24,24,24,71,23,23,24,25,24,71,24,24,23,24,24,25,22,71,24,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,24,24,23,71,23,23,24,25,24,71,24,24,24,24,24,25,24,70,23,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
86,18,24,24,71,23,23,24,25,24,71,24,24,23,23,24,25,24,70,23,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
86,23,23,24,70,24,24,24,25,24,71,24,24,24,24,24,25,23,71,23,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
86,23,23,24,70,24,24,24,25,24,71,24,24,24,23,24,25,24,70,23,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
86,24,23,23,70,24,24,24,25,24,71,24,24,24,24,24,25,24,71,24,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,24,24,69,24,24,24,25,24,70,24,24,24,24,24,25,24,71,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,23,24,70,24,23,24,25,24,71,24,24,24,24,23,24,23,71,23,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,23,24,70,24,24,24,25,24,71,24,18,24,24,24,25,24,64,24,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,23,24,65,24,24,24,25,24,70,24,24,24,24,24,25,24,71,24,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
87,23,23,24,71,23,23,24,25,24,71,23,23,24,20,24,25,24,71,24,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,516
You can have access to the datasheet here : micro4you.com is for sale | HugeDomains
And my code is here based on the code of a greek man :
void setup(){
Serial.begin(9600);
}
void loop()
{
int pin = 2;
int highs[42];
pinMode(pin, OUTPUT);
digitalWrite(pin, LOW);
delay(10);
digitalWrite(pin, HIGH);
delayMicroseconds(30);
pinMode(pin, INPUT);
for (int i=0; i<42; i++) {
highs = pulseIn(pin, HIGH);
- }*
Thank you for your precious help !