Introduction
The Gravity: I2C Oxygen / O2 Sensor is based on electrochemical principles and it can measure the ambient O2 concentration accurately and conveniently. With high anti-interference ability, high stablility and high sensitivity, this arduino-compatible oxygen / O2 sensor can be widely applied to fields like portable device, air quality monitoring device, and industries, mines, warehouses and other spaces where air is not easy to circulate.
This compact dfrobot oxygen / O2 sensor supports I2C output, it can be calibrated in the air, can accurately measure the oxygen concentration in the environmentit. It is compatible with many mainboards like Arduino Uno, esp32, Raspberry Pi and so on. Its effective range is 0~25%Vol, and resolution can reach to 0.15%Vol. It supports wide range input voltage: 3.3V to 5.5V. Moreover, the lifetime is as long as 2 years. With simple Gravity interface and practical sample code, you can build your own oxygen / O2 concentration monitor easily and conveniently.
Version upgrade history
-V1.0 I2C address can be switched 0X72, 0X73 -V1.1 I2C address can be switched 0X70, 0X71, 0X72, 0X73(upgrade to V1.1 on 2021/12/13)
Features
- Quick calibration function
- High sensitivity
- I2C digital Interface
- Compatible with both 3.3V and 5V micro-controllers
- Polarity protection
- Longer sensor life
Specification
- Detection of Gas: oxygen / O2
- Operating Voltage: 3.3 to 5.5V DC
- Output Signal: I2C output
- Measurement Range: 0~25%Vol
- Maximum Measurement limit: 30%Vol
- Resolution: 0.15%Vol
- Sensitivity: (0.10±0.05) mA (in the air)
- Stability: <2% (Every month)
- Repeatability: <2%
- Response Time: ≤15 seconds
- Operating Temperature: -20~50℃
- Operating humidity: 0~99%RH (no condensation)
- Pressure Range: standard atmospheric pressure ±10%
- Lifetime:> 2 years (in the air)
- Dimension(L x W x H): 37 * 27 * 24.5 mm/1.46 * 1.06 * 0.97 inches
- Weight: 0.037kg
Precautions
- Disable soldering during installation;
- Pins are forbidden to break and bend;
- Electrolyte leakage will cause damage, please do not disassemble the sensor at will;
- The sensor avoids contact with organic solvents (including silica gel and other adhesives), paints, chemicals, fuel oils and high-concentration gases;
- All electrochemical sensors cannot be completely encapsulated with resin materials, nor can they be immersed in an oxygen-free environment, otherwise the performance of the sensor will be damaged;
- All electrochemical sensors should not be used in environments containing corrosive gases, which can damage the sensor;
- When testing and applying the sensor, the front vertical intake must be avoided;
- The intake surface of the sensor must not be blocked or polluted;
- The waterproof and breathable membrane above the sensor is strictly forbidden to be opened or damaged;
- The sensor must not be subject to excessive impact or vibration;
- Do not use the case if it is damaged or deformed;
- In a high-concentration gas environment, it is slow to return to the initial state after long-term use;
- When the sensor is stored, the working electrode and the reference electrode should be in an open state;
- It is forbidden to encapsulate the sensor with hot melt adhesive or sealant with curing temperature higher than 80℃;
- It is forbidden to store and use in high concentration acid gas for a long time.
Board Overview
Num | Label | Description |
---|---|---|
1 | SDA | I2C System Data Line |
2 | SCL | I2C System Clock Line |
3 | GND | - |
4 | VCC | + |
Tutorial
Download the program to Arduino UNO and open the serial monitor to check the O2 concentration.
Requirements
Hardware
- DFRduino UNO R3 (or similar) x 1
- Gravity: I2C Oxygen / O2 Sensor x 1
Software
- Arduino IDE
- Download and install the DFRobot_OxygenSensor Library (About how to install the library?)
Connection Diagram
Sample Code
1.According to the connection diagram to connect the module to Arduino UNO. In default, the I2C address is 0x73 which corresponds to the ADDRESS_3 in the code. If you want to modify the I2C address, please configure the hardware I2C address by the dial switch and modify the IIC address part: ADDRESS_X in the sample code. The relationship between the dial switch and I2C address is shown as below:
- ADDRESS_0:0x70, A0=0, A1=0(V1.0 is not available, upgrade to V1.1 on 2021/12/13)
- ADDRESS_1:0x71, A0=1, A1=0(V1.0 is not available, upgrade to V1.1 on 2021/12/13)
- ADDRESS_2:0x72, A0=0, A1=1
- ADDRESS_3:0x73, A0=1, A1=1
2.Download and install the DFRobot_OxygenSensor Library (About how to install the library?)
3.Open Arduino IDE and upload the code below to Arduino UNO.
4.Open the Arduino IDE's serial monitor, adjust the baud rate to 9600, and observe the serial print results.
/*!
* @file getOxygenData.ino
* @brief Read oxygen concentration ,The unit is concentration percent (% vol).
* @n step: we must first determine the iic device address, will dial the code switch A0, A1 (ADDRESS_0 for [0 0]), (ADDRESS_1 for [1 0]), (ADDRESS_2 for [0 1]), (ADDRESS_3 for [1 1]).
* @n Then calibrate the oxygen sensor
* @n note: it takes time to stable oxygen concentration, about 10 minutes.
* @n The experimental phenomenon is that a certain percentage of oxygen concentration is printed on the serial port.
* @n Because the oxygen concentration in oxygen air is certain, the data will not be greater than 25% vol.
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @license The MIT License (MIT)
* @author ZhixinLiu(zhixin.liu@dfrobot.com)
* @version V1.0
* @date 2021-10-22
* @url https://github.com/DFRobot/DFRobot_OxygenSensor
*/
#include "DFRobot_OxygenSensor.h"
/**
* i2c slave Address, The default is ADDRESS_3.
* ADDRESS_0 0x70 i2c device address.
* ADDRESS_1 0x71
* ADDRESS_2 0x72
* ADDRESS_3 0x73
*/
#define Oxygen_IICAddress ADDRESS_3
#define COLLECT_NUMBER 10 // collect number, the collection range is 1-100.
DFRobot_OxygenSensor oxygen;
void setup(void)
{
Serial.begin(9600);
while(!oxygen.begin(Oxygen_IICAddress)){
Serial.println("I2c device number error !");
delay(1000);
}
Serial.println("I2c connect success !");
}
void loop(void)
{
float oxygenData = oxygen.getOxygenData(COLLECT_NUMBER);
Serial.print(" oxygen concentration is ");
Serial.print(oxygenData);
Serial.println(" %vol");
delay(1000);
}
Expected Results
Turn on the serial monitor and heat it up for about 3 minutes to get the final data. (Test environment: closed environment with ozone generator)
Calibration
The oxygen / O2 sensor can be calibrated using the characteristic that the oxygen content in the atmosphere is 20.9%.
Calibration Method:Place the oxygen / O2 sensor in the outdoor environment, after the sensor data is stable, long press the calibration button on the sensor for 2 seconds, the sensor will be calibrated.
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum. If you have any questions about using this product, please check the FAQ list for that product for a corresponding solution.