![]() |
SparkFun Air Quality PM1/PM2.5/PM10 Sensor - BMV080
v1.0.0-15-g8f97a54
Library for the SparkFun Air Quality PM1/PM2.5/PM10 Sensor - BMV080r
|
Class for interfacing with the BMV080 sensor using I2C communication. More...
#include <SparkFun_BMV080_Arduino_Library.h>
Public Member Functions | |
bool | begin (const uint8_t address=SF_BMV080_DEFAULT_ADDRESS, TwoWire &wirePort=Wire) |
Begins the Device with I2C as the communication bus. More... | |
bool | isConnected () |
Checks if the Device is connected. More... | |
sfTkError_t | begin (sfTkIBus *theBus=nullptr) |
Begins communication with the BMV080 sensor. More... | |
bool | init (void) |
Initializes the BMV080 sensor. More... | |
bool | driverVersion (uint16_t &major, uint16_t &minor, uint16_t &patch) |
Gets the version information of the BMV080 sensor driver. More... | |
bool | open (void) |
Opens and initializes communication with the BMV080 sensor. More... | |
bool | close (void) |
Closes communication with the BMV080 sensor. More... | |
bool | reset (void) |
Resets the BMV080 sensor to its default state. More... | |
bool | ID (char idOut[kBMV800IDLength]) |
Gets the unique identifier of the BMV080 sensor. More... | |
bool | setMode (uint8_t mode) |
Sets the operational mode of the BMV080 sensor. More... | |
float | PM10 (void) |
Gets the PM10 (particulate matter ≤10 µm) concentration. More... | |
float | PM25 (void) |
Gets the PM2.5 (particulate matter ≤2.5 µm) concentration. More... | |
float | PM1 (void) |
Gets the PM1 (particulate matter ≤1.0 µm) concentration. More... | |
bool | isObstructed () |
Checks if the BMV080 sensor is obstructed. More... | |
void | setSensorValue (bmv080_output_t bmv080_output) |
Internal method to set sensor values from callback. More... | |
bool | readSensor (bmv080_output_t *bmv080_output=nullptr) |
Reads the latest sensor values from the BMV080. More... | |
uint16_t | dutyCyclingPeriod () |
Gets the current duty cycling period setting. More... | |
bool | setDutyCyclingPeriod (uint16_t duty_cycling_period) |
Sets the time interval between measurements in duty cycle mode. More... | |
float | volumetricMassDensity () |
Gets the volumetric mass density setting. More... | |
bool | setVolumetricMassDensity (float volumetric_mass_density) |
Sets the volumetric mass density for particle concentration calculations. More... | |
float | integrationTime () |
Gets the sensor's integration time setting. More... | |
bool | setIntegrationTime (float integration_time) |
Sets the sensor's integration time for measurements. More... | |
uint32_t | distributionId () |
Gets the current distribution ID setting. More... | |
bool | setDistributionId (uint32_t distribution_id) |
Sets the distribution ID for particle size classification. More... | |
bool | doObstructionDetection () |
Gets the obstruction detection setting. More... | |
bool | setDoObstructionDetection (bool do_obstruction_detection) |
Enables or disables the sensor's obstruction detection feature. More... | |
bool | doVibrationFiltering () |
Gets the vibration filtering setting. More... | |
bool | setDoVibrationFiltering (bool do_vibration_filtering) |
Enables or disables vibration filtering. More... | |
uint8_t | measurementAlgorithm () |
Gets the current measurement algorithm setting. More... | |
bool | setMeasurementAlgorithm (uint8_t measurement_algorithm) |
Sets the measurement algorithm for particle analysis. More... | |
Static Public Attributes | |
static const size_t | kBMV800IDLength = 13 |
Length of the BMV080 sensor ID string buffer. More... | |
Protected Attributes | |
sfTkIBus * | _theBus |
Class for interfacing with the BMV080 sensor using I2C communication.
This class provides methods to initialize and communicate with the BMV080 sensor over an I2C bus. It inherits from the sfDevBMV080 class and uses the SparkFun Toolkit for I2C communication.
|
inline |
Begins the Device with I2C as the communication bus.
This method initializes the I2C bus and sets up communication with the BMV080 sensor.
address | I2C device address to use for the sensor |
wirePort | Wire port to use for I2C communication |
|
inherited |
Begins communication with the BMV080 sensor.
This method initializes the communication interface with the sensor. It must be called before init() and any other operations with the sensor.
theBus | SparkFun Toolkit bus interface to use for communication. |
|
inherited |
Closes communication with the BMV080 sensor.
|
inherited |
Gets the current distribution ID setting.
This method returns the distribution ID used by the sensor for particle size classification. The distribution ID affects how particles are categorized into different size bins.
|
inherited |
Gets the obstruction detection setting.
This method returns whether the sensor's obstruction detection feature is enabled. When enabled, the sensor will monitor for any blockages in its optical path.
|
inherited |
Gets the vibration filtering setting.
This method returns whether the sensor's vibration filtering feature is enabled. When enabled, the sensor applies algorithms to reduce measurement noise caused by mechanical vibrations.
|
inherited |
Gets the version information of the BMV080 sensor driver.
This method retrieves the vendor-supplied version information for the sensor driver software. The version follows semantic versioning format with major, minor, and patch numbers.
[out] | major | Major version number indicating incompatible API changes |
[out] | minor | Minor version number indicating backwards-compatible functionality |
[out] | patch | Patch version number indicating backwards-compatible bug fixes |
|
inherited |
Gets the current duty cycling period setting.
Returns the time interval between measurements when the sensor is in duty cycle mode. This setting has no effect when the sensor is in continuous measurement mode.
|
inherited |
Gets the unique identifier of the BMV080 sensor.
This method retrieves the sensor's unique identification string. The ID can be used to distinguish between different BMV080 sensors or verify the sensor's authenticity.
[out] | idOut | Buffer to store the sensor's ID string. Must be at least kBMV800IDLength (13) bytes long. |
|
inherited |
Initializes the BMV080 sensor.
This method performs complete initialization of the sensor by:
It must be called after begin() and before attempting any other operations.
|
inherited |
Gets the sensor's integration time setting.
This method returns the current integration time setting used for particle measurements. The integration time affects the sensor's measurement accuracy and response time.
|
inline |
Checks if the Device is connected.
|
inherited |
Checks if the BMV080 sensor is obstructed.
This method returns the obstruction status from the latest sensor reading. An obstruction could be caused by dust, debris, or other particles blocking the sensor's optical path.
|
inherited |
Gets the current measurement algorithm setting.
This method returns the measurement algorithm used by the sensor for particle analysis. Different algorithms can be optimized for specific measurement conditions or particle types.
|
inherited |
Opens and initializes communication with the BMV080 sensor.
This method initializes a new handle for communicating with the sensor. It must be called before attempting to configure or read from the sensor.
|
inherited |
Gets the PM1 (particulate matter ≤1.0 µm) concentration.
This method returns the latest PM1 reading from the sensor's internal cache. The value represents the mass concentration of particles with a diameter of 1.0 micrometers or less.
|
inherited |
Gets the PM10 (particulate matter ≤10 µm) concentration.
This method returns the latest PM10 reading from the sensor's internal cache. The value represents the mass concentration of particles with a diameter of 10 micrometers or less.
|
inherited |
Gets the PM2.5 (particulate matter ≤2.5 µm) concentration.
This method returns the latest PM2.5 reading from the sensor's internal cache. The value represents the mass concentration of particles with a diameter of 2.5 micrometers or less.
|
inherited |
Reads the latest sensor values from the BMV080.
This method triggers a sensor reading and updates the internal data cache. If a pointer to a bmv080_output_t struct is provided, it will be populated with the latest sensor values.
[out] | bmv080_output | Optional pointer to a bmv080_output_t struct to store the sensor readings. If nullptr (default), the values are only stored internally. |
|
inherited |
Resets the BMV080 sensor to its default state.
This method performs a soft reset of the sensor, returning all settings to their default values. The sensor will need to be reconfigured after a reset.
|
inherited |
Sets the distribution ID for particle size classification.
This method configures which particle size distribution model the sensor uses for classifying particles. Different distribution IDs are optimized for different types of particles and environments.
distribution_id | The distribution ID to use for particle classification |
|
inherited |
Enables or disables the sensor's obstruction detection feature.
This method controls whether the sensor actively monitors for obstructions in its optical path. When enabled, the sensor will report blockages through the isObstructed() method.
do_obstruction_detection | true to enable obstruction detection, false to disable it |
|
inherited |
Enables or disables vibration filtering.
This method controls whether the sensor applies vibration filtering algorithms to reduce measurement noise caused by mechanical vibrations. Enabling this feature can improve measurement accuracy in environments with significant vibration.
do_vibration_filtering | true to enable vibration filtering, false to disable it |
|
inherited |
Sets the time interval between measurements in duty cycle mode.
This method configures how frequently the sensor takes measurements when operating in duty cycle mode. A longer period reduces power consumption but provides less frequent updates.
duty_cycling_period | The time between measurements in seconds |
|
inherited |
Sets the sensor's integration time for measurements.
This method configures the integration time used for particle measurements. Longer integration times can improve measurement accuracy but increase response time and power consumption.
integration_time | The measurement integration time in milliseconds (ms) |
|
inherited |
Sets the measurement algorithm for particle analysis.
This method configures which algorithm the sensor uses for analyzing particle measurements. Different algorithms can be optimized for specific types of particles or measurement environments.
measurement_algorithm | The algorithm identifier to use for measurements |
|
inherited |
Sets the operational mode of the BMV080 sensor.
This method configures how the sensor takes measurements. It supports two modes: continuous measurement or duty-cycled measurement.
mode | The desired operational mode:
|
|
inherited |
Internal method to set sensor values from callback.
This method is called by the BMV080 driver callback to update internal sensor data. It stores the latest sensor readings and sets the data available flag.
bmv080_output | The sensor output structure containing the latest readings including PM2.5, PM1, and obstruction status |
|
inherited |
Sets the volumetric mass density for particle concentration calculations.
This method configures the density value used to convert between particle counts and mass concentrations. This setting affects the accuracy of PM2.5 and PM1 measurements based on the expected particle density.
volumetric_mass_density | The particle density in grams per cubic centimeter (g/cm³) |
|
inherited |
Gets the volumetric mass density setting.
This method returns the current volumetric mass density setting used for particle concentration calculations. This value affects how the sensor converts between particle counts and mass concentrations.
|
protectedinherited |
|
staticinherited |