71 MQ4(
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-4 gas sensor, typically used for detecting methane.
Definition: MQ4.h:14
virtual ~MQ4()
Destroys the sensor, turning it off first.
Definition: MQ4.cpp:85
std::string ToString() const override
Serializes the MQ-4's gas name, raw reading, and methane PPM to a string.
Definition: MQ4.cpp:168
double ReadGasValue() const override
Reads the current methane PPM for the sensor's raw reading (from the precomputed cache).
Definition: MQ4.cpp:129
double CalculateMethanePPM(const double &sensorGasValueInVolts) const
Computes the methane concentration (PPM) from the sensor's output voltage using an exponential fit of...
Definition: MQ4.cpp:149
void Initialize() override
Initializes the MQ-4's datasheet values (its methane gas curve) and precomputes a PPM value for every...
Definition: MQ4.cpp:101
MQ4()
Builds a default MQ-4 (methane) sensor and initializes its datasheet values.
Definition: MQ4.cpp:15
RumPi is the library's top-level facade.
Definition: AlertManager.h:6