Johnny-five: DHT11 (via i2C nano backpack)

Created on 13 Jan 2017  路  12Comments  路  Source: rwaldron/johnny-five

hey
really having a hard time with this ;)
I have the DHT11 PCB version (https://www.aliexpress.com/w/wholesale-dht11.html)
Work good directly on the arduino uno(not johnny five).
I used a arduino nano, to make like you describe the I2C nano backpack.
i put the firmware on the nano backpack ( dht11_i2c_nano_backpack.ino)

Now it's done, but i still have no data

temperature celsius : 0 fahrenheit : 32 kelvin : 273.15 --------------------------------------

I used this code:

`board.on("ready", function() {
console.log('rdy');
var multi = new five.Multi({
controller: "DHT11_I2C_NANO_BACKPACK"
});

setInterval(function() {

console.log("temperature");
console.log("  celsius           : ", multi.temperature.celsius);
console.log("  fahrenheit        : ", multi.temperature.fahrenheit);
console.log("  kelvin            : ", multi.temperature.kelvin);
console.log("--------------------------------------");

console.log("Hygrometer");
console.log("  relative humidity : ", multi.hygrometer.relativeHumidity);
console.log("--------------------------------------");
}, 5000);

});
`
I dont know if i need to use a resitor (used it anyway) since i have the PCB version...

thanks for help ;)

Bug Hardware Required Needs Attention Needs Info Needs Response From Reporter

Most helpful comment

Hi @lyzadanger,
Thanks for your answer ;)
I'm using:
Nano V3.0 - ATmega 328P as backpack (with the dht11_i2c_nano_backpack.ino firmware)
An arduino UNO as main controller (with Firmata on it)
All is wired like in the schematic here [http://johnny-five.io/api/multi/#dht11i2cnanobackpack]
2 difference with this schematic:

  • the DHT11 is the PCB version (so it already has a resistor on it) -> [https://www.aliexpress.com/w/wholesale-dht11.html]
  • the resistor is not the same (i use 1kOhm resistor, as it's not describe which one we need)
    At the end, all this is plug to a raspberry pi 2, containing nodejs / johnny five etc....

So i have no data coming (always 0). I tryed:

  • Maybe it's a sensor problem, i switch with another DHT11, same result.
  • Maybe because i have the DHT11 PCB, i don't need resistor, tryed without it, same result.

Really don't know what do to

Thanks for your help

All 12 comments

Hi, @lezabour !

Could you tell me more about your setup? What kind of board is the Nano (backpack) currently connected to physically? Is it connected to an Arduino Uno? A diagram or photo of your circuit/setup would be super helpful if you are able, also. Do you have something akin to http://johnny-five.io/api/multi/#dht11i2cnanobackpack?

Hi @lyzadanger,
Thanks for your answer ;)
I'm using:
Nano V3.0 - ATmega 328P as backpack (with the dht11_i2c_nano_backpack.ino firmware)
An arduino UNO as main controller (with Firmata on it)
All is wired like in the schematic here [http://johnny-five.io/api/multi/#dht11i2cnanobackpack]
2 difference with this schematic:

  • the DHT11 is the PCB version (so it already has a resistor on it) -> [https://www.aliexpress.com/w/wholesale-dht11.html]
  • the resistor is not the same (i use 1kOhm resistor, as it's not describe which one we need)
    At the end, all this is plug to a raspberry pi 2, containing nodejs / johnny five etc....

So i have no data coming (always 0). I tryed:

  • Maybe it's a sensor problem, i switch with another DHT11, same result.
  • Maybe because i have the DHT11 PCB, i don't need resistor, tryed without it, same result.

Really don't know what do to

Thanks for your help

I'm seeing the same thing, I have the same chip but with 3 connectors ( https://www.aliexpress.com/item/1pcs-free-shipping-DHT11-Temperature-And-Relative-Humidity-Sensor-Module-PCB-for-Arduino-DIY-Starter-Kit/32631854864.html )

Also seeing temp always 0 as well as humidity.

@martip-sainsburys exactly same problem !

Has everyone here tried the other, newer DHT* firmware? It's also available here: https://github.com/rwaldron/johnny-five/tree/master/firmwares, in https://github.com/rwaldron/johnny-five/blob/master/firmwares/dht_i2c_nano_backpack.ino . To be clear, I have no idea if this will fix your issue, but worth a try to see what we can learn. The firmware is just using the Arduino DHT library. Can someone share the arduino C sketch that works correctly? I could just use the one given in the Arduino IDE examples, but I want to make sure I'm comparing apples to apples :)

@felansu @martip-sainsburys and @lezabour

I just want to followup and see if any of y'all were able to try the other firmware that @rwaldron suggested.

Have this problem to with dht22.
Trying Uno+nano, mega + nano. Celsium temperature is 0
firware dht_i2c_nano_backpack.ino
Without johny-five working fine(test scatch from dht lib)
And i have another question. How to connect 2 or more (i need 6) sensors dht22 using johny-five?

The only way to make it work is to define the DHTTYPE and the DHTPIN as preprocessor directive because you're probably using the default adafruit DHT library which ONLY SUPPORT declaring pin and type like i said before.
PS: on the other hand you have to define type and pin for every arduino backpack you use.
PPS: the Johnny Five team should publish their dht library (or the one they used...), this piece of software is strictly dependent from it!!!

Below you can find the working code with comments for DHTTYPE switching:

dht_i2c_nano_backpack_adafruit.zip

Cheers.

So what is the solution guys, i have the same proplem

I have the same problem as well, would love to hear some more ideas

Same for me :(

same for me ! Any idea?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefanvermaas picture stefanvermaas  路  10Comments

danielhep picture danielhep  路  4Comments

ntatko picture ntatko  路  11Comments

moeinrahimi picture moeinrahimi  路  4Comments

cannehag picture cannehag  路  12Comments