Johnny-five: Support For DHT11

Created on 24 Mar 2016  路  16Comments  路  Source: rwaldron/johnny-five

I know this question has been asked some times back, i would just want to confirm if the library provides support for DHT11 now? or is it HTU21D alone?

Most helpful comment

@denzelwamburu sounds good!

All 16 comments

Sorry, there is currently no support for the DHT11. There are many other temperature sensors that are supported:

@rwaldron i needed a hygrometer sensor apart form HTU21D

All of the supported components are listed on each API page, so for Hygrometer, there are currently two http://johnny-five.io/api/hygrometer/

I will look around for others that can be added for more device diversity

The best I can do for now is to provide support via an I2C backpack, which means you'll need another microcontroller, any arduino will do the trick.

In v0.9.35...

var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
  var hygrometer = new five.Hygrometer({
    controller: "DHT11_I2C_NANO_BACKPACK"
  });

  hygrometer.on("change", function() {
    console.log("Hygrometer");
    console.log("  relative humidity : ", this.relativeHumidity);
    console.log("--------------------------------------");
  });
});

nice! especially considering the odd timing delays the DHT11 requires. Offloading it all to I2C keeps things unblocked in the main processor.

Yeah, I figured it was about time I addressed this sensor ;)

My next iteration will be to allow specifying either the DHT11 or DHT22

Great, just what I needed 馃檶.

For the meantime I will close the issue, let me try to implement it, will reopen the issue incase of anything.

@denzelwamburu sounds good!

hello! Please, i'm working on an automatic syst猫m for greenhouse. it's my project in order to obtain my bachelor and i face to certain difficulty with johnny five. My DHT22 sensor returns 0 as result and i d'int know what's happened. help me pls

It's hard to help without more information. Can you share code and a picture of your wiring?

````js
const { Board, Thermometer } = require("johnny-five");
const board = new Board();

board.on("ready", () => {

const thermometer = new Thermometer({
controller: "DHT22_I2C_NANO_BACKPACK"
});

thermometer.on("change", () => {
const {celsius, fahrenheit, kelvin} = thermometer;
console.log("Thermometer");
console.log(" celsius : ", celsius);
console.log(" fahrenheit : ", fahrenheit);
console.log(" kelvin : ", kelvin);
console.log("--------------------------------------");
});
});
````

Here is my code

i've just copy this here. And in arduino, i'he televerse the standard firmata code.

It's hard to help without more information. Can you share code and a picture of your wiring?

i'm trying to upload the wiring but i can't.

returns 0 as result

For Celsius only right? You're getting 32 and 273 for the others?

Also, I just want to make sure that you've uploaded the backpack sketch to the second board.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IainIsCreative picture IainIsCreative  路  10Comments

yuanhaoliang picture yuanhaoliang  路  7Comments

overflowz picture overflowz  路  9Comments

ZacB picture ZacB  路  8Comments

moeinrahimi picture moeinrahimi  路  4Comments