The DHT11 needs perfect timing and the way that the Pi5 works isn't real time.You might have a bad sensor. I once purchased 10 together and 2 of them were bad. One just did not work at all and the other one would frequently not work.
Get another one, if it works, then you'll know the one you have now is flaky/bad.
The best way is to loop around until you get a good answer.
Don't forget to wait 2 seconds in betweens.
if after 10 times you don't have a good value something is really wrong.
Statistics: Posted by danjperron — Fri Aug 23, 2024 10:31 pm