That's probably a glitch in the data transmission.
You can eliminate those by keeping a running average of the last 5-10 readings and comparing any new reading to that average. If the difference is really big, you can ignore the reading or take another one.
Adafruit DHT library is broken?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
- herge
- Posts: 30
- Joined: Sat Feb 11, 2017 1:52 pm
Re: Adafruit DHT library is broken?
Ok I agree with your proposal ; do you have any arduino code or html link to solve this problem ?
Thanks
Thanks
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Adafruit DHT library is broken?
Not specifically, but the code isn't hard:
Code: Select all
average = (( average * 9 ) + latestReading ) / 10;
- herge
- Posts: 30
- Joined: Sat Feb 11, 2017 1:52 pm
Re: Adafruit DHT library is broken?
ok for the average formula... but I guess it's not enough... would you have the complete code including probably a comparision test with maximum autorized gap ...?
Thanks in advance
Thanks in advance
Please be positive and constructive with your questions and comments.