I had the same thing happen when I switched from a dht11 to dht22. What finally fixed mine was changing the pin numbering from physical pins to bcm. Sounds dumb but it worked.
I tried also to change the connection pin to other pins but nothing happened.
I thought the possible problem could be the correlation between the pins in the list node-red-contrib-dht-sensor and the real pins so I changed (and tested) all the proposed pin numbers into the node-red-contrib-dht-sensor list, but nothing.
Following my wiring pin table:
Could the problem be a no compatibility of the sensor DHT22 AM2302 with the node-red-contrib-dht-sensor? Or does it depend from my hardware configuration?
Does anyone know if there is an alternative palette to node-red-contrib-dht-sensor to control a DHT22 sensor into nodered?
No I didn't install the BMC libraries as told in the pre-req's.
But I just do it and update the BMC to the version 1.65:
Then I followed the other 2 steps in pre-req's and I re-installed the node-dht-sensor dependency and the node-red-contrib-dht-sensor node.
And I updated npm to the latest version (patch) 6.14.5 and Node-js to version 12.17.0
The output values coming from node-red-contrib-dht-sensor are still wrong with both BCM GPIO (in my case 23) or Physical pin rev.2 (in my case 16).
After installing the BMC v1.65 library, node-dth-sensor and then the node-red-contrib-dht-sensor, I wired up a dht22 using:
Pin 1 (3.3v) to pin 1 of the dht22
Pin 6 (Gnd) to pin 4 of the dht22
Pin 16 (BCM 23) to pin 2 of the dht22
and a 10K resistor between pins 1 and 2 of the dht22
Just a note: Be careful with the resistor as many of the packaged DHT sensors have the resistor already in the circuit. I don't know if the DHT you are using has one or not but read the data sheet carefully.
Hello I bought and tested a new sensor DHT22 (a branded one) and now it works fine. So my problem was the sensor.
I suggest to buy brended sensors and not generic unbrended sensors and of course to use the good node-red-contrib-dht-sensor.
Thanks to gerry and zenofmud for your suggestions