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