72 MQ3(
const unsigned int& digitalOutputPinNumber);
129 double CalculateBAC(
const double& sensorValueInVolts)
const;
143 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-3 gas sensor, typically used for detecting alcohol vapor (breathalyzer).
Definition: MQ3.h:15
double CalculateBAC(const double &sensorValueInVolts) const
Estimates blood-alcohol content (BAC) from the sensor's output voltage using a 5th-degree polynomial ...
Definition: MQ3.cpp:148
MQ3()
Builds a default MQ-3 (alcohol) sensor and initializes its datasheet values.
Definition: MQ3.cpp:15
virtual ~MQ3()
Destroys the sensor, turning it off first.
Definition: MQ3.cpp:85
std::string ToString() const override
Serializes the MQ-3's raw reading and estimated BAC to a string.
Definition: MQ3.cpp:176
void Initialize() override
Initializes the MQ-3's datasheet values (its alcohol gas curve) and precomputes a BAC value for every...
Definition: MQ3.cpp:101
double ReadGasValue() const override
Reads the current estimated BAC for the sensor's raw reading (from the precomputed cache).
Definition: MQ3.cpp:128
RumPi is the library's top-level facade.
Definition: AlertManager.h:6