Skip to content

This repository is for Design and Development of DIY Oxygen Analyzer Prototyping Board, Writing Code and Calibration.

Notifications You must be signed in to change notification settings

ashishkumarpardeshi/DIY_Oxygen_Analyzer

Repository files navigation

DIY Oxygen Analyzer

Oxygen Analyzer is a device which measures Oxygen concentration in ambient Air, of Oxygen Cylinder, Oxygen Concentrator, Medical Ventilators, Incubators etc. It reads Oxygen Concentration in percentage (%).

This repositiry will focus on Design and Development of Do-it-youself Oxygen Analyzer (ie designing Prototyping Board, Writing Code and Calibration).

Here we will be also understanding the sensor, its Output voltage, mapping it to Oxygen concentration, calibration, testing and also logging data.


Repositry Contents


Table of Contents

Lets Start with Block Diagram


In this development we will be using the following components:

  1. MCU or MCU Board : ESP32 (Any other MCU/MCU Board can be used such Arduino, ESP etc)

  2. Oxygen Sensor : OOM202 Oxygen Sensor (Envitech Series by HoneyWell)

  3. 16-ADC : ADS1115

  4. Display : OLED 128 x 64

  5. Temperature Sensor: DS18B20 Isolated Temperature Probe

  6. Switches : Push Buttons

Lets Explore OOM202 Oxygen Sensor

OOM202 is a medical grade oxygen sensor made in germany by Honeywell.

The Datasheet of this Sensor can be found here: OOM202_Datasheet

Some important parameters of OOM202 Oxygen Sensor to be consider.

  • Output in Ambient Air : 13 mV to 16 mV

  • Response Time : < 12 s to 90% final value

  • Linearity error : < 3 % relative

  • Built in Temperature Compensation

OOM202 Sensor Pin Map and Interfacing

The Sensor has 3 pin to interface it with ADC, out of which 2-pins are marked '-' (negative) and 1-pin is marked '+' (positive).

The Positive will connect to any of the four Analog Channel of ADS1115 (In this design it is connected A0) and any one negative pin is connected to GND.


Understanding OOM202 Oxygen Sensor Output Range

The datasheet clearly mention for ambient Air it measures between 13 mV to 16 mV.

Ambient Air in Atmosphere contains 20.95% of Oxygen (Resource: Atmosphere of Earth Wiki)

Therefore we can say

Sensor measure 13 mV to 16 mV for 20.95% of oxygen

If we consider Base value that is 16 mV for 20.95% oxygen then

The upper range as per linear behviour of OOM202 Sensor will be

  • Upper Range = 16 mV x (100 / 20.95 )
  • Upper Range = 76.37 mV

So therefore

For 0 to 100 % of Oxygen, Sensor will output 0 mV to 76.37 mV.

Obviously there might be some variation as per Linear Error mentioned in datasheet, that is < +/-3%.


Converting Sensor Output in mV to Oxygen Concentration in %

The sensor outputs the mV (millivolt) as per Oxygen Concentration and to convert it into Oxygen percent we can do the simple maths

For Ambient Air my sensor is showing 15.4 mV.

So for 20.95% Oxygen sensor outputs 15.4 mV

  • Here 15.4 mV is baseline reading

  • Now my calculation for Oxygen % of sensor output in mV will be

Oxygen Concentration in % = ((Sensor Output in mV / Baseline Volatge in mV) * Oxygen % in Ambient Air)

Thus

Oxygen Concentration in % = ((Sensor Output in mV / 15.4 mV) * 20.95 %)

For Example

  • if Sensor is exposed to unknown percent of Oxygen and it Ouput 69 mV.

Then

  • Oxygen = ((69 mV / 15.4 mV) * 20.95 %)
  • Oxygen = 93.86 %

Therefore the device measures 93.86 % Oxygen Concentration.


The Sensor is straight forward to use and require external high resolution ADC to read measurements.


ADS1115 External 16-Bit ADC

ADS1115 has High Precision 16-Bit ADC and also includes Programmable Gain Amplifier upto 16x, to boost up smaller signal/differential signal to full range.

The Datasheet of this ADS1115 can be found here: ADS1115_Datasheet

Technical Specification

  1. Supply Range: 2.0V to 5.5V
  2. Low Current Consumption: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
  3. Sampling Rate: 8SPS to 860SPS
  4. Internal Low-Drift Voltage Reference
  5. Internal Oscillator
  6. Internal PGA
  7. I2C Interface: Pin-Selectable Addresses
  8. Four Single-Ended OR Two Differential Inputs

This board/chip uses I2C 7-bit addresses between 0x48-0x4B, selectable with jumpers.

Understanding ADS1115 Programmable Gain Amplifier

The Gain of the ADS can be programmed which decides the ADS1115 input voltage range for analog to digital conversion and resolution.

The table below relates the Gain with Input Voltage Range and Resolution

Gain ADC Input Volatge Range 1-Bit Resolution 16-Bit Resolution
2/3x gain +/- 6.144V 1 bit = 3mV 0.1875mV
1x gain +/- 4.096V 1 bit = 2mV 0.125mV
2x gain +/- 2.048V 1 bit = 1mV 0.0625mV
4x gain +/- 1.024V 1 bit = 0.5mV 0.03125mV
8x gain +/- 0.512V 1 bit = 0.25mV 0.015625mV
16x gain +/- 0.256V 1 bit = 0.125mV 0.0078125mV

In this development we will be using 16x PGA which can measure the input voltage in the range 0 mV to 256 mV and gives resolution of 0.0078125 mV.

The Output Range (0 mV to 76.38 mV with +/- 3% linearity error) of OOM202 Oxygen Sensor fits perfectly into the Input Voltage Range for ADC at 16x PGA with resolution of 0.0078125 mV.

How this DIY Oxygen Analyzer will Work?

For the time being MCU board will read ADS1115 over I2C channel every 1 seconds to get reading from OOM202 sensor connected to the Analog A0 channel of ADS1115.

These readings are in mV which will be converted to Oxygen percent and displayed to OLED over I2C channel.

Other features will be added as we progress with development.

Breadboard prototype Testing

The Breadboard prototype is exposed to known sample of oxygen and other gases. The readings are observed on Serial Monitor.

Testing with Known 99.7 % Oxygen

For 99.7% Oxygen of Known Sample and considering the baseline sensor voltage 15.4 mV for 20.9% oxygen the readings Screenshot is given below:

Here the prototype is reading 100 % to 103.82 % for Known Oxygen of 99.7%, we need to write the calibration code and fixing the error as well as saturate the readings for 100 %.

Testing with Helium Gas

For Helium Gas where Oxygen is 0 %

The breadboard prototype here also working fine in the range with negligible error and thus can be corrected with calibration.

Schematic Design

The schematic is designed in KiCAD, an Open Source PCB designing CAD software.

This schematic PDF can be downloaded from here DIY_Oxygen_Analyzer_Schematic_PDF

Acknowledgement and Resources

  1. Prof G Nagarjuna

  2. Mr Abhijeet Mala


License

About

This repository is for Design and Development of DIY Oxygen Analyzer Prototyping Board, Writing Code and Calibration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages