Skip to content

9. input devices#

1.Group work#

Click here for details.

https://fabacademy.org/2025/labs/kannai/Weekly_Group_Assignment/week09/

2.individual work#

Click here for information on base production.#

01. Connecting modules#

Grove - Multichannel Gas Sensor V2 provides stable and reliable gases detecting function under the circumstances of any other four sorts of gases. It can detect a variety of gases, besides Carbon monoxide (CO), Nitrogen dioxide (NO2), Ethyl alcohol(C2H5CH), Volatile Organic Compounds (VOC), and etc.

02. Insert library#

You can import the library by following the steps below.

sketch > include library > add Zip Library

The imported library is here

https://github.com/Seeed-Studio/Seeed_Multichannel_Gas_Sensor/archive/master.zip

  • Differences between the connection terminals of the microcomputer and the terminals of the module
    • Create a conversion connector

Gas Sensor v2

PCB I created

The wiring considering the I/O positional relationship is as shown in the figure below.

In order to achieve this, I made my own conversion connector.

03. Programming#

Coding is done using Arduino.

The program code this time is as follows. This code is a partial modification of the sample code included in the Multichannel_gas_sensor_V2.0.ino library.

You can download the library from here.

https://github.com/Seeed-Studio/Seeed_Multichannel_Gas_Sensor/archive/master.zip

  • Program code
/*
    Multichannel_gas_sensor_V2.0.ino
    Description: A terminal for Seeed Grove Multichannel gas sensor V2.0.
    2019 Copyright (c) Seeed Technology Inc.  All right reserved.
    Author: Hongtai Liu(lht856@foxmail.com)
    2019-9-29
    The MIT License (MIT)
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.1  USA
*/
#include <Multichannel_Gas_GMXXX.h>
// if you use the software I2C to drive the sensor, you can uncommnet the define SOFTWAREWIRE which in Multichannel_Gas_GMXXX.h.
#ifdef SOFTWAREWIRE
    #include <SoftwareWire.h>
    SoftwareWire myWire(3, 2);
    GAS_GMXXX<SoftwareWire> gas;
#else
    #include <Wire.h>
    GAS_GMXXX<TwoWire> gas;
#endif
static uint8_t recv_cmd[8] = {};
void setup() {
    Serial.begin(9600);
    // If you have changed the I2C address of gas sensor, you must to be specify the address of I2C.
    //The default addrss is 0x08;
    gas.begin(Wire, 0x08); // use the hardware I2C
    //gas.begin(MyWire, 0x08); // use the software I2C
    //gas.setAddress(0x64); change thee I2C address
}
void loop() {
    uint8_t len = 0;
    uint8_t addr = 0;
    uint8_t i;
    uint32_t val = 0;
    Serial.print("Variable_1:");Serial.print(gas.getGM102B()); Serial.print(",");
    Serial.print("Variable_2:");Serial.print(gas.getGM302B()); Serial.print(",");
    delay(2000);
}

04. How do physical properties relate to measurement results?#

Grove - Multichannel Gas Sensor v2 can monitor multiple gases: It can detect carbon monoxide (CO), nitrogen dioxide (NO2), ethyl alcohol (C2H5CH), volatile organic compounds (VOC), etc.

This time, we tested whether the Gas Sensor would react when the flux bottle was opened.

Basically, flux is composed of base resin, organic acid glycol ether, solvents such as alcohol, surfactants, zinc chloride, ammonium chloride, and purified water (alcohol, etc.).

As a result, the two sensors reacted simultaneously to the odorous components of the flux. It is a very interesting phenomenon that GM302B reacted more noticeably than GM102B among the four gas sensors.

plaese delete 'docs/'

Checking the data sheet, it can be seen that GM102B (Variable_1) is designed to react to carbon dioxide, and GM302B (Variable_2) is designed to react to ethanol.

GM102B:https://www.winsen-sensor.com/d/files/manual/gm-102b.pdf?campaignid

GM302B:https://www.winsen-sensor.com/d/files/manual/gm-302b.pdf?campaignid

From this, it was determined that it reacted strongly to the ethanol component of the flux.

In addition, according to the data sheet, GM502B is designed to react to ethanol, formaldehyde, toluene, etc., and GM702B is designed to react to carbon monoxide (CO), nitrogen dioxide (NO2), and hydrogen.

GM502B:https://www.winsen-sensor.com/d/files/manual/gm-502b.pdf

GM702B:https://www.winsen-sensor.com/d/files/manual/gm-702b.pdf

The following is information extracted from a translated version of the Chinese datasheet.

GM-102B / GM-302B#

GM-502B#

GM-702B#

Reflection#

  • I learned that the Grove - Multichannel Gas Sensor v2 sensor can detect multiple gases such as CO, NO₂, ethanol, and VOCs. In particular, I understood the characteristic that each element of the sensor (GM102B, GM302B, etc.) reacts specifically to a specific gas.
  • In connecting the microcomputer and the gas sensor, since the terminals were not compatible, I solved the physical connection problem by designing and manufacturing my own conversion connector.
  • I learned how to program to acquire sensor data on the Arduino IDE and how to utilize the library provided by Seeed Studio. In addition, I was able to put into practice that it is possible to operate according to the purpose by making necessary modifications based on the sample code of the library.
  • I experimented with how the sensor reacts when the flux is opened, and considered the relationship between the chemical components of the substance and the reactivity of the sensor. In the experiment, GM302B reacted more strongly than GM102B, so I estimated that it has high sensitivity to ethanol contained in the flux, and this was supported by the data sheet.
  • Through the experience of reading data sheets in English and Chinese, I was able to understand the detection target and technical specifications of the sensor.