DHT11 Giving Zero Values

Hello. I am a professor evaluating the Grove family of products for a course and having difficulty getting my particular setup to work. The sensor only returns a value of 0 for both temperature and humidity.

I am using an Arduino MKR 1010 with the Arduino MKR Connector Carrier, connected to a Grove DHT11 sensor. In order to test it, I followed the instructions on the product page to download the DHT Library and run the DHTtester example code. The only modification I made was to uncomment the:
#define DHTTYPE DHT11
line and comment out the:
//#define DHTTYPE DHT22
Troubleshooting steps:

  • Changed every component of the setup out twice, reprogramming between changes.
  • Tried every configuration change available in the code, including changing the cable to all of the connectors between D2-D6 (Note that a warning is printed if the cable is plugged anywhere except D2, but gives only 0 values when plugged into D2, suggesting that it is plugged into the right port).
  • Tried using Arduino Web programmer instead of the desktop IDE but the source code does not even compile on the Web programmer due to several different errors, including “Wire” not being declared in the scope.

Update: Adafruit’s DHT Library works right out of the gate. I ditched the Grove library for the Adafruit library and we’re back in business.

I would still appreciate any assistance about why Grove’s library doesn’t work. I would like to know if it is a compatibility issue or just a broken library.

Hello, thank you very much for your detailed description. I just tested DHT11 according to the situation you provided, and the result of the test is that the library is no problem. I also went to the official site to check that the chip of the Arduino MKR WiFi 1010 board is SAMD21. There should be no problem with the compatibility of our library. The suggestion I can give you is to use other development boards to test whether the data can be read. If you still cannot prove that DHT11 works normally, you can contact the technical support mailbox to apply for return and exchange processing, thank you.