Skip to content

Commit

Permalink
Merge pull request adafruit#46 from brentru/add-particles
Browse files Browse the repository at this point in the history
Add particles
  • Loading branch information
brentru authored Mar 3, 2023
2 parents 355dde3 + 2af7609 commit 716fa39
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
20 changes: 19 additions & 1 deletion Adafruit_Sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,27 @@ void Adafruit_Sensor::printSensorDetails(void) {
case SENSOR_TYPE_CO2:
Serial.print(F("Carbon Dioxide (ppm)"));
break;
case SENSOR_TYPE_eCO2:
case SENSOR_TYPE_ECO2:
Serial.print(F("Equivalent/estimated CO2 (ppm)"));
break;
case SENSOR_TYPE_PM10_STD:
Serial.print(F("Standard Particulate Matter 1.0 (ppm)"));
break;
case SENSOR_TYPE_PM25_STD:
Serial.print(F("Standard Particulate Matter 2.5 (ppm)"));
break;
case SENSOR_TYPE_PM100_STD:
Serial.print(F("Standard Particulate Matter 100 (ppm)"));
break;
case SENSOR_TYPE_PM10_ENV:
Serial.print(F("Environmental Particulate Matter 1.0 (ppm)"));
break;
case SENSOR_TYPE_PM25_ENV:
Serial.print(F("Environmental Particulate Matter 2.5 (ppm)"));
break;
case SENSOR_TYPE_PM100_ENV:
Serial.print(F("Environmental Particulate Matter 100 (ppm)"));
break;
}

Serial.println();
Expand Down
20 changes: 19 additions & 1 deletion Adafruit_Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ typedef enum {
SENSOR_TYPE_VOC_INDEX = (19),
SENSOR_TYPE_NOX_INDEX = (20),
SENSOR_TYPE_CO2 = (21),
SENSOR_TYPE_eCO2 = (22),
SENSOR_TYPE_ECO2 = (22),
SENSOR_TYPE_PM10_STD = (23),
SENSOR_TYPE_PM25_STD = (24),
SENSOR_TYPE_PM100_STD = (25),
SENSOR_TYPE_PM10_ENV = (26),
SENSOR_TYPE_PM25_ENV = (27),
SENSOR_TYPE_PM100_ENV = (28)
} sensors_type_t;

/** struct sensors_vec_s is used to return a vector in a common format. */
Expand Down Expand Up @@ -147,6 +153,18 @@ typedef struct {
float CO2; /**< Measured CO2 in parts per million (ppm) */
float eCO2; /**< equivalent/estimated CO2 in parts per million (ppm
estimated from some other measurement) */
float pm10_std; /**< Standard Particulate Matter 1.0 in parts per million
(ppm) */
float pm25_std; /**< Standard Particulate Matter 2.5 in parts per million
(ppm) */
float pm100_std; /**< Standard Particulate Matter 100 in parts per million
(ppm) */
float pm10_env; /**< Environmental Particulate Matter 1.0 in parts per
million (ppm) */
float pm25_env; /**< Environmental Particulate Matter 2.5 in parts per
million (ppm) */
float pm100_env; /**< EnvironmentalParticulate Matter 100 in parts per
million (ppm) */
sensors_color_t color; /**< color in RGB component values */
}; ///< Union for the wide ranges of data we can carry
} sensors_event_t;
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ typedef enum
SENSOR_TYPE_VOC_INDEX = (19),
SENSOR_TYPE_NOX_INDEX = (20),
SENSOR_TYPE_CO2 = (21),
SENSOR_TYPE_eCO2 = (22),
SENSOR_TYPE_ECO2 = (22),
SENSOR_TYPE_PM10_STD = (23),
SENSOR_TYPE_PM25_STD = (24),
SENSOR_TYPE_PM100_STD = (25),
SENSOR_TYPE_PM10_ENV = (26),
SENSOR_TYPE_PM25_ENV = (27),
SENSOR_TYPE_PM100_ENV = (28)
} sensors_type_t;
```

Expand Down Expand Up @@ -147,6 +153,12 @@ typedef struct
float nox_index;
float CO2,
float eCO2,
float pm10_std,
float pm25_std,
float pm100_std,
float pm10_env,
float pm25_env,
float pm100_env,
sensors_color_t color;
};
} sensors_event_t;
Expand Down Expand Up @@ -194,7 +206,12 @@ A key part of the abstraction layer is the standardisation of values on SI units
- **nox_index**: values are an **index** from 1-500 with 100 being normal
- **CO2**: values are in **parts per million*** (ppm)
- **eCO2**: values are in **parts per million*** (ppm)

- **pm10_std**: values are in **parts per million*** (ppm)
- **pm25_std**: values are in **parts per million*** (ppm)
- **pm100_std**: values are in **parts per million*** (ppm)
- **pm10_env**: values are in **parts per million*** (ppm)
- **pm25_env**: values are in **parts per million*** (ppm)
- **pm100_env**: values are in **parts per million*** (ppm)

## The Unified Driver Abstraction Layer in Practice ##

Expand Down

0 comments on commit 716fa39

Please sign in to comment.