Warning about DHT22 sensors
-
One of our customers recently reported problems getting a DHT22 sensor working with RRF, even though the sensor worked when connected to an Arduino. We investigated the issue and discovered that the sensor did not conform to the specification of the DHT22 sensor as on the datasheet provided by Adafruit, which is the only (barely!) adequate datasheet I have managed to find on this device. In particular, it does not wait for the end of the START signal before transmitting its data. The reason it worked when connected to an Arduino was because of a lucky break that is not practical to replicate in a real-time system such as RRF.
The customer's sensor looked materially different from our own. Here is a photo showing the customer's sensor above) and the one we purchased (below). Note that our sensor carries the identification "
ADSONGAOSONG AM2302" whereas the sensor from the customer carries no markings at all. Perhaps the customer's sensor is a clone.When I search for DHT22 sensors on Amazon and eBay, the vast majority of images in the results do carry this part identification; but a few do not and look like the sensor received from the customer.
Therefore, if you need a DHT22 sensor for your Duet-based system, please make sure to buy a genuine one bearing the correct part identification.
-
@dc42 For the sake of completeness, here is a link to a better data sheet that I found in the ESPhome integration for home assistant.
https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf
Note that its "AOSONG..." not "ADSONG".
For additional completeness, here is a link to the esphome integration which handles all "flavours" of DHT sensors including DHT11, DHT22, AM2302, RHT03, and SI7012 with links to their various data sheets.
https://esphome.io/components/sensor/dht.html
Note also that there is a recommendation to use a pull up resistor (about 4k7) between data and 3.3.V - (not sure if Duet users are doing that but I thought I'd mention it in case it helps).