DHT-11 temperature sensor not working with Stalker v2.3

Hello guys,

I am trying to use a DHT11 temperature and humidity sensor with Stalker 2.3v, but with no success. :cry:

What is strange is that I just used the DHT11 sensor in my arduino UNO and it worked well. Then, when I connected the DHT11 sensor in my Seeeduino Stalker v2.3 using the same pins, I cannot get the temperature and humidity.

The arduino code is the following:

#include "DHT.h"

#define DHTPIN A0

#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() 
{
    Serial.begin(9600); 
    Serial.println("DHTxx test!");

    dht.begin();
}

void loop() 
{
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
    float h = dht.readHumidity();
    float t = dht.readTemperature();

    // check if returns are valid, if they are NaN (not a number) then something went wrong!
    if (isnan(t) || isnan(h)) 
    {
        Serial.println("Failed to read from DHT");
    } 
    else 
    {
        Serial.print("Humidity: "); 
        Serial.print(h);
        Serial.print(" %\t");
        Serial.print("Temperature: "); 
        Serial.print(t);
        Serial.println(" *C");
    }
}

It returns temperature and humidity = 0.

The pin 1 of the DHT11 sensor is connected in the 5V, pin 2 in the A0 and pin 4 in the GND os the Stalker.

Why is this working in my arduino UNO and not working in my Seeduino Stalker v2.3?

Thank you!

no one? :frowning:

Maybe two points:

1 Did the connections are all right ?

2 The voltage of Stalker is 3.3v, what the operation voltage of your sensor ?

Just as a reference. Best Regards

Wow, this is old and I’m late to the party. At any rate. Yes, I’m having similar issues. I have the stalker in 2.3 and 3.0 versions and both come with two grove connectors on board, which should preclude the need for a grove shield - but I digress. I have a barometer on the I2C port and it works fine, in fact it was basically plug-and-play which was fantastic, and then there was the DHT11.

Connecting the DHT11 to D7/8 has been an exercise in mashing my head against the wall. Nothing has worked so far and I’ve been trying a more than a few things. The issue seems to be around defining the pin, which being D7 should be… 7. Or not. And since I can’t seem to find definitive documentation on the numbering of pins on the Stalker I’m at a bit of a loss.

If you solved it let me know. If not perhaps two heads are better than one.

Kind regards

Byron

Please put posts on this topic: viewtopic.php?f=16&t=5694

Jacket