Arduino Sensor Kit now with DHT20

Got today my second Arduino Sensor Kit (link Arduino product page)Arduino Sensor Kit.
But surprise the DHT11 module was replaced by a DHT20 i2C module.

How is this possible???

How is it possible? When parts are upgraded kits eventually go to the new part. The DHT 20 is nice because it uses a I2C data transfer protocol. Looking around you will find code samples like this one. You will find the DHT 20 library here. The DHT 20 offers some nice improvements over the DHT 11 and DHT 22 family.


1 Like

Created following Example:

#include "Arduino_SensorKit.h"
#define DHTTYPE DHT20   // 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

void setup() {
    Serial.println("DHTxx test!");
void loop() {
    float temp_hum_val[2] = {0};
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)

    if (!dht.readTempAndHumidity(temp_hum_val)) {
        Serial.print("Humidity: ");
        Serial.print(" %\t");
        Serial.print("Temperature: ");
        Serial.println(" *C");
    } else {
        Serial.println("Failed to get temprature and humidity value.");

Thanks for your sketch. I am getting:
error: 'DHT20' was not declared in this scope
#define DHTTYPE DHT20 // DHT 20
when I run your sketch. Do I need to modify anything in Arduino_SensorKit.h or Arduino_SensorKit.cpp?

Same compiling issue here. The DHT20 is a new i2c based device and does not appear to be supported in the Arduino Sensor Kit library for some reason.

However, I have had success with this Adafruit library:

(Yes it looks different, but works the same as the DHT20)

1 Like

Hi, @gunnersgarrison
Welcome to the forum.
Thank you for your solution and it may help the original poster of this thread.

Tom... :smiley: :+1: :coffee: :australia:

@gunnersgarrison Thank you for the AHT20 Solution. It works for the Arduino Sensor Kit (Seeed Studio) where none of the DHT20 solutions did.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.