# Temperature sensor AM2302 DHT22 not working

**URL:** <https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980>\
**Category:** Uncategorized\
**Created:** [July 24, 2018, 3:22pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980 "2018-07-24T15:22:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![marceling](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@marceling](https://forum.xod.io/u/marceling)\
**Post date:** [July 24, 2018, 3:22pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/1 "2018-07-24T15:22:51Z")

</div>

Hi,  
I’m a XOD newbe and using version 0.22.0  
Using a simple connection with the sensor AM2302. The Arduino sketch in the IDE is working fine and shows a correct temperature. A simple project in XOD does not work and show 0.00 °C. The wireing wasn’t changed.  
What did I wrong in XOD? (The Data pin of the DHT22 is connected to D2)  
Here the XOD project:

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/78d1bcb58f3ac3b930aeb7fb913338c7168eaf88.jpg)

Thanks for helping

marceling

---

<div class="post-metadata">

**Author:** ![jeff](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jeff/32/372_2.png) [@jeff](https://forum.xod.io/u/jeff)\
**Post date:** [July 24, 2018, 5:21pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/2 "2018-07-24T17:21:03Z")

</div>

I’m not an expert,but I would try connect the ‘done’ output of the sensor to the ‘update’ input of the display

---

<div class="post-metadata">

**Author:** ![marceling](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@marceling](https://forum.xod.io/u/marceling)\
**Post date:** [July 24, 2018, 5:46pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/3 "2018-07-24T17:46:45Z")

</div>

The hordware has only 3 connection pins: gnd, vcc and data.

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [July 24, 2018, 6:55pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/4 "2018-07-24T18:55:48Z")

</div>

Jeff was referring to the pins in the XOD patch. Since Display is probably defaulting to “continuously”, it probably won’t make a difference.

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [July 25, 2018, 8:46am UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/5 "2018-07-25T08:46:28Z")

</div>

Do you have DHT22 by Seeed Studio? If so, we have a bug [#1110](https://github.com/xodio/xod/issues/1110) which we can’t reproduce. Looks like there are slight differences in DHT22’s and the one by Seeed is not handled correctly by the node.

---

<div class="post-metadata">

**Author:** ![marceling](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@marceling](https://forum.xod.io/u/marceling)\
**Post date:** [July 25, 2018, 12:15pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/6 "2018-07-25T12:15:42Z")

</div>

I think it’s from keyes. The problem is similiar to bug #1110. I made an Arduino sketch in the IDE, I used the same devices (I2C LCD and DHT22 and used the same port (D2) en it’s working fine with the sketch

With XOD the lcd gives for both temp and humidity a value of 0.00

I also, as test, disconnected the data wire and both readings were the same: 0.00

So I think XOD is not accessing the DHT correctly.

This is a photo of the DHT I used:

 ![20180725_140238](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/3a8920df5f47fa7b0dc7b5fb42358f54f13a5911.jpg)

---

<div class="post-metadata">

**Author:** ![xodgod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/xodgod/32/846_2.png) [@xodgod](https://forum.xod.io/u/xodgod)\
**Post date:** [January 6, 2019, 2:42pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/7 "2019-01-06T14:42:47Z")

</div>

I have the same problem with a ds18b20 temp sensor the output only shows 0 deg with a lcd and a watch node

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [January 6, 2019, 2:46pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/8 "2019-01-06T14:46:39Z")

</div>

try this [DHT22 on I²C Led display only sends ERR (reads 0.00)](https://forum.xod.io/t/dht22-on-i-c-led-display-only-sends-err-reads-0-00/1594/2)

---

<div class="post-metadata">

**Author:** ![xodgod](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/xodgod/32/846_2.png) [@xodgod](https://forum.xod.io/u/xodgod)\
**Post date:** [January 7, 2019, 7:16pm UTC](https://forum.xod.io/t/temperature-sensor-am2302-dht22-not-working/980/9 "2019-01-07T19:16:42Z")

</div>

Thank you so much for the help After trying many patches i did find that a dht11 and ds18b20 also would not work until i hooked them to d8 and 9 and gave them a 1 hz tick on update line  
They do not work on the lower pwm pins.
