ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
mics_math.h File Reference

Go to the source code of this file.

Data Structures

struct  esphome::mics_5524::micsmath::VendorCurve
 Per-gas constants of the vendor model. More...
 

Namespaces

namespace  esphome
 
namespace  esphome::mics_5524
 
namespace  esphome::mics_5524::micsmath
 

Functions

float esphome::mics_5524::micsmath::air_value_from_voltage (float voltage, float vcc)
 x = VCC - V_ao: 0 at VCC (a saturated sensor, never clean air).
 
bool esphome::mics_5524::micsmath::calibration_is_stable (float min_value, float max_value, float mean)
 True when the clean-air samples spread at most MAX_CALIBRATION_SPREAD of their mean.
 
float esphome::mics_5524::micsmath::ratio_from_air_value (float x, float x_air)
 ratio = x / x_air (NaN when either value is unusable).
 
float esphome::mics_5524::micsmath::ppm_from_vendor_curve (float ratio, const VendorCurve &curve)
 ratio -> ppm as DFRobot_MICS getGasData(): 0 above the threshold or below the vendor range, the top of the range at ratio 0 (a saturated sensor), NaN stays NaN.
 

Variables

constexpr float esphome::mics_5524::micsmath::MAX_CALIBRATION_SPREAD = 0.25f
 Largest relative spread (max - min) / mean a clean-air calibration accepts.