Skip to content

File SEN5X_API.cpp

FileList > firmware > SEN5X_API.cpp

Go to the source code of this file

Implementation of functions for reading and initializing the SEN5X sensor. More...

  • #include <SensirionI2CSen5x.h>
  • #include "SEN5X_API.h"
  • #include "Debug.h"

Public Attributes

Type Name
SensirionI2CSen5x sen5x
Instance of Sensirion library object for the SEN5X sensor.
float sen5x_hum = 0.0f
Relative humidity.
float sen5x_mc_10p0 = 0.0f
PM10 mass concentration.
float sen5x_mc_1p0 = 0.0f
PM1.0 mass concentration.
float sen5x_mc_2p5 = 0.0f
PM2.5 mass concentration.
float sen5x_mc_4p0 = 0.0f
PM4.0 mass concentration.
float sen5x_nox = 0.0f
Nitrogen Oxides (NOx) index.
float sen5x_temp = 0.0f
Temperature.
float sen5x_voc = 0.0f
Volatile Organic Compounds (VOC) index.

Public Functions

Type Name
void sen5x_inicializar (void)
Initializes the SEN5X sensor.
bool sen5x_leer (void)
Reads the latest data measured by the sensor and updates the global variables sen5x_* with the new values.

Macros

Type Name
define DEBUG_LEVEL [**DEBUG\_SEN5X**](Debug_8h.md#define-debug_sen5x)
Redefinition of debug level for this source file.
define DEBUG_TAG "SEN5X\_API"
Tag when sending debug messages.

Detailed Description

Author:

[ALD-DSL/ATARI_RESEARCH_LAB]

Date:

[2024-07-22/2025-10-15]

Version:

2.0

Copyright:

GNU General Public License version 3 or later

Note:

This module is an abstraction layer over the SensirionI2CSen5x library.

Public Attributes Documentation

variable sen5x

Instance of Sensirion library object for the SEN5X sensor.

SensirionI2CSen5x sen5x;


variable sen5x_hum

Relative humidity.

float sen5x_hum;


variable sen5x_mc_10p0

PM10 mass concentration.

float sen5x_mc_10p0;


variable sen5x_mc_1p0

PM1.0 mass concentration.

float sen5x_mc_1p0;


variable sen5x_mc_2p5

PM2.5 mass concentration.

float sen5x_mc_2p5;


variable sen5x_mc_4p0

PM4.0 mass concentration.

float sen5x_mc_4p0;


variable sen5x_nox

Nitrogen Oxides (NOx) index.

float sen5x_nox;


variable sen5x_temp

Temperature.

float sen5x_temp;


variable sen5x_voc

Volatile Organic Compounds (VOC) index.

float sen5x_voc;


Public Functions Documentation

function sen5x_inicializar

Initializes the SEN5X sensor.

void sen5x_inicializar (
    void
) 

Searches for the sensor on the I2C bus, resets it, and starts measurements.


function sen5x_leer

Reads the latest data measured by the sensor and updates the global variables sen5x_* with the new values.

bool sen5x_leer (
    void
) 

Returns:

True if the reading was successful


Macro Definition Documentation

define DEBUG_LEVEL

Redefinition of debug level for this source file.

#define DEBUG_LEVEL `DEBUG_SEN5X`


define DEBUG_TAG

Tag when sending debug messages.

#define DEBUG_TAG `"SEN5X_API"`



The documentation for this class was generated from the following file firmware/SEN5X_API.cpp