amc2021:mq-135:start
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| amc2021:mq-135:start [2021/09/03 01:19] – created kshama001 | amc2021:mq-135:start [2021/09/03 18:47] (current) – removed kshama001 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Important libraries used in the code ====== | ||
| - | < | ||
| - | / | ||
| - | /*! | ||
| - | @file | ||
| - | @author | ||
| - | @license | ||
| - | @section | ||
| - | |||
| - | v1.0 - First release | ||
| - | */ | ||
| - | / | ||
| - | #ifndef MQ135_H | ||
| - | #define MQ135_H | ||
| - | #if ARDUINO >= 100 | ||
| - | # | ||
| - | #else | ||
| - | # | ||
| - | #endif | ||
| - | |||
| - | /// The load resistance on the board | ||
| - | #define RLOAD 10.0 | ||
| - | /// Calibration resistance at atmospheric CO2 level | ||
| - | #define RZERO 65 | ||
| - | /// Parameters for calculating ppm of CO2 from sensor resistance | ||
| - | #define PARA 116.6020682 | ||
| - | #define PARB 2.769034857 | ||
| - | </ | ||
| - | |||
| - | *Rzero is the value of the resistor in the MQ-135 sensor in the presence of clean air. Where the CO < | ||
| - | *RLOAD meanwhile is the external resistor value that is connected to the MQ-135 sensor, which in this case is 10kΩ. | ||
| - | *Important parameters are for calculating CO< | ||
| - | |||
| - | < | ||
| - | |||
| - | /// Parameters to model temperature and humidity dependence | ||
| - | #define CORA 0.00035 | ||
| - | #define CORB 0.02718 | ||
| - | #define CORC 1.39538 | ||
| - | #define CORD 0.0018 | ||
| - | |||
| - | /// Atmospheric CO2 level for calibration purposes | ||
| - | #define ATMOCO2 397.13 | ||
| - | |||
| - | class MQ135 { | ||
| - | | ||
| - | uint8_t _pin; | ||
| - | |||
| - | | ||
| - | MQ135(uint8_t pin); | ||
| - | float getCorrectionFactor(float t, float h); | ||
| - | float getResistance(); | ||
| - | float getCorrectedResistance(float t, float h); | ||
| - | float getPPM(); | ||
| - | float getCorrectedPPM(float t, float h); | ||
| - | float getRZero(); | ||
| - | float getCorrectedRZero(float t, float h); | ||
| - | }; | ||
| - | #endif | ||
| - | </ | ||
amc2021/mq-135/start.1630624761.txt.gz · Last modified: 2023/01/05 14:38 (external edit)