![]() |
Electrochemical Gas Sensor Library 1.0.0
A library for the Electrochemical Gas Sensor breakout board
|
#include <Electrochemical-Gas-Sensor-SOLDERED.h>
Public Member Functions | |
| ElectrochemicalGasSensor (sensorType _t, uint8_t _adcAddr=DEFAULT_ADC_ADDR, int _configPin=-1) | |
| Constructor on custom address. | |
| bool | begin () |
| Init the sensor and begin measuring with the ADC, must be called before using. | |
| bool | configureLMP () |
| Configure the LMP91000, has to be done at startup. | |
| double | getVoltage () |
| get the voltage which the ADS is currently measuring | |
| double | getPPM () |
| Make a measurement with the ADC and calculate the PPM value of the measured gas. | |
| double | getPPB () |
| Calcualte PPB values from PPM. | |
| double | getAveragedPPM (uint8_t _numMeasurements=5, uint8_t _secondsDelay=2) |
| Calculate an averaged PPM measurement from a number of separate measurements. | |
| double | getAveragedPPB (uint8_t _numMeasurements=5, uint8_t _secondsDelay=2) |
| Calculate an averaged PPB measurement from a number of separate measurements. | |
| void | setCustomTiaGain (float _tiaGain) |
| Set a custom number of the kOhms in the TIA gain. | |
| void | setCustomZeroCalibration (double calibration) |
| Set a custom value for the zero calibration. | |
Private Member Functions | |
| float | getTiaGain () |
| Get the actual number of the kOhms in the TIA gain. | |
| float | getInternalZeroPercent () |
| Get the internal zero % setting as an actual float. | |
| bool | bridgeTransaction (uint8_t cmd, const uint8_t *payload, uint8_t payloadLen, uint8_t *resultHigh, uint8_t *resultLow) |
| Send a command to the ATtiny bridge and poll the 3-byte response. | |
| bool | pingBridge () |
| bool | sendConfigureAdc (uint8_t gain, uint8_t dataRate) |
| bool | sendConfigureLmp (uint8_t tiacn, uint8_t refcn, uint8_t modecn) |
| bool | triggerAndReadAdc (int16_t &rawOut) |
Private Attributes | |
| LMP91000 * | lmp |
| ADS1115 * | ads |
| uint8_t | adcAddr |
| int | configPin |
| sensorType | type |
| TransportMode | mode |
| float | tiaGainInKOHms |
| float | internalZeroPercent |
| ElectrochemicalGasSensor::ElectrochemicalGasSensor | ( | sensorType | _t, |
| uint8_t | _adcAddr = DEFAULT_ADC_ADDR, | ||
| int | _configPin = -1 ) |
| bool ElectrochemicalGasSensor::begin | ( | ) |
Init the sensor and begin measuring with the ADC, must be called before using.
|
private |
Send a command to the ATtiny bridge and poll the 3-byte response.
| bool ElectrochemicalGasSensor::configureLMP | ( | ) |
Configure the LMP91000, has to be done at startup.
| double ElectrochemicalGasSensor::getAveragedPPB | ( | uint8_t | _numMeasurements = 5, |
| uint8_t | _secondsDelay = 2 ) |
Calculate an averaged PPB measurement from a number of separate measurements.
| uint8_t | _numMeasurements How many measurements to do |
| uint8_t | _secondsDelay How many seconds to wait between each measurement |
| double ElectrochemicalGasSensor::getAveragedPPM | ( | uint8_t | _numMeasurements = 5, |
| uint8_t | _secondsDelay = 2 ) |
Calculate an averaged PPM measurement from a number of separate measurements.
| uint8_t | _numMeasurements How many measurements to do |
| uint8_t | _secondsDelay How many seconds to wait between each measurement |
|
private |
Get the internal zero % setting as an actual float.
| double ElectrochemicalGasSensor::getPPB | ( | ) |
Calcualte PPB values from PPM.
| double ElectrochemicalGasSensor::getPPM | ( | ) |
Make a measurement with the ADC and calculate the PPM value of the measured gas.
|
private |
Get the actual number of the kOhms in the TIA gain.
| double ElectrochemicalGasSensor::getVoltage | ( | ) |
get the voltage which the ADS is currently measuring
|
private |
|
private |
|
private |
| void ElectrochemicalGasSensor::setCustomTiaGain | ( | float | _tiaGain | ) |
Set a custom number of the kOhms in the TIA gain.
| void ElectrochemicalGasSensor::setCustomZeroCalibration | ( | double | calibration | ) |
Set a custom value for the zero calibration.
| calibration | Voltage level at 0ppm |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |