Adding additional parameters for Plantower PM sensors

This commit is contained in:
Achim
2022-11-10 16:25:01 +07:00
parent 5dd8a8be32
commit 183f62daf7
2 changed files with 139 additions and 1 deletions

View File

@ -186,6 +186,21 @@ class AirGradient
uint16_t PM_AE_UG_1_0;
uint16_t PM_AE_UG_2_5;
uint16_t PM_AE_UG_10_0;
// Raw particles count (number of particles in 0.1l of air
uint16_t PM_RAW_0_3;
uint16_t PM_RAW_0_5;
uint16_t PM_RAW_1_0;
uint16_t PM_RAW_2_5;
uint16_t PM_RAW_5_0;
uint16_t PM_RAW_10_0;
// Formaldehyde (HCHO) concentration in mg/m^3 - PMSxxxxST units only
uint16_t AMB_HCHO;
// Temperature & humidity - PMSxxxxST units only
int16_t AMB_TMP;
uint16_t AMB_HUM;
};
void PMS(Stream&);
@ -197,8 +212,19 @@ class AirGradient
void requestRead();
bool read_PMS(DATA& data);
bool readUntil(DATA& data, uint16_t timeout = SINGLE_RESPONSE_TIME);
const char* getPM2();
int getPM2_Raw();
int getPM0_3Count();
int getPM0_5Count();
int getPM1_0Count();
int getPM2_5Count();
int getPM5_0Count();
int getPM10_0Count();
int getAMB_TMP();
int getAMB_HUM();
//PMS VARIABLES PUBLIC_END
@ -252,7 +278,7 @@ class AirGradient
enum STATUS { STATUS_WAITING, STATUS_OK };
enum MODE { MODE_ACTIVE, MODE_PASSIVE };
uint8_t _payload[12];
uint8_t _payload[30];
Stream* _stream;
DATA* _data;
STATUS _PMSstatus;