You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • Hm, I'm not sure how bad data could be getting through the module anymore, since (as of the extension of the event buffer) the module actually calculates it's own checksum, and compares it to the one provided by the part.

    DHT22.prototype.endRead = function() {
        clearWatch(this.watch);
        var tcks = this.hout&0xFF;
        tcks+= (this.hout>>8)&0xFF;
        tcks+= (this.tout&0xFF);
        tcks+= (this.tout>>8)&0xFF;
        tcks=tcks&0xFF;
        if (tcks==this.cks && this.hout > 0 && this.tout > 0) {
            var rh=this.hout*0.1;
            var temp=this.tout*0.1;
            if (this.tout&0x8000) {
                temp=temp*-1;
            }
            if (rh < 100 ) {
                return {"temp":temp,"rh":rh};
            }
        }
        return {"temp":-1,"rh":-1};
    };
    
    

    Can you provide a few examples of correct and incorrect data that it's reported?

    I have one that I believe is giving me accurate information while reading around 27.8C and 54.1% humidity.

About

Avatar for DrAzzy @DrAzzy started