(SKU:SEN0322)Gravity: IIC Oxygen Sensor(0-25%vol) 氧气传感器

来自DFRobot Product Wiki
跳转至: 导航搜索
文件:SEN0321.png
IIC臭氧传感器

目录

简介

DFRobot最新推出IIC氧气浓度传感器,有效量程为0~30%Vol。该款传感器利用电化学原理对空气中的氧气浓度进行监测,具有高精度、高灵敏度、线性范围宽、抗干扰能力强以及优异的重复性和稳定性的特点。使用IIC接口,就可读取传感器所在环境中的氧气浓度,使用非常简单,兼容各类单片机和传感器。
可广泛应用于工业、矿井、仓储等空气不易流通的空间,以及环保领域中的氧气浓度检测。

特性

  • 高灵敏度
  • 高精度
  • IIC输出
  • 线性范围宽
  • 抗干扰能力强
  • 优异的重复性和稳定性
  • 兼容3.3V和5V主控器(注意:使用3.3V设备时,仍然可以5V供电)
  • 反接保护


产品参数

  • 检测气体: 氧气
  • 工作电压: 3.3~5.5V DC
  • 输出信号: IIC输出
  • 测量范围: 0~25%Vol
  • 最大测量限度: 30%Vol
  • 分辨率: 0.15%
  • 灵敏度: (0.10±0.05)mA(空气中)
  • 稳定性: <2%(/月)
  • 重复性: <2%输出值
  • 响应时间: ≤15秒
  • 工作温度: -20~50℃
  • 工作湿度: 0~99%RH (无凝结)
  • 压力范围: 标准大气压±10%
  • 寿 命: >2 年(空气中)
  • 电路板尺寸:27mm*37mm


引脚说明

SEN0322 引脚图
SEN0322 氧气传感器接口定义
标号 名称 功能描述
1 SDA I2C时钟信号线SDA
2 SCL I2C时钟信号线SCL
3 GND
4 VCC 电源



使用教程

将程序下载到UNO,打开串口监视器查看O2浓度。

注意:预热时间输出的O2浓度值会逐渐趋于稳定,预热3分钟内的O2浓度值请忽略。


准备


接线图

SEN0322 接线图


样例代码

  • 将模块与Arduino按照连线图相连。I2C地址默认为0x70,对应代码中的ADDRESS_0。如果需要修改I2C地址,可先通过模块上的拨码开关配置硬件I2C地址,并修改样例代码中I2C地址的定义ADDRESS_X。拨码开关与I2C地址参数对应关系如下:
    • ADDRESS_0:0x70, A0=0, A1=0
    • ADDRESS_1:0x71, A0=1, A1=0
    • ADDRESS_2:0x72, A0=0, A1=1
    • ADDRESS_3:0x73, A0=1, A1=1
  • 安装DFRobot_GasSensor库。如何安装库?
  • 打开Arduino IDE,将下面的代码上传到Arduino UNO。
  • 打开Arduino IDE的串口监控视器,把波特率调至9600,观察串口打印结果。
 /*!
  * @file  ReadOxygenData.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 the KEY value of the sensor, the key value is a floating point number, because each KEY value of the oxygen sensor, finally read data.
  * @n note: it takes time to stable oxygen concentration, about 5 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)
  * @licence     The MIT License (MIT)
  * @author      ZhixinLiu(zhixin.liu@dfrobot.com)
  * @version     V0.2
  * @date        2019-10-10
  * @get         from https://www.dfrobot.com
  * @url   */
#include "DFRobot_OxygenSensor.h"

#define Oxygen_IICAddress ADDRESS_0
/*   iic slave Address, The default is ADDRESS_0
       ADDRESS_0               0x70           // iic device address
       ADDRESS_1               0x71
       ADDRESS_2               0x72
       ADDRESS_3               0x73
*/

DFRobot_OxygenSensor Oxygen;
void setup() 
{
  Serial.begin(9600);
  while(!Oxygen.begin(Oxygen_IICAddress)) {
    Serial.println("I2c device number error !");
    delay(1000);
  }
  Serial.println("I2c connect success !");

/* Pass in the key value marked on the oxygen sensor */
  Oxygen.SetKeys(20.9 / 102.3);
  
}

void loop(){
  /* Reading oxygen concentration */
  float oxygenData = Oxygen.ReadOxygenData();
  Serial.print(" Oxygen concentration is ");
  Serial.print(oxygenData);
  Serial.println(" %vol(mv)");
  delay(1000);
}
                              


结果

打开串口监视器,预热约3分钟后,得到最终的数据。(测试环境为:空气中)


串口显示O2浓度


校准

氧气传感器有两种校准模式,分别为空气中校准和出厂标定参数校准。传感器经过校准后,会将校准数据存储在EEPROM中,从而避免了传感器每次上电都要校准的情况。

  • 空气校准模式

空气校准模式利用大气中氧气含量为20.9%的特性进行校准,将传感器上电后放置于室外环境中,长按传感器上的校准按键2秒,此时传感器开始进行校准(空气校准模式),校准过程将持续十分钟。在整个空气校准过程中,传感器可以正常输出数据。

SEN0322 校准.png


  • 出厂参数校准

出厂校准模式利用传感器出厂时在标准环境下的标定参数进行校准。

 /*!
  * @file  CalibrateOxygenSensor.ino
  * @brief Calibrate oxygen sensor.
  * @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)
  * @licence     The MIT License (MIT)
  * @author      ZhixinLiu(zhixin.liu@dfrobot.com)
  * @version     V0.2
  * @date        2019-10-10
  * @get         from https://www.dfrobot.com
  * @url   */
#include "DFRobot_OxygenSensor.h"

#define Oxygen_IICAddress ADDRESS_0
/*   iic slave Address, The default is ADDRESS_0.
       ADDRESS_0               0x70      // iic device address.
       ADDRESS_1               0x71
       ADDRESS_2               0x72
       ADDRESS_3               0x73
*/
#define OXYGEN_CONECTRATION    20.9      // The current concentration of oxygen in the air.
#define OXYGEN_MV              0         // The value marked on the sensor, Do not use must be assigned to 0.

DFRobot_OxygenSensor Oxygen;
void setup() 
{
  Serial.begin(9600);
  while(!Oxygen.begin(Oxygen_IICAddress)) {
    Serial.println("I2c device number error !");
    delay(1000);
  }
  Serial.println("I2c connect success !");
  
/*   Choose method 1 or method 2 to calibrate the oxygen sensor.
       1. Directly calibrate the oxygen sensor by adding two parameters to the sensor.
       2. Waiting for stable oxygen sensors for about 10 minutes, 
          OXYGEN_CONECTRATION is the current concentration of oxygen in the air (20.9%mol except in special cases),
          Not using the first calibration method, the OXYGEN MV must be 0.
*/
  Oxygen.Calibrate(OXYGEN_CONECTRATION, OXYGEN_MV);
}

void loop()
{
  Serial.println("The oxygen sensor was calibrated successfully.");
  delay(1000);
}
                              




常见问题

还没有客户对此产品有任何问题,欢迎通过qq或者论坛联系我们!


更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖。


更多


DFshopping car1.png DFRobot商城购买链接

个人工具
名字空间

变换
操作
导航
工具箱