71 MQ8(
const unsigned int& digitalOutputPinNumber);
142 std::string
ToString()
const override;
Base class for the MQ-series gas sensors (MQ2, MQ7, ...).
Definition: GasSensor.h:19
Interface for analog-to-digital converter components (e.g.
Definition: AnalogDigitalConverterComponent.h:14
MQ-8 gas sensor, typically used for detecting hydrogen.
Definition: MQ8.h:14
virtual ~MQ8()
Destroys the sensor, turning it off first.
Definition: MQ8.cpp:85
double ReadGasValue() const override
Reads the current hydrogen PPM for the sensor's raw reading (from the precomputed cache).
Definition: MQ8.cpp:129
std::string ToString() const override
Serializes the MQ-8's gas name, raw reading, and hydrogen PPM to a string.
Definition: MQ8.cpp:168
MQ8()
Builds a default MQ-8 (hydrogen) sensor and initializes its datasheet values.
Definition: MQ8.cpp:15
void Initialize() override
Initializes the MQ-8's datasheet values (its hydrogen gas curve) and precomputes a PPM value for ever...
Definition: MQ8.cpp:101
double CalculateHydrogenPPM(const double &sensorGasValueInVolts) const
Computes the hydrogen concentration (PPM) from the sensor's output voltage using a power-law fit of t...
Definition: MQ8.cpp:149
RumPi is the library's top-level facade.
Definition: AlertManager.h:6