Home/Support/Support Forum/DHT22 sensor remote reading with Xbee s2c

DHT22 sensor remote reading with Xbee s2c

0 votes
Hey. Have anyone used DHT22 with Xbee devices? I am using nodemcu as a microcontroller and I need to send temperature reading from my remote xbee to a coordinator xbee which is connected to microcontroller. I have been folowing this guide:
But i have realised that is not quite the same when using DHT22 and I cannot seem to know how to apply and change his code to get it working with DHT22
asked Feb 19, 2019 in IEEE 802.15.4 by zazas321 New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes

I use following code:

#include "DHT.h"
#define DHTPIN 3 //D3 pin
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
void setup() {


void loop() {
// put your main code here, to run repeatedly:
float temp= dht.readTemperature();

and the output i get is NAN.

I have tested the DHT22 and connected it to my microcontroller and got it working, but when I connect it to remote XBEE, the output I get is NAN
answered Feb 20, 2019 by zazas321 New to the Community (2 points)