Compare commits

..

3 Commits

4 changed files with 20 additions and 20 deletions

View File

@ -103,13 +103,13 @@ void loop() {
pm1Value01=pm1Value01+data1.PM_AE_UG_1_0; pm1Value01=pm1Value01+data1.PM_AE_UG_1_0;
pm1Value25=pm1Value25+data1.PM_AE_UG_2_5; pm1Value25=pm1Value25+data1.PM_AE_UG_2_5;
pm1Value10=pm1Value10+data1.PM_AE_UG_10_0; 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; pm1temp=pm1temp+data1.AMB_TMP;
pm1hum=pm1hum+data1.AMB_HUM; pm1hum=pm1hum+data1.AMB_HUM;
pm2Value01=pm2Value01+data2.PM_AE_UG_1_0; pm2Value01=pm2Value01+data2.PM_AE_UG_1_0;
pm2Value25=pm2Value25+data2.PM_AE_UG_2_5; pm2Value25=pm2Value25+data2.PM_AE_UG_2_5;
pm2Value10=pm2Value10+data2.PM_AE_UG_10_0; 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; pm2temp=pm2temp+data2.AMB_TMP;
pm2hum=pm2hum+data2.AMB_HUM; pm2hum=pm2hum+data2.AMB_HUM;
countPosition++; countPosition++;
@ -117,13 +117,13 @@ void loop() {
pm1Value01 = pm1Value01 / targetCount; pm1Value01 = pm1Value01 / targetCount;
pm1Value25 = pm1Value25 / targetCount; pm1Value25 = pm1Value25 / targetCount;
pm1Value10 = pm1Value10 / targetCount; pm1Value10 = pm1Value10 / targetCount;
pm1PCount = pm1PCount / targetCount; //pm1PCount = pm1PCount / targetCount;
pm1temp = pm1temp / targetCount; pm1temp = pm1temp / targetCount;
pm1hum = pm1hum / targetCount; pm1hum = pm1hum / targetCount;
pm2Value01 = pm2Value01 / targetCount; pm2Value01 = pm2Value01 / targetCount;
pm2Value25 = pm2Value25 / targetCount; pm2Value25 = pm2Value25 / targetCount;
pm2Value10 = pm2Value10 / targetCount; pm2Value10 = pm2Value10 / targetCount;
pm2PCount = pm2PCount / targetCount; // pm2PCount = pm2PCount / targetCount;
pm2temp = pm2temp / targetCount; pm2temp = pm2temp / targetCount;
pm2hum = pm2hum / targetCount; pm2hum = pm2hum / targetCount;
postToServer(pm1Value01, pm1Value25,pm1Value10,pm1PCount, pm1temp,pm1hum,pm2Value01, pm2Value25,pm2Value10,pm2PCount, pm2temp,pm2hum); postToServer(pm1Value01, pm1Value25,pm1Value10,pm1PCount, pm1temp,pm1hum,pm2Value01, pm2Value25,pm2Value10,pm2PCount, pm2temp,pm2hum);
@ -132,13 +132,13 @@ void loop() {
pm1Value01=0; pm1Value01=0;
pm1Value25=0; pm1Value25=0;
pm1Value10=0; pm1Value10=0;
pm1PCount=0; // pm1PCount=0;
pm1temp=0; pm1temp=0;
pm1hum=0; pm1hum=0;
pm2Value01=0; pm2Value01=0;
pm2Value25=0; pm2Value25=0;
pm2Value10=0; pm2Value10=0;
pm2PCount=0; // pm2PCount=0;
pm2temp=0; pm2temp=0;
pm2hum=0; pm2hum=0;
} }
@ -189,7 +189,7 @@ void postToServer(int pm1Value01, int pm1Value25, int pm1Value10, int pm1PCount,
+ ", \"pm01\":" + String((pm1Value01+pm2Value01)/2) + ", \"pm01\":" + String((pm1Value01+pm2Value01)/2)
+ ", \"pm02\":" + String((pm1Value25+pm2Value25)/2) + ", \"pm02\":" + String((pm1Value25+pm2Value25)/2)
+ ", \"pm10\":" + String((pm1Value10+pm2Value10)/2) + ", \"pm10\":" + String((pm1Value10+pm2Value10)/2)
+ ", \"pm003_count\":" + String((pm1PCount+pm2PCount)/2) // + ", \"pm003_count\":" + String((pm1PCount+pm2PCount)/2)
+ ", \"atmp\":" + String((pm1temp+pm2temp)/20) + ", \"atmp\":" + String((pm1temp+pm2temp)/20)
+ ", \"rhum\":" + String((pm1hum+pm2hum)/20) + ", \"rhum\":" + String((pm1hum+pm2hum)/20)
+ ", \"boot\":" + loopCount + ", \"boot\":" + loopCount
@ -198,7 +198,7 @@ void postToServer(int pm1Value01, int pm1Value25, int pm1Value10, int pm1PCount,
+ "\"pm01\":" + String(pm1Value01) + "\"pm01\":" + String(pm1Value01)
+ ", \"pm02\":" + String(pm1Value25) + ", \"pm02\":" + String(pm1Value25)
+ ", \"pm10\":" + String(pm1Value10) + ", \"pm10\":" + String(pm1Value10)
+ ", \"pm003_count\":" + String(pm1PCount) // + ", \"pm003_count\":" + String(pm1PCount)
+ ", \"atmp\":" + String(pm1temp/10) + ", \"atmp\":" + String(pm1temp/10)
+ ", \"rhum\":" + String(pm1hum/10) + ", \"rhum\":" + String(pm1hum/10)
+ "}" + "}"
@ -206,7 +206,7 @@ void postToServer(int pm1Value01, int pm1Value25, int pm1Value10, int pm1PCount,
+ " \"pm01\":" + String(pm1Value01) + " \"pm01\":" + String(pm1Value01)
+ ", \"pm02\":" + String(pm2Value25) + ", \"pm02\":" + String(pm2Value25)
+ ", \"pm10\":" + String(pm2Value10) + ", \"pm10\":" + String(pm2Value10)
+ ", \"pm003_count\":" + String(pm2PCount) // + ", \"pm003_count\":" + String(pm2PCount)
+ ", \"atmp\":" + String(pm2temp/10) + ", \"atmp\":" + String(pm2temp/10)
+ ", \"rhum\":" + String(pm2hum/10) + ", \"rhum\":" + String(pm2hum/10)
+ "}" + "}"

View File

@ -11,7 +11,7 @@ The codes needs the following libraries installed:
“WifiManager by tzapu, tablatronix” tested with version 2.0.11-beta “WifiManager by tzapu, tablatronix” tested with version 2.0.11-beta
"Sensirion I2C SGP41" by Sensation Version 0.1.0 "Sensirion I2C SGP41" by Sensation Version 0.1.0
"Sensirion Gas Index Algorithm" by Sensation Version 3.2.1 "Sensirion Gas Index Algorithm" by Sensation Version 3.2.1
"Arduino-SHT" by Johannes Winkelmann Version 1.2.2 "S8_UART" by Josep Comas Version 1.0.1
“pms” by Markusz Kakl version 1.1.0 (needs to be patched for 5003T model) “pms” by Markusz Kakl version 1.1.0 (needs to be patched for 5003T model)
For built instructions and how to patch the PMS library: https://www.airgradient.com/open-airgradient/instructions/diy-open-air-presoldered-v11/ For built instructions and how to patch the PMS library: https://www.airgradient.com/open-airgradient/instructions/diy-open-air-presoldered-v11/
@ -97,7 +97,7 @@ unsigned long previousPm = 0;
int pm25 = -1; int pm25 = -1;
int pm01 = -1; int pm01 = -1;
int pm10 = -1; int pm10 = -1;
int pm03PCount = -1; //int pm03PCount = -1;
float temp; float temp;
int hum; int hum;
@ -217,14 +217,14 @@ void updatePm() {
pm01 = data1.PM_AE_UG_1_0; pm01 = data1.PM_AE_UG_1_0;
pm25 = data1.PM_AE_UG_2_5; pm25 = data1.PM_AE_UG_2_5;
pm10 = data1.PM_AE_UG_10_0; pm10 = data1.PM_AE_UG_10_0;
pm03PCount = data1.PM_RAW_0_3; // pm03PCount = data1.PM_RAW_0_3;
temp = data1.AMB_TMP; temp = data1.AMB_TMP;
hum = data1.AMB_HUM; hum = data1.AMB_HUM;
} else { } else {
pm01 = -1; pm01 = -1;
pm25 = -1; pm25 = -1;
pm10 = -1; pm10 = -1;
pm03PCount = -1; // pm03PCount = -1;
temp = -10001; temp = -10001;
hum = -10001; hum = -10001;
} }
@ -247,7 +247,7 @@ void sendToServer() {
(pm01 < 0 ? "" : ", \"pm01\":" + String(pm01)) + (pm01 < 0 ? "" : ", \"pm01\":" + String(pm01)) +
(pm25 < 0 ? "" : ", \"pm02\":" + String(pm25)) + (pm25 < 0 ? "" : ", \"pm02\":" + String(pm25)) +
(pm10 < 0 ? "" : ", \"pm10\":" + String(pm10)) + (pm10 < 0 ? "" : ", \"pm10\":" + String(pm10)) +
(pm03PCount < 0 ? "" : ", \"pm003_count\":" + String(pm03PCount)) + // (pm03PCount < 0 ? "" : ", \"pm003_count\":" + String(pm03PCount)) +
(TVOC < 0 ? "" : ", \"tvoc_index\":" + String(TVOC)) + (TVOC < 0 ? "" : ", \"tvoc_index\":" + String(TVOC)) +
(NOX < 0 ? "" : ", \"nox_index\":" + String(NOX)) + (NOX < 0 ? "" : ", \"nox_index\":" + String(NOX)) +
", \"atmp\":" + String(temp/10) + ", \"atmp\":" + String(temp/10) +
@ -336,4 +336,3 @@ String getNormalizedMac() {

View File

@ -13,6 +13,7 @@ The codes needs the following libraries installed:
"Sensirion I2C SGP41" by Sensation Version 0.1.0 "Sensirion I2C SGP41" by Sensation Version 0.1.0
"Sensirion Gas Index Algorithm" by Sensation Version 3.2.1 "Sensirion Gas Index Algorithm" by Sensation Version 3.2.1
“pms” by Markusz Kakl version 1.1.0 “pms” by Markusz Kakl version 1.1.0
"S8_UART" by Josep Comas Version 1.0.1
"Arduino-SHT" by Johannes Winkelmann Version 1.2.2 "Arduino-SHT" by Johannes Winkelmann Version 1.2.2
"Adafruit NeoPixel" by Adafruit Version 1.11.0 "Adafruit NeoPixel" by Adafruit Version 1.11.0
@ -125,7 +126,7 @@ unsigned long previousPm = 0;
int pm25 = -1; int pm25 = -1;
int pm01 = -1; int pm01 = -1;
int pm10 = -1; int pm10 = -1;
int pm03PCount = -1; //int pm03PCount = -1;
const int tempHumInterval = 5000; const int tempHumInterval = 5000;
unsigned long previousTempHum = 0; unsigned long previousTempHum = 0;
@ -273,12 +274,12 @@ void updatePm() {
pm01 = data1.PM_AE_UG_1_0; pm01 = data1.PM_AE_UG_1_0;
pm25 = data1.PM_AE_UG_2_5; pm25 = data1.PM_AE_UG_2_5;
pm10 = data1.PM_AE_UG_10_0; pm10 = data1.PM_AE_UG_10_0;
pm03PCount = data1.PM_RAW_0_3; // pm03PCount = data1.PM_RAW_0_3;
} else { } else {
pm01 = -1; pm01 = -1;
pm25 = -1; pm25 = -1;
pm10 = -1; pm10 = -1;
pm03PCount = -1; // pm03PCount = -1;
} }
} }
} }
@ -536,7 +537,7 @@ void sendToServer() {
(pm01 < 0 ? "" : ", \"pm01\":" + String(pm01)) + (pm01 < 0 ? "" : ", \"pm01\":" + String(pm01)) +
(pm25 < 0 ? "" : ", \"pm02\":" + String(pm25)) + (pm25 < 0 ? "" : ", \"pm02\":" + String(pm25)) +
(pm10 < 0 ? "" : ", \"pm10\":" + String(pm10)) + (pm10 < 0 ? "" : ", \"pm10\":" + String(pm10)) +
(pm03PCount < 0 ? "" : ", \"pm003_count\":" + String(pm03PCount)) + // (pm03PCount < 0 ? "" : ", \"pm003_count\":" + String(pm03PCount)) +
(TVOC < 0 ? "" : ", \"tvoc_index\":" + String(TVOC)) + (TVOC < 0 ? "" : ", \"tvoc_index\":" + String(TVOC)) +
(NOX < 0 ? "" : ", \"nox_index\":" + String(NOX)) + (NOX < 0 ? "" : ", \"nox_index\":" + String(NOX)) +
", \"atmp\":" + String(temp) + ", \"atmp\":" + String(temp) +

View File

@ -1,5 +1,5 @@
name=AirGradient Air Quality Sensor name=AirGradient Air Quality Sensor
version=2.4.13 version=2.4.15
author=AirGradient <support@airgradient.com> author=AirGradient <support@airgradient.com>
maintainer=AirGradient <support@airgradient.com> maintainer=AirGradient <support@airgradient.com>
sentence=ESP8266 library for an air quality sensor featuring PM2.5, CO2, Temperature, TVOC and Humidity with OLED display. sentence=ESP8266 library for an air quality sensor featuring PM2.5, CO2, Temperature, TVOC and Humidity with OLED display.