Getting nan for temperature and humidity for DHT11 sensor

[Unformatted code removed by moderator]

// Getting nan for temperature and humidity value. Can anybody help me out with what’s wrong with the code?

The output I’m receiving on the serial monitor:

01:53:58.561 → nan
01:53:58.635 → Temperature : nan Humidity : nan
01:53:59.480 → nan
01:53:59.554 → Temperature : nan Humidity : nan
01:54:00.548 → nan
01:54:00.622 → Temperature : nan Humidity : nan

@Mohit_Chindalia Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

DHT11 need more time , try 5000L, anyway, you don’t need to read temperature every 5 sec :wink:

The guy asked for help and never came back :joy:

1 Like