Failed to read DHT22 sensor using Arduino Uno
I suggest you to modify the following lines of code to check which reading has issue.

if (isnan(h) || isnan(t) || isnan(f)) {
   Serial.println("Failed to read from DHT sensor!");
   return;
}