_SKU_SEN0322_Gravity_IIC_Oxygen_Sensor_氧气传感器.JPG

简介

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

版本升级历史

特性

产品参数

引脚说明

标号 名称 功能描述
1 SDA I2C时钟信号线
2 SCL I2C时钟信号线
3 GND
4 VCC 电源

使用教程

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

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

准备

接线图

样例代码

/*!
 * @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);
}

结果

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

SEN0322测试结果

校准

氧气传感器可以利用大气中氧气含量为20.9%的特性进行校准。

校准方式:将传感器通电放置于室外环境中,待传感器数据稳定后,长按传感器上的校准按键2秒,传感器会进行一次校准。

【校准按键图】

Mind+(基于Scratch3.0)图形化编程

1、下载及安装软件。下载地址:https://mindplus.cc 详细教程:Mind+基础wiki教程-软件下载安装

2、软件右上角切换开关,切换到“上传模式”。 详细教程:Mind+基础wiki教程-上传模式编程流程

3、“扩展”中选择“主控板”中的“Arduino Uno”。“用户库”中搜索氧气传感器并加载。 详细教程:Mind+基础wiki教程-加载扩展库流程

4、进行编程,程序如下图:

5、菜单“连接设备”,“上传到设备”,打开串口查看数据。

常见问题

还没有客户对此产品有任何问题,欢迎通过qq或者论坛联系我们! 更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖。

更多

DFshopping_car1.png DFRobot商城购买链接