Multichannel v2 gas sensor to ppm

I got the Grove V2 multichannel gas sensor and have been trying to get accurate values in ppm. Using the V2 library they provide (https://github.com/Seeed-Studio/Seeed_Multichannel_Gas_Sensor/archive/master.zip). I’m getting values that are way off, so I suspect the values aren’t actually being returned in ppm, but I don’t know how to convert them. Either I need new code, or my sensor is not working properly. Here are the values I’m getting:
VOC: ~300
NO2: ~450
CO: ~500
Ethyl Alcohol: ~389

These would all be pretty harmful levels of the gasses and I am in a low air pollution environment.

2 Likes

I’m having the same problem, I was able to mirror code from c++ to Elixir (nerves), since clear specs are missing, it’s not clear wich units am I reading.

It’s also unclear how long preheat must be done and on which schedule it should be done : Only for the beginning of life of the product, or preheat should be done before each measure ?

did you find the answer ?

Nope, the sensor just doesn’t work properly

For anyone that is having issues with the results, to use a phrase…

“You’re doing it wrong”

If you are just calling “gas.getGM102B()” or whichever sensor you are reading, that value is an INT. That value needs to be converted to a float.

To convert your INT value to a REAL value, here is a code sample of what you need to do.

// Ethyl
c2h5ch = gas.getGM302B();
if (c2h5ch > 999) c2h5ch = 999;
f_c2h5ch = gas.calcVol(c2h5ch);

After you get the INT (and do the logic check on the ‘value_max’) for the specific sensor, then you need to pass it to the ‘gas.calcVol(int value)’ function which will return a float value.

You can check out the official SEEED sample here:
Seeed_Arduino_MultiGas/demo_terminal.ino at master · Seeed-Studio/Seeed_Arduino_MultiGas (github.com)

Hi Kevin,
Thanks for taking the time to try and point out that all of us are just “doing it wrong”…
However, I have already been using that exact code sequence you suggested and linked to, and it is simply not working. The values outputted using the float value calculated from gas.calcVol() are just not right. So far, this problem is still not solved and at this point I believe it can only be from a faulty sensor.

1 Like

KevinO,

The gas.calcVol() takes the raw counts returned by the sensor and converts it to a voltage, not the gas concentration. It’s the same calculation for all 4 detectors, and is based on the a/d resolution and V ref.

From the Multichannel_Gas_GMXXXX.h file in the Seeed library for this sensor:
inline float calcVol(uint32_t adc, float verf = GM_VERF, int resolution = GM_RESOLUTION) {
return (adc * verf) / (resolution * 1.0);
};

where GM_VERF is the V ref for the A/D and is set as

#if defined(ARDUINO_ARCH_AVR) // AVR verf 5V
#define GM_VERF 5
#else
#define GM_VERF 3.3
#endif

and GM_RESOLUTION is defined as
#define GM_RESOLUTION 1023

Hello. I am currently implementing a LORAWAN based Gas Sensing Solution using the Multichannel V2 Gas sensor + S2110 Sensor Builder + S2100 Data Logger.

As per the S2110 Sensor Builder firmware, the sensorMultiGas.hpp file mentions that the unit of gas measurement is in ppm as shown below

enum
{
GAS_NO2 = 0x00, // unit : PPM
GAS_C2H5OH = 0x01,
GAS_VOC = 0x02,
GAS_CO = 0x03,
MAX
};

This is being calculated as per the following snippet

m_valueVector[GAS_NO2].value.s32 = val_NO2 * SCALE;
m_valueVector[GAS_C2H5OH].value.s32 = val_C2H5OH * SCALE;
m_valueVector[GAS_VOC].value.s32 = val_VOC * SCALE;
m_valueVector[GAS_CO].value.s32 = val_CO * SCALE;

Where the scaling factor is defined as 1000 in the sensorClass.hpp file.

However I am not sure if the units are in ppm.

For example, in the case of the VOC sensor which as per the datasheet (https://www.winsen-sensor.com/d/files/manual/gm-502b.pdf?searchid=4480) has a detection range of 1 - 500 ppm.

According to my LORAWAN network server, the measured value from the VOC sensor is around 700. Which is 200pm more than the maximum.

Any help would be appreciated.

Thank You