Currently, I am starting in the fancy world of Arduino and sensors. After buying the Grove - Multichannel Gas Sensor V2, together with the Grove Base Shield V2 and the Arduino Rev V3, I did some research on connecting the sensor. It says to preheat the sensor to get the best values.
The Grove Base Shield V2 is placed on top of the Arduino and the gas sensor is connected to the Base shield using the delivered I2C cables. All leds were turned on after connecting the system via USB to my PC, so it seemed to me that the first phase was a success. Then, without disconnecting from the PC, I did the preheating by leaving the arduino connected (via USB) to my PC for 24 hours. After this, I downloaded the zip library via GitHub - Seeed-Studio/Seeed_Arduino_MultiGas: This library could be used to detect four different gas concentrations and display them on the terminal. (archive/master.zip) and created some relatively simple code to print all the values of the gas sensors:
#include <Multichannel_Gas_GMXXX.h>
#include <Wire.h>
GAS_GMXXX<TwoWire> gas;
void setup() {
Serial.begin(9600);
gas.begin(Wire, 0x08); // use the hardware I2C
}
void loop() {
// put your main code here, to run repeatedly:
// GM102B NO2 sensor
int valNO2 = gas.getGM102B();
if (valNO2 > 999) valNO2 = 999;
// GM302B C2H5CH sensor
int valC2H5CH = gas.getGM302B();
if (valC2H5CH > 999) valC2H5CH = 999;
// GM502B VOC sensor
int valVOC = gas.getGM502B();
if (valVOC > 999) valVOC = 999;
// GM702B CO sensor
int valCO = gas.getGM702B();
if (valCO > 999) valCO = 999;
// Print the readings to the console
Serial.print("NO2: ");
Serial.print(valNO2);
Serial.println("ppm");
Serial.print("C2H5CH: ");
Serial.print(valC2H5CH);
Serial.println("ppm");
Serial.print("VOC: ");
Serial.print(valVOC);
Serial.println("ppm");
Serial.print("CO: ");
Serial.print(valCO);
Serial.println("ppm");
delay(100);
}
Running this code, the serial monitor shows only 0 ppm values for each specific sensor, so it seems that the sensor is not picking up any gases.
Another thing is that disconnecting the sensor, the program still prints 0 ppm, so it could be that the connection between Arduino and the gas sensor is working incorrectly somehow. However, the blue led of the gas sensor is turned on when connected, so it must receive power.
Does anyone know what the problem could be in my case and know of any possible solutions?
Do you get proper values when you run example code from the Multichannel_Gas_GMXXX library?
Please post a schematic of the wiring. Written descriptions are always more ambiguous than a drawing. Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.
Post technical data for the relevant components, please.
The preheating "burn-in" requires the sensor heater to be powered for 24 h (72 h if the sensor has not been used for six months). Are you quite sure that this is the case, seeing that you downloaded the library after the burn-in step?
I did power it for 24h, although without running the library. Is this a prerequisite? If so, where can I find this information, such that I will avoid making these kind of mistakes in the future? Thanks a lot for your answer.
Thank you very much for your reply. It was a stupid mistake, and now the values are correctly coming in. In the next step, I have also tried to measure the values for a garlic using the following code:
However, I get the following values over time, which seem to be very inconsistent:
The trend can partly be explained by sensor drift. However, I cannot explain the sinusoidal downward curves for GM302B and GM702B. Do you perhaps have an idea how this could have happened? And how to mitigate these issues in the future? Thanks!
The library is not optimized.
The sensors indicate values much higher than reality.
I don't have an answer to your question.
See here for more information: