LowPowerLab Forum

Hardware support => Moteino => Topic started by: neddie on February 05, 2016, 05:52:40 PM

Title: data pin for DHT22 temp/humidity sensor
Post by: neddie on February 05, 2016, 05:52:40 PM
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?
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: Felix on February 07, 2016, 06:42:58 PM
Here is why, more diagrams and specs are here (https://lowpowerlab.com/moteino/#pinout):

(https://farm4.staticflickr.com/3813/10585334166_63e45cd742_o.png)
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: neddie on February 08, 2016, 05:15:48 PM
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?
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: mzv72m on February 08, 2016, 06:49:05 PM
If you look at the pinout, pin 2 is noted that it is used by the transceiver for a moteino.
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: neddie on February 17, 2016, 03:18:44 PM
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.
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: neddie on February 17, 2016, 03:20:13 PM
Remaining question is:  why doesn't pin 3 work?
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: Felix on February 17, 2016, 03:43:36 PM
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.
Title: Re: data pin for DHT22 temp/humidity sensor
Post by: jra on February 17, 2016, 04:10:54 PM
@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.