edit

# Grove - Gas O₂ Sensor(MIX8410)

Grove - Oxygen Sensor(MIX8410) is a kind of sensor to test the oxygen concentration in air, which is based on the principle of the electrochemical cell to the original work. You can know clearly the current oxygen concentration when you output voltage values proportional to the concentration of oxygen and refer to the oxygen concentration linear characteristic graph. It's very suitable for detecting oxygen concentration in the environment protection. Grove - Oxygen Sensor(MIX8410) is an organic reaction module, it can provide a little current while putting it in the air, we don't need to provide an external power to it, and output voltage will change as time current changes.

Grove - Oxygen Sensor(MIX8410) is a new release version compared to the old one Grove - Oxygen Sensor(ME2-O2-Ф20). So in what areas have we updated? The new version has advanced anti-leakage treatment, which greatly reduces the probability of leakage and solves the problem of leakage in the old version.The output current of the new version is lower, so the electrolyte consumption is slower and the sensor life is longer. In addition, the bottom pins, physical dimensions, top driver board, and usage methods of the new and old versions are the same.

Tip

We've released the Seeed Gas Sensor Selection Guide, it will help you choose the gas sensor that best suits your needs.

## Feature¶

• High sensitivity (0.1±0.03 mA) with linear output
• High stability with <10s response time
• Environmental protection design
• Advanced anti-leakage technology which greatly reduces the probability of leakage
• Low output current for longer sensor life

Tip

## Specification¶

Items Parameter
Measurement Range 0-25%
Sensitivity 0.05~0.15 mA(in air)
Repeatability ±2%
responsible time(t90) ＜ 10s
stability ＜ 2% / moth
Long-term drift ＜ 5% / year
Temperature Range -20 °C~50 °C
Preheat Time 20 minutes
Storage temperature 0-25 °C
Input voltage 3.3V / 5V
Detect Life two years(air)

Note

Leads can be welded during installation, and soldering is forbidden to touch the sensor; The aging time of power-on is not less than 30min; Avoid long-term contact with organic volatile solvents; The use or storage environment cannot be an acid-base environment.

## Hardware¶

Voltage Convertor

The XC6206332MR converts 3.3v/5v input to 3.3v.

Current Source

The MIX8410-O2 is current source. The voltage of the label #3 point is R7 * Current(MIX8410-O2).

Amplifer

The gain of the amplifer is 241, SIGA voltage is 241 times of label #3 point voltage.

Here is the correlation between MIX8410 output current and concentration of O2. The current of 20% concentration O2 is around 96uA. So the Grove SIGA voltage @ 20% concentration = R7 * Current(MIX8410) * 241 = 100 * 96uA * 241 = 2.314V.

Warning

The current ranage of MIX8410 is 8uA~100uA due to individual difference. So the sensor ouput voltage also will different. Please explosure the sensor to fresh air and get reading of output voltage as reference at beginning. You can refer to this example to get the calibration at beginning and then read the sensor values.

## Platforms Supported¶

Arduino Raspberry Pi

Caution

The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

## Getting Started¶

Note

This chapter is based on Win10 and Arduino IDE 1.7.9

This new Grove Gas Sensor O2(MIX8410) usage method is exactly the same as the old ME2-O2-Ф20.

This an easy-to-use module, what you need to do is connect the signal pin (the YELLOW pin of Grove cable) to the ADC input of your controller. If there's no internal ADC in your controller, Grove - I2C ADC is recommend.

Here we will show you how this Grove - Oxygen Sensor(MIX8410) works via a simple demo. First of all, you need to prepare the below stuffs:

Seeeduino V4 Grove - Oxygen Sensor(MIX8410) Base Shield
Get ONE Now Get ONE Now Get ONE Now

### Connection¶

Thanks to the benefit of Grove series modules, you don't need to make soldering or bread board, what you need to do is connect the modules to the right port of Base Shield. For this demo, we have only one Grove module.

• Grove - Oxygen Sensor(MIX8410) is an analog input module, we connect it to A0 at this demo

### Upload the code to Arduino¶

Copy the below code to Arduino IDE.

// Grove - Gas Sensor(O2) test code
// Note:
// 1. It need about about 5-10 minutes to preheat the sensor
// 2. modify VRefer if needed

const float VRefer = 3.3;       // voltage of adc reference

void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Grove - Oxygen Sensor(MIX8410) Test Code...");
}

void loop()
{
// put your main code here, to run repeatedly:
float Vout =0;
Serial.print("Vout =");

Serial.print(Vout);
Serial.print(" V, Concentration of O2 is ");
delay(500);
}

{
long sum = 0;
for(int i=0; i<32; i++)
{
}

sum >>= 5;

float MeasuredVout = sum * (VRefer / 1023.0);
return MeasuredVout;
}

{
// Vout samples are with reference to 3.3V

//float Concentration = FmultiMap(MeasuredVout, VoutArray,O2ConArray, 6);
//when its output voltage is 2.0V,
float Concentration = MeasuredVout * 0.21 / 2.0;
float Concentration_Percentage=Concentration*100;
return Concentration_Percentage;
}


Then choose the right Board and COM port, and then click on the Upload button, this process take few seconds.

### Get data¶

Open serial monitor of your Arduino IDE, and you will get the data now.

Warning

It need about 20~30 minutes to preheat the sensor, or you will get a larger value.

## Getting Started with Raspberry Pi(With Grove Base Hat for Raspberry Pi)¶

#### Hardware¶

• Step 1. Things used in this project:
Raspberry pi Grove Base Hat for RasPi Grove - Gas Sensor O₂(MIX8410)
Get ONE Now Get ONE Now Get ONE Now
• Step 2. Plug the Grove Base Hat into Raspberry.
• Step 3. Connect Grove - Gas Sensor O₂(MIX8410) to analog port A0 of the Base Hat.
• Step 4. Connect the Raspberry Pi to PC through USB cable.

#### Software¶

• Step 1. Follow Setting Software to configure the development environment.
• Step 2. Download the source file by cloning the grove.py library.
cd ~
git clone https://github.com/Seeed-Studio/grove.py

• Step 3. Execute below commands to create the python code.

cd grove.py/grove/
nano MIX8410.py

- Step 4. Copy the following code into the file:

import time , sys, math

__all__ = ["GroveMix8410Sensor"]

VRefer = 3.3
total = 0
Measuredvout = 0

class GroveMix8410:

def __init__(self, channel):
self.channel = channel

@property
def Mix8410(self):
if value != 0:
voltage = value*3.3/1024.0
Mix8410Value = voltage* 0.21 *100/ 2.0
return Mix8410Value
else:
return 0

Grove = GroveMix8410

def main():
if len(sys.argv) < 2:
sys.exit(1)

sensor = GroveMix8410(int(sys.argv[1]))
print('Detecting 02 value...')

while True:
print('Mix8410 Value: {0}'.format(sensor.Mix8410))
time.sleep(1)

if __name__ == '__main__':
main()

• Step 5. Use Ctrl+O to save and Ctrl+X to quit.
• Step 6. Run the following to execute:
python MIX8410.py 0


Success

If everything goes well, you will be able to see the following result.

pi@raspberrypi:~/grove.py/grove\$ python MIX8410.py 0

Detecting 02 value...
Mix8410 Value: 23.6419354839
Mix8410 Value: 23.9129032258
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.8451612903
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9806451613
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9806451613
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9129032258
Mix8410 Value: 23.9129032258
Mix8410 Value: 23.9129032258
Mix8410 Value: 23.9467741935
Mix8410 Value: 23.9129032258


## Projects¶

LoRa IoTea: An automatic information collection system applied to tea plantation. It is part of intelligent agricultural information collection.

A Plant Box with Lighting and Raining You never seen such a way to water you plant.

## Tech Support¶

Please submit any technical issue into our forum.