data pin for DHT22 temp/humidity sensor

Started by neddie, February 05, 2016, 05:52:40 PM

neddie

I connected up a DHT22 to my Moteino USB.  I connected the DHT22 data to pin 2 as specified in the wiring diagram in the adafruit tutorial.  It didn't work.  It timed out waiting for the initial low signal from the sensor.  Pin 3 didn't work either.  But pin 4 worked fine.  Why wouldn't 2 & 3 work?   Are they reserved for something on the Moteino USB?

Felix


neddie

I've looked at that pinout -- I don't find that it helps.  What's different about moteino pin 2 and 3 from a regular arduino?

mzv72m

If you look at the pinout, pin 2 is noted that it is used by the transceiver for a moteino.
Dan

neddie

What I haven't seen stated anywhere is that the pin can't be used for anything else, even if the transceiver is not being used.  Thanks for your help, Dan.

neddie

Remaining question is:  why doesn't pin 3 work?

Felix

The pins marked with * are used by the transceiver and/or FlashMem, when these are soldered. If they are not present, those pins are free to use any way you want.
Pin D3 in addition to being a general purpose digital pin, it is also PWM and is a hardware interrupt pin.
We haven't seen any code from you so I have no clue why D3 doesn't work and D4 does. It could be an electrical issue.

jra

@neddie to be honest, the DHT22 is not a particularly good humidity/temperature sensor for a variety of reasons (slow, inaccurate, imprecise, proprietary interface, timing dependent).  The SI7021 used by Felix on the WeatherShield (along with the pin compatible HDC1050/HDC1080 from Texas Instruments) uses a standard i2c bus, is well supported by libraries and examples for a variety of MCU's and is much more accurate/precise. It may be less effort in the long run to switch to one of these instead of trying to get the DHT22 to work.