Skip to content

Issue with O2 sensor #7

@jmFschneider

Description

@jmFschneider

Hello,

I add an application with two captors of oxigen and try you sample code.
First with one captor, and every think are going well.

Then I add the secon captor and I introduce modification of oxygen content in air (with CO2 formation).
One captor is in the flux of carbone dioxide, the second is in atmospgenric air. But I was supprise by the fact that the two oxigen values are till the same ! (ie the two value are going from 21.0% to 16.1%, Then when I remove the captor from this low oxigen content, the two values are going back to 21%.
If I reverse the captors, I observe the same behavior.

I follow what is appening on the I2C bus (with a logic analyser), and I see that the two captors are sending differents values when in low oxigen content.

But till now, not able to solve my problem.
Thanks you for your help !

Jean-Marie

The code I am using :

`# -- coding:utf-8 --
'''
  @file get_ozone_data.py
  @brief get ozone concentration, A concentration of one part per billion (PPB).
  @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 configure the mode of active and passive acquisition, Finally, ozone data can be read.
  @n note: it takes time to stable oxygen concentration, about 3 minutes.
  @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
  @license The MIT License (MIT)
  @author ZhixinLiu
  version  V1.0
  date  2021-10-22
  @url https://github.com/DFRobot/DFRobot_Oxygen
'''
import sys
import time
import math
sys.path.append("../..")
from DFRobot_Oxygen import *

COLLECT_NUMBER   = 10              # collect number, the collection range is 1-100
IIC_MODE         = 0x01            # default use IIC1

'''
  The first  parameter is to select iic0 or iic1
  The second parameter is the iic device address
  The default address for iic is ADDRESS_3
  ADDRESS_0                 = 0x70
  ADDRESS_1                 = 0x71
  ADDRESS_2                 = 0x72
  ADDRESS_3                 = 0x73
'''
oxygen_1 = DFRobot_Oxygen_IIC(IIC_MODE ,ADDRESS_3)
oxygen_2 = DFRobot_Oxygen_IIC(IIC_MODE ,ADDRESS_0)

def oxy1():
  oxygen_data = oxygen_1.get_oxygen_data(COLLECT_NUMBER)
  return oxygen_data
 
 
def oxy2():
  oxygen_data = oxygen_2.get_oxygen_data(COLLECT_NUMBER)
  return oxygen_data

if name == "main":
  while True:
  oxygen = oxy1()
  print("oxygen Amont : %4.2f %%vol"%oxygen)
  time.sleep(1)
 
  oxygen = oxy2()
  print("oxygen Aval : %4.2f %%vol"%oxygen)
  time.sleep(1)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions