From 2211fdc7a6e0000b908167a3ea0959ce962b83e5 Mon Sep 17 00:00:00 2001 From: Achim Date: Sat, 6 Jan 2024 11:10:44 +0700 Subject: [PATCH] Removed PM0.3 particle count to avoid patching of pms library for open air --- .../DIY_OUTDOOR_C3_1PP/DIY_OUTDOOR_C3_1PP.ino | 18 +++++++++--------- .../DIY_OUTDOOR_C3_1PST.ino | 9 ++++----- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/DIY_OUTDOOR_C3_1PP/DIY_OUTDOOR_C3_1PP.ino b/examples/DIY_OUTDOOR_C3_1PP/DIY_OUTDOOR_C3_1PP.ino index c1d366f..2ff762e 100644 --- a/examples/DIY_OUTDOOR_C3_1PP/DIY_OUTDOOR_C3_1PP.ino +++ b/examples/DIY_OUTDOOR_C3_1PP/DIY_OUTDOOR_C3_1PP.ino @@ -103,13 +103,13 @@ void loop() { pm1Value01=pm1Value01+data1.PM_AE_UG_1_0; pm1Value25=pm1Value25+data1.PM_AE_UG_2_5; pm1Value10=pm1Value10+data1.PM_AE_UG_10_0; - pm1PCount=pm1PCount+data1.PM_RAW_0_3; +// pm1PCount=pm1PCount+data1.PM_RAW_0_3; pm1temp=pm1temp+data1.AMB_TMP; pm1hum=pm1hum+data1.AMB_HUM; pm2Value01=pm2Value01+data2.PM_AE_UG_1_0; pm2Value25=pm2Value25+data2.PM_AE_UG_2_5; pm2Value10=pm2Value10+data2.PM_AE_UG_10_0; - pm2PCount=pm2PCount+data2.PM_RAW_0_3; +// pm2PCount=pm2PCount+data2.PM_RAW_0_3; pm2temp=pm2temp+data2.AMB_TMP; pm2hum=pm2hum+data2.AMB_HUM; countPosition++; @@ -117,13 +117,13 @@ void loop() { pm1Value01 = pm1Value01 / targetCount; pm1Value25 = pm1Value25 / targetCount; pm1Value10 = pm1Value10 / targetCount; - pm1PCount = pm1PCount / targetCount; + //pm1PCount = pm1PCount / targetCount; pm1temp = pm1temp / targetCount; pm1hum = pm1hum / targetCount; pm2Value01 = pm2Value01 / targetCount; pm2Value25 = pm2Value25 / targetCount; pm2Value10 = pm2Value10 / targetCount; - pm2PCount = pm2PCount / targetCount; +// pm2PCount = pm2PCount / targetCount; pm2temp = pm2temp / targetCount; pm2hum = pm2hum / targetCount; postToServer(pm1Value01, pm1Value25,pm1Value10,pm1PCount, pm1temp,pm1hum,pm2Value01, pm2Value25,pm2Value10,pm2PCount, pm2temp,pm2hum); @@ -132,13 +132,13 @@ void loop() { pm1Value01=0; pm1Value25=0; pm1Value10=0; - pm1PCount=0; +// pm1PCount=0; pm1temp=0; pm1hum=0; pm2Value01=0; pm2Value25=0; pm2Value10=0; - pm2PCount=0; +// pm2PCount=0; pm2temp=0; pm2hum=0; } @@ -189,7 +189,7 @@ void postToServer(int pm1Value01, int pm1Value25, int pm1Value10, int pm1PCount, + ", \"pm01\":" + String((pm1Value01+pm2Value01)/2) + ", \"pm02\":" + String((pm1Value25+pm2Value25)/2) + ", \"pm10\":" + String((pm1Value10+pm2Value10)/2) - + ", \"pm003_count\":" + String((pm1PCount+pm2PCount)/2) +// + ", \"pm003_count\":" + String((pm1PCount+pm2PCount)/2) + ", \"atmp\":" + String((pm1temp+pm2temp)/20) + ", \"rhum\":" + String((pm1hum+pm2hum)/20) + ", \"boot\":" + loopCount @@ -198,7 +198,7 @@ void postToServer(int pm1Value01, int pm1Value25, int pm1Value10, int pm1PCount, + "\"pm01\":" + String(pm1Value01) + ", \"pm02\":" + String(pm1Value25) + ", \"pm10\":" + String(pm1Value10) - + ", \"pm003_count\":" + String(pm1PCount) +// + ", \"pm003_count\":" + String(pm1PCount) + ", \"atmp\":" + String(pm1temp/10) + ", \"rhum\":" + String(pm1hum/10) + "}" @@ -206,7 +206,7 @@ void postToServer(int pm1Value01, int pm1Value25, int pm1Value10, int pm1PCount, + " \"pm01\":" + String(pm1Value01) + ", \"pm02\":" + String(pm2Value25) + ", \"pm10\":" + String(pm2Value10) - + ", \"pm003_count\":" + String(pm2PCount) +// + ", \"pm003_count\":" + String(pm2PCount) + ", \"atmp\":" + String(pm2temp/10) + ", \"rhum\":" + String(pm2hum/10) + "}" diff --git a/examples/DIY_OUTDOOR_C3_1PST/DIY_OUTDOOR_C3_1PST.ino b/examples/DIY_OUTDOOR_C3_1PST/DIY_OUTDOOR_C3_1PST.ino index a5a50ee..38b1141 100644 --- a/examples/DIY_OUTDOOR_C3_1PST/DIY_OUTDOOR_C3_1PST.ino +++ b/examples/DIY_OUTDOOR_C3_1PST/DIY_OUTDOOR_C3_1PST.ino @@ -97,7 +97,7 @@ unsigned long previousPm = 0; int pm25 = -1; int pm01 = -1; int pm10 = -1; -int pm03PCount = -1; +//int pm03PCount = -1; float temp; int hum; @@ -217,14 +217,14 @@ void updatePm() { pm01 = data1.PM_AE_UG_1_0; pm25 = data1.PM_AE_UG_2_5; pm10 = data1.PM_AE_UG_10_0; - pm03PCount = data1.PM_RAW_0_3; + // pm03PCount = data1.PM_RAW_0_3; temp = data1.AMB_TMP; hum = data1.AMB_HUM; } else { pm01 = -1; pm25 = -1; pm10 = -1; - pm03PCount = -1; +// pm03PCount = -1; temp = -10001; hum = -10001; } @@ -247,7 +247,7 @@ void sendToServer() { (pm01 < 0 ? "" : ", \"pm01\":" + String(pm01)) + (pm25 < 0 ? "" : ", \"pm02\":" + String(pm25)) + (pm10 < 0 ? "" : ", \"pm10\":" + String(pm10)) + - (pm03PCount < 0 ? "" : ", \"pm003_count\":" + String(pm03PCount)) + +// (pm03PCount < 0 ? "" : ", \"pm003_count\":" + String(pm03PCount)) + (TVOC < 0 ? "" : ", \"tvoc_index\":" + String(TVOC)) + (NOX < 0 ? "" : ", \"nox_index\":" + String(NOX)) + ", \"atmp\":" + String(temp/10) + @@ -336,4 +336,3 @@ String getNormalizedMac() { -