Nitrox/Trimix & CO analyzer

Please register or login

Welcome to ScubaBoard, the world's largest scuba diving community. Registration is not required to read the forums, but we encourage you to join. Joining has its benefits and enables you to participate in the discussions.

Benefits of registering include

  • Ability to post and comment on topics and discussions.
  • A Free photo gallery to share your dive photos with the world.
  • You can make this box go away

Joining is quick and easy. Log in or Register now!

Anything else that might be going on here?

Couple more random thoughts, in the old datasheet it shows sensitivity with 100% helium as 244mV, whereas you get 530mV. Interestingly latest datasheet does not show helium at all.. Is voltage for the sensor running at 3V not 3V3 or 5V? not sure others see similar output levels? but higher voltage may cause heating of the sensor affecting reading (or damage it), is the gas flowing directly over sensor rather than via some flow control, could that potentially cause cooling of the sensor affecting reading, how about corrosion on the sensor structure restricting flow.. wired correctly? you do have the D side of the sensor marked "■" connected to ground, and the C side to positive supply..
 
Couple more random thoughts, in the old datasheet it shows sensitivity with 100% helium as 244mV, whereas you get 530mV. Interestingly latest datasheet does not show helium at all..
FYI I am using the MD61 (not MD62) sensor because inert gas were explicitly mentioned in the data sheet of MD61 (MD62 was more general). BTW I haven't seen the older datasheets you mention. Any chance you can share them?


Is voltage for the sensor running at 3V not 3V3 or 5V? not sure others see similar output levels? but higher voltage may cause heating of the sensor affecting reading (or damage it)
My sensor gets 3V. The whole device is powered by a 18650 battery using a TP4056 based circuit to get 5V (for arduino, adc, screen etc) and then another LM2596 based DC DC converter in series for the 3V required by the sensor.

is the gas flowing directly over sensor rather than via some flow control, could that potentially cause cooling of the sensor affecting reading, how about corrosion on the sensor structure restricting flow..
Gas flow is limited by a small hole in a plastic tube (at least for now). The whole sensor is placed inside the tube. The tube also has few bigger holes to prevent pressure build up. I have also tried to have a sponge inside the tube to make the flow even more uniform without difference in the measurements.

wired correctly? you do have the D side of the sensor marked "■" connected to ground, and the C side to positive supply..
Yeap, it is wired correctly.

Thanks once more for your effort.
 
Ahh.. couple more random thoughts:

. Looking at the MD61 datasheet, it look like it is not a linear result for helium from 0% ~100%, is that curve sufficient to account for error?

. Are you using the original formula for calculating results or did you create your own? in the original there is an offset that needs to be applied based on the %% of O2 because "active element meet the combustible gas, its resistance become smaller, and when meet reducing gas, its resistance become larger", helium is a reducing gas and O2 is a combustible gas and so affecting output opposite to the helium? and if Y that could be what is causing the error, if the offset is their maybe test to see if those offset values used match your sensor (add no helium, test different O2 levels and record offset)

. Also possibly an issue with the offset function itself, >48% O2 offset is -9, but no offset <48%, though not sure it's needed.. hmm maybe Miyaru can comment
 
. Looking at the MD61 datasheet, it look like it is not a linear result for helium from 0% ~100%, is that curve sufficient to account for error?

The MD61 data sheet I have has sensitivity curves only for H2 and CH4 which are indeed not linear. I will see if this non linearity (assuming He curve is similarly nonlinear) can explain the difference I get. I also wish I had used MD62 so that I could compare directly my results with everybody's else.

. Are you using the original formula for calculating results or did you create your own? in the original there is an offset that needs to be applied based on the %% of O2 because "active element meet the combustible gas, its resistance become smaller, and when meet reducing gas, its resistance become larger", helium is a reducing gas and O2 is a combustible gas and so affecting output opposite to the helium? and if Y that could be what is causing the error, if the offset is their maybe test to see if those offset values used match your sensor (add no helium, test different O2 levels and record offset)

. Also possibly an issue with the offset function itself, >48% O2 offset is -9, but no offset <48%, though not sure it's needed.. hmm maybe Miyaru can comment

The formula I am using is simply:
percentHe = 100 * currentmvHe / VmaxHe;

where percentHe is the % of He
currentmvHe is the measurement I get from ADC (actually the average of 20 samples) and
VmaxHe is the max value for 100% (530mV in my case)
I assume that for 0% He I have 0mV. In practice as I said in previous post this is ~3mV when sensor is cold and falls <0.5mV after 20 minutes or so - but since the value is changing over time correcting this is not as straight forward as subtracting a value from the actual measurement.

The correction factor Miyaru is using is for O2 > 48%. According to the guy I am helping (remember I am not trimix certified nor I plan to become any time soon) trimix blends with so high O2 have not much practical use (the MOD is such that narcosis doesn't justify the use of He) hence I have chosen not to implement this correction (at least for now). In any way we are talking about max -16mV (for 80% O2! - much less for lower O2) while I see differences of about -50mV at 21% O2.

Cheers
 
In the original code from Yves Cazé, the calibration values are defined with constants. In his case, the MD62 sensor outputs 661.26mV with 100% helium. Since the sensor needs to warm up, a correction factor is applied (lines 169 till 186) until the device has been running 480 seconds.
For oxygen, the cell voltage in air is taken as a reference for 20.9%, and a linear line is assumed from 0mV=0% oxygen to the air calibration voltage and extrapolated to a theoretical 100%.

Although I'm not a rebreather pilot, the technology is very interesting and one of the recurring themes in CCR diving is the O2 cell drift. The cell can be assumed linear, but 0mV is not 0% oxygen.
Many CCR pilots can explain this way better than I can, but the most important part is that real-life behaviour differs from theoretical behaviour.

Three relative easy scenarios can be created at home or in a dive shop, and provide calibration values for the oxygen and helium sensors: air, 100% oxygen, 100% helium. I use the sensor values from these three situations and stored them in the eeprom memory for gas calculations. Each analyser will measure different calibration values because they will be different: soldering quality, cables used, resistance of the entire circuit. Measuring and storing actual values (=calibration) is the solution to this practical issue.

What I did next, was connect oxygen and helium tubes from tanks with needle valves and watch the voltages from the cells. The MD62 cell is theoretically linear according to the datasheet, but in relation to what gasses?
Oxygen and nitrogen have thermal conductivity that influences the total thermal conductivity measured by the MD62 sensor. When increasing the oxygen flowing over the MD62, you'll see a rise in the voltage and I used these to prevent the processor from displaying any helium values:
Code:
//correct heVact in case of high O2 levels - empirical!
  if (oxygen>89) { heVact = heVact-17; }
  else if (oxygen>82) { heVact = heVact-16;}
  else if (oxygen>75) { heVact = heVact-15;}
  else if (oxygen>71) { heVact = heVact-14;}
  else if (oxygen>66) { heVact = heVact-13;}
  else if (oxygen>62) { heVact = heVact-12;}
  else if (oxygen>57) { heVact = heVact-11;}
  else if (oxygen>52) { heVact = heVact-10;}
  else if (oxygen>48) { heVact = heVact-9;}
So this is the only the case when measuring EAN48 or higher. I haven't tested e.g. TMX50/50 since I would never use that gas (and I don't know anyone who would). So @stepfen is correct that such gasses are of no use in diving. This correction is only to prevent the processor from indication a low helium percentage in high nitrox blends.

The temperature factor that Yves Cazé applies might work with a cold sensor. If you would restart the arduino, the same factor is applied again during the first 8 minutes and the way he programmed it, it's accumulative (I'm not sure if that was the intention). It's easier to place a temperature sensor next to the MD62 and check how warm it actually is. From what I've seen till now, the sensor is warmed up to a range of 29-33 degrees Celsius. And that's in an ambient temperature of 15-20 degrees Celsius. Once summer has daily temperatures over 30 degrees, I'll check again what the sensor does.

As for the MD61 versus MD62 sensor: I built a second analyser with the MD61 and what I see is that the voltage in 100% helium is higher (2 sensors placed in the same gas tube):
whatsapp-image-2021-05-20-at-21-51-57-jpeg.660498
MD62
whatsapp-image-2021-05-20-at-21-52-12-jpeg.660499
MD61

Further tests I have done (MD62): I blended TMX 10/70, 15/55 and 18/45. With a flow of 0.5 liters per minute, these gasses went over the sensors of my analyser and straight into a commercial analyser (I have tested with DiveSoft and Analox, unfortunately I didn't have these borrowed analysers at the same time).
The results were within 1% of the DiveSoft, and within 4% of the Analox. But...the chemical helium sensor was at least several years old, so I don't know how much that could have influenced. Because of the close-to-DiveSoft results with a warmed up sensor, I didn't apply any further corrections in the code.
At the moment, I don't have these gasses to test again with the MD61 sensor.

Most important aspect is that the tube with the sensors has no dead air spaces and is as small as possible, and that a flow is measured instead of static air. If static air with CO in it is measured, the CO sensor will saturate and display a higher value.
 
In the original code from Yves Cazé, the calibration values are defined with constants. In his case, the MD62 sensor outputs 661.26mV with 100% helium. Since the sensor needs to warm up, a correction factor is applied (lines 169 till 186) until the device has been running 480 seconds.
For oxygen, the cell voltage in air is taken as a reference for 20.9%, and a linear line is assumed from 0mV=0% oxygen to the air calibration voltage and extrapolated to a theoretical 100%.

Although I'm not a rebreather pilot, the technology is very interesting and one of the recurring themes in CCR diving is the O2 cell drift. The cell can be assumed linear, but 0mV is not 0% oxygen.
Many CCR pilots can explain this way better than I can, but the most important part is that real-life behaviour differs from theoretical behaviour.

Three relative easy scenarios can be created at home or in a dive shop, and provide calibration values for the oxygen and helium sensors: air, 100% oxygen, 100% helium. I use the sensor values from these three situations and stored them in the eeprom memory for gas calculations. Each analyser will measure different calibration values because they will be different: soldering quality, cables used, resistance of the entire circuit. Measuring and storing actual values (=calibration) is the solution to this practical issue.

What I did next, was connect oxygen and helium tubes from tanks with needle valves and watch the voltages from the cells. The MD62 cell is theoretically linear according to the datasheet, but in relation to what gasses?
Oxygen and nitrogen have thermal conductivity that influences the total thermal conductivity measured by the MD62 sensor. When increasing the oxygen flowing over the MD62, you'll see a rise in the voltage and I used these to prevent the processor from displaying any helium values:
Code:
//correct heVact in case of high O2 levels - empirical!
  if (oxygen>89) { heVact = heVact-17; }
  else if (oxygen>82) { heVact = heVact-16;}
  else if (oxygen>75) { heVact = heVact-15;}
  else if (oxygen>71) { heVact = heVact-14;}
  else if (oxygen>66) { heVact = heVact-13;}
  else if (oxygen>62) { heVact = heVact-12;}
  else if (oxygen>57) { heVact = heVact-11;}
  else if (oxygen>52) { heVact = heVact-10;}
  else if (oxygen>48) { heVact = heVact-9;}
So this is the only the case when measuring EAN48 or higher. I haven't tested e.g. TMX50/50 since I would never use that gas (and I don't know anyone who would). So @stepfen is correct that such gasses are of no use in diving. This correction is only to prevent the processor from indication a low helium percentage in high nitrox blends.

The temperature factor that Yves Cazé applies might work with a cold sensor. If you would restart the arduino, the same factor is applied again during the first 8 minutes and the way he programmed it, it's accumulative (I'm not sure if that was the intention). It's easier to place a temperature sensor next to the MD62 and check how warm it actually is. From what I've seen till now, the sensor is warmed up to a range of 29-33 degrees Celsius. And that's in an ambient temperature of 15-20 degrees Celsius. Once summer has daily temperatures over 30 degrees, I'll check again what the sensor does.

As for the MD61 versus MD62 sensor: I built a second analyser with the MD61 and what I see is that the voltage in 100% helium is higher (2 sensors placed in the same gas tube):
whatsapp-image-2021-05-20-at-21-51-57-jpeg.660498
MD62
whatsapp-image-2021-05-20-at-21-52-12-jpeg.660499
MD61

Further tests I have done (MD62): I blended TMX 10/70, 15/55 and 18/45. With a flow of 0.5 liters per minute, these gasses went over the sensors of my analyser and straight into a commercial analyser (I have tested with DiveSoft and Analox, unfortunately I didn't have these borrowed analysers at the same time).
The results were within 1% of the DiveSoft, and within 4% of the Analox. But...the chemical helium sensor was at least several years old, so I don't know how much that could have influenced. Because of the close-to-DiveSoft results with a warmed up sensor, I didn't apply any further corrections in the code.
At the moment, I don't have these gasses to test again with the MD61 sensor.

Most important aspect is that the tube with the sensors has no dead air spaces and is as small as possible, and that a flow is measured instead of static air. If static air with CO in it is measured, the CO sensor will saturate and display a higher value.

Wow! Results within 1% are indeed awesome.
I am still puzzled though about my results. Maybe MD61 is less linear - but why?
We can't know until somebody else try it out.
Thanks once more for all the effort
 
Quick question: In post 84 there is a discussion relating to which ESP32 to use. The only ones I can seem to find are ESP32 DevKit WROOM but not the 30 pin. Looks like there are 38 pins. Anyone used this version successfully? Here is an image of the part.
 

Attachments

  • ESP32.jpg
    ESP32.jpg
    76.9 KB · Views: 98
https://www.shearwater.com/products/perdix-ai/

Back
Top Bottom