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.
-
/Datasheet -- Contains datasheets of components used.
-
/Docs and Tutorials -- Contains documentation.
-
/Oxygen_Analyzer_KiCAD -- Prototyping Board KiCAD files, 3D Board Images, Schematic pdf and Components Lib, footprint & 3D Models.
-
/Oxygen_Analyzer_Code -- Code for DIY Oxygen Analyzer. (Under Development)
-
/Sample_Codes_for_Testing_Peripherals -- Sample code for testing inividual peripherals on the prototyping board.
-
MCU or MCU Board : ESP32 (Any other MCU/MCU Board can be used such Arduino, ESP etc)
-
Oxygen Sensor : OOM202 Oxygen Sensor (Envitech Series by HoneyWell)
-
16-ADC : ADS1115
-
Display : OLED 128 x 64
-
Temperature Sensor: DS18B20 Isolated Temperature Probe
-
Switches : Push Buttons
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
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.
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 upper 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%.
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 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
- Supply Range: 2.0V to 5.5V
- Low Current Consumption: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
- Sampling Rate: 8SPS to 860SPS
- Internal Low-Drift Voltage Reference
- Internal Oscillator
- Internal PGA
- I2C Interface: Pin-Selectable Addresses
- Four Single-Ended OR Two Differential Inputs
This board/chip uses I2C 7-bit addresses between 0x48-0x4B, selectable with jumpers.
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.
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.
The Breadboard prototype is exposed to known sample of oxygen and other gases. The readings are observed on Serial Monitor.
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 %.
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.
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
- Distributed under the CC BY-SA 4.0 license.