i need help use pms 7003 and dht sensor. help me!

i want to make dust/temperature/humidity measuring device

but i have a problem.

Each pms 7003 and dht11 is operated well

but after combine them, during a few seconds operate well and then dust value increases very much.

serial monitor show under paragraph

1.0ug/m3:021 2.5ug/m3:031 10ug/m3:037
Temperature:23.00 Humidity:21.00
1.0ug/m3:021 2.5ug/m3:031 10ug/m3:037
Temperature:23.00 Humidity:21.00
Dust raw data debugging : 1.0ug/m3:200 2.5ug/m3:300 10ug/m3:3813
Temperature:23.00 Humidity:21.00
Dust raw data debugging : 1.0ug/m3:180 2.5ug/m3:290 10ug/m3:3412
Temperature:23.00 Humidity:22.00

my code is

#include <SoftwareSerial.h>
#include <DHT.h>
#define DHTPIN 8
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

SoftwareSerial mySerial(10,11); // Arudino Uno port RX, TX

void setup() {
// for debuging
Serial.begin(115200);

// Use software serial
mySerial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
static int CheckFirst=0;
static int pm_add[3][5]={0,};
static int pm_old[3]={0,};
int chksum=0,res=0;;
unsigned char pms[32]={0,};

if(mySerial.available()>=32){
ar
for(int j=0; j<32 ; j++){
pms[j]=mySerial.read();
if(j<30)
chksum+=pms[j];
}

if(pms[30] != (unsigned char)(chksum>>8)
|| pms[31]!= (unsigned char)(chksum) ){

}
if(pms[0]!=0x42 || pms[1]!=0x4d )

Serial.print("Dust raw data debugging : ");
Serial.print("1.0ug/m3:");
Serial.print(pms[10]);
Serial.print(pms[11]);
Serial.print(" ");
Serial.print("2.5ug/m3:");
Serial.print(pms[12]);
Serial.print(pms[13]);
Serial.print(" ");
Serial.print("10ug/m3:");
Serial.print(pms[14]);
Serial.println(pms[15]);
}
delay(1000);
float h = dht.readHumidity();
float t = dht.readTemperature();

Serial.print(" Temperature:");
Serial.print(t);
Serial.print(" Humidity:");
Serial.println(h);
delay(1000);}

what is problem my code?? help me TT

what is problem my code?

Here:

  delay(1000);

and here:

  delay(1000);

Read, understand, and embrace the blink without delay philosophy, and quit using delay().

thanks.

i modify my code

but they have same problem.

i modify my code

But didn't post the new code.

but they have same problem.

Without the temperature and humidity sensor connected, you need to print the 32 bytes you read from the dust sensor WITHOUT doing anything else with them.

With the temperature and humidity sensor connected, you need to print the 32 bytes you read from the dust sensor WITHOUT doing anything else with them.

Are the values the same?

#include <SoftwareSerial.h>
#include <DHT.h>
#define DHTPIN 8
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

SoftwareSerial mySerial(10,11); // Arudino Uno port RX, TX

void setup() {
// for debuging
Serial.begin(115200);

// Use software serial
mySerial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
static int CheckFirst=0;
static int pm_add[3][5]={0,};
static int pm_old[3]={0,};
int chksum=0,res=0;;
unsigned char pms[32]={0,};

if(mySerial.available()>=32){

for(int j=0; j<32 ; j++){
pms[j]=mySerial.read();
if(j<30)
chksum+=pms[j];
}

if(pms[30] != (unsigned char)(chksum>>8)
|| pms[31]!= (unsigned char)(chksum) ){

}
if(pms[0]!=0x42 || pms[1]!=0x4d )

Serial.print("Dust raw data debugging : ");
Serial.print("1.0ug/m3:");
Serial.print(pms[10]);
Serial.print(pms[11]);
Serial.print(" ");
Serial.print("2.5ug/m3:");
Serial.print(pms[12]);
Serial.print(pms[13]);
Serial.print(" ");
Serial.print("10ug/m3:");
Serial.print(pms[14]);
Serial.println(pms[15]);
}

float h = dht.readHumidity();
float t = dht.readTemperature();

Serial.print(" Temperature:");
Serial.print(t);
Serial.print(" Humidity:");
Serial.println(h);
delay(1000);}

dust sensor values are not changed. whether temperature/humidity sensor connected or not connected

dust sensor values are not changed. whether temperature/humidity sensor connected or not connected

Since that was the problem you described in your initial post, can we assume that your problem has been resolved?

oh, i mean it was still incorrect.

i think my code is something wrong.

please help me. i don't find it