Grove expansion temperature and humidity sensor

Hello Again,

Still looking at the expansion box with very limited support. The only sensor that I have got working is PIR so far and the display.

Here is my code for the temperature sensor… it compiles, doesn’t crash the processor thankfully, but simply fails to get any values?

I changed the type of sensor to D11, because it told me it was a D11; can not seem to see any indication on the board itself.

The pack I am playing with is …oddly the pack says it has a DHT20 and my code is telling me I got a DHTD11

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
//#include "Wire.h"
#include "DHT.h"
#define DHTTYPE DHT11   // DHT 20
/*Notice: The DHT10 and DHT20 is different from other DHT* sensor ,it uses i2c interface rather than one wire*/
/*So it doesn't require a pin.*/
DHT dht(DHTTYPE);         //   DHT10 DHT20 don't need to define Pin

#if defined(ARDUINO_ARCH_AVR)
    #define debug  Serial

#elif defined(ARDUINO_ARCH_SAMD) ||  defined(ARDUINO_ARCH_SAM)
    #define debug  SerialUSB
#else
    #define debug  Serial
#endif

Hi,

Here are the corresponding wiki pages for DHT11 and DHT20:

1 Like