_SKU_SEN0322_Gravity__IIC_Oxygen_Sensor_0 25%vol__氧气传感器 - jimaobian/DFRobotWikiCn GitHub Wiki

简介
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
引脚说明
| | |
| ----------------------------------- | |
|
:
| |
| 标号 | 名称 | 功能描述 |
| 1 | SDA | I2C时钟信号线SDA |
| 2 | SCL | I2C时钟信号线SCL |
| 3 | GND | 地 |
| 4 | VCC | 电源 |
SEN0322 氧气传感器接口定义
使用教程
将程序下载到UNO,打开串口监视器查看O2浓度。
注意:预热时间输出的O2浓度值会逐渐趋于稳定,预热3分钟内的O2浓度值请忽略。
准备
- 硬件
- DFRuino UNO R3 x1
- SEN0322 氧气浓度传感器 x1
- 杜邦线 若干
- 软件
- Arduino IDE 点击下载Arduino IDE
接线图

样例代码
- 将模块与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([email protected])
* @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分钟后,得到最终的数据。(测试环境为:空气中)
校准
氧气传感器可以设定
常见问题
还没有客户对此产品有任何问题,欢迎通过qq或者论坛联系我们!
| 更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖。 |