Loading...
Searching...
No Matches
SM_PWM_01C dust sensor

Driver for Amphenol SM_PWM_01C infrared dust sensor. More...

Detailed Description

Driver for Amphenol SM_PWM_01C infrared dust sensor.

* About

This driver provides an interface for the Amphenol SM-PWM-Sensor. The Datasheet can be found here. and the more complete application note here

The device can measure small particles (1~ 2μm) and large particle (3 ~10μm), so similar to PM2.5 and PM10. The dust sensor cannot count particles only measure estimated concentrations.

It is recommended to compute values over a 30s moving average. By default a moving average is used since the module MODULE_SM_PWM_01C_MA is activated by default. To save memory an exponential average can be used by disabling this module.

Modules

 SM_PWM_01C compile configurations
 

Files

file  sm_pwm_01c.h
 SM_PWM_01C Device Driver.
 
file  sm_pwm_01c_params.h
 Default configuration for SM_PWM_01C driver.
 

Data Structures

struct  circ_buf_t
 Circular buffer holding moving average values. More...
 
struct  sm_pwm_01c_params_t
 Parameters for the SM_PWM_01c sensor. More...
 
struct  sm_pwm_01c_data_t
 LPO and concentration (ug/m3) values for small and large particles. More...
 
struct  sm_pwm_01c_values_t
 LPO and concentration (ug/m3) values for small and large particles. More...
 
struct  sm_pwm_01c_t
 Device descriptor for the SM_PWM_01c sensor. More...
 

Functions

int sm_pwm_01c_init (sm_pwm_01c_t *dev, const sm_pwm_01c_params_t *params)
 Initialize the given SM_PWM_01C device.
 
void sm_pwm_01c_start (sm_pwm_01c_t *dev)
 Start continuous measurement of Large and Small particle concentrations.
 
void sm_pwm_01c_stop (sm_pwm_01c_t *dev)
 Stops continuous measurement of Large and Small particle concentration.
 
void sm_pwm_01c_read_data (sm_pwm_01c_t *dev, sm_pwm_01c_data_t *data)
 Reads particle concentration values.
 

Function Documentation

◆ sm_pwm_01c_init()

int sm_pwm_01c_init ( sm_pwm_01c_t dev,
const sm_pwm_01c_params_t params 
)

Initialize the given SM_PWM_01C device.

Parameters
[out]devInitialized device descriptor of SM_PWM_01C device
[in]paramsThe parameters for the SM_PWM_01C device
Return values
0on success
-EIOGPIO error

◆ sm_pwm_01c_read_data()

void sm_pwm_01c_read_data ( sm_pwm_01c_t dev,
sm_pwm_01c_data_t data 
)

Reads particle concentration values.

Parameters
[in]devDevice descriptor of SM_PWM_01C device
[out]dataPre-allocated memory to hold measured concentrations

◆ sm_pwm_01c_start()

void sm_pwm_01c_start ( sm_pwm_01c_t dev)

Start continuous measurement of Large and Small particle concentrations.

Parameters
[in]devDevice descriptor of SM_PWM_01C device

◆ sm_pwm_01c_stop()

void sm_pwm_01c_stop ( sm_pwm_01c_t dev)

Stops continuous measurement of Large and Small particle concentration.

Parameters
[in]devDevice descriptor of SM_PWM_01C device