Hi!
My project is pretty simple. Its about visualizating measured data by DHT11 of temperature and humidity on LCD display (16x2), however the part with measuring doesnt work.
The problem is that DHT11 is returning value -999, which, according to library, should be a DHTLIB_INVALID_VALUE, and then sends the appropriate data of temperature and humidity. This cyclus is repeating (see picures).
This appears on the LCD display, however variable "chk" that I print on the serial monitor returns 2 errors: DHTLIB_ERROR_TIMEOUT and DHTLIB_ERROR_CHECKSUM (see picture).
Probably the only important thing is wire up of the sensor (you sholud be able to see the signs "+", "-", and "out" on the sensor module) and pin 2 of MEGA.
Thank you, apparently this works! Now I can see only the appropriate values on the display. Serial monitor still sometimes shows the DHTLIB_ERROR_CHECKSUM, but it looks much better.
It didnt. I have tried even longer delay as 3 s, but the serial monitor looks like this:
Its strange because the sensor seems working e.g. when I put my finger on it, I can see the change of the humidity immediately (like 3-4s).
This kind of thing can happen when something is marginal; ie, when it's working, it's only barely working - so it only a tiny disturbance to push it over the edge to not working.
Most of the time I receive DHT11: OK, but sometimes I also receive:
... sometimes its pretty often and sometimes its superb rare. This can be particullary solved by DHTNew function setSuppressError():
the library will not output -999 but the last known valid value for temperature and humidity. This flag is useful to suppress 'negative spikes' in graphs or logs.
I would say its fault of the sensor itself (hardware), therefore I will try to find out.