nan value (DHT22) with interruption

hi all :slight_smile: ,I am in the process of regulating the temperature with a heating resistor and dimmer circuit,but during the system test I am stopped by a NAN read by DHT22 during the execution of the program, as I tested the sensor without the interrupt function and the controller can read the values normally.

#include <DHT.h>
#include <Adafruit_Sensor.h>
#include <DHT_U.h>
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN,DHTTYPE);
int a=0,offf=0;
const float Kp=1,Ki=0.01;
float t=27.7;
float error=3.3,Iterm=50.2,Pterm=35.5;
void setup() {
pinMode(0,OUTPUT);
Serial.begin(9600);
attachInterrupt(digitalPinToInterrupt(3),aa,FALLING);
dht.begin();
}
void aa()
{
delayMicroseconds(offf);
digitalWrite(0,HIGH);
delayMicroseconds(10);
digitalWrite(0,LOW);
}

void loop() {
delay(200);
t=dht.readTemperature();
error=37.5-t;
if (error<0)
{
Pterm=0;
Iterm=0;
}
else
{
Pterm=errorKp;
Iterm+=Ki
error;
}
a=Pterm+Iterm;
if (a<0)
a=0;
else if (a>9350)
a=9350;
offf=9350-a;
Serial.println(offf);
Serial.println(t);
}

when I put the plug of the dimmer circuit, I get the result in the first picture,
and when i unplug i get the result in the second picture.
so I think the interrupt function each time it cuts off the reading of data between the controller and the sensor, I tried to include the reading in an interrupt function but the problem remains
So if there is someone who can help me or if there is a solution to this problem, and tanks in advance.

Some ideas:
Focus on one problem at the time and solve it. You have 2 problems, reading the sensor and the dimmer.
Read the first topics like "How to use forum", especially how to attache code.

I'm sorry I put the same picture twice.
the second photo (unplug) is this one: