DIY Nitrox Analyzer (Arduino based)

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!

gitic0n/nitroxanalyser

There it is. Not only am I not really a C programmer, I'm also unfamiliar with Github. As I say in the readme, I picked a different gain to you for the mV range. I'm waiting for an O2 sensor to arrive, so meanwhile I'm testing it with a power supply capable of providing mV-level output. I'm working on ~30-40mV as 'air', so it might turn out that I need to tweak the gain. I'm impressed at the accuracy of these very cheap ADCs! It agrees pretty closely with my voltmeters (though the repeatability and linearity probably matter more for this purpose.

For calibration, I just average a bunch of readings, then do a running average in normal operation. It takes a second or so to settle to a new value, but as you no doubt discovered before me, it's a compromise between a jittery reading and speed of update.

I've fixed the MOD calculation at 1.4bar ppO2, but no doubt one could add a way of changing that.
 
gitic0n/nitroxanalyser

There it is. Not only am I not really a C programmer, I'm also unfamiliar with Github. As I say in the readme, I picked a different gain to you for the mV range. I'm waiting for an O2 sensor to arrive, so meanwhile I'm testing it with a power supply capable of providing mV-level output. I'm working on ~30-40mV as 'air', so it might turn out that I need to tweak the gain. I'm impressed at the accuracy of these very cheap ADCs! It agrees pretty closely with my voltmeters (though the repeatability and linearity probably matter more for this purpose.

For calibration, I just average a bunch of readings, then do a running average in normal operation. It takes a second or so to settle to a new value, but as you no doubt discovered before me, it's a compromise between a jittery reading and speed of update.

I've fixed the MOD calculation at 1.4bar ppO2, but no doubt one could add a way of changing that.
Air is around 13-14 mV. Jitter is taken care of by the running average and the rounding of the % O2 to 1 decimal place.
 
Final (I think) iteration of my DIY Nitrox analyzer. I added a flow restrictor which connects to a standard BCD QR connector for more consistent flow rate/readings.
DIY Nitrox Final.jpg
 
@Pao How did you determine the constant in your code?
const float multiplier = 0.0625F;

I'm using a different cell which reads 10.00mV in air and 49.00mV at 100%
 
Great thread. I built both the oxygen analyzer and a CO analyzer using the SPEC sensor. The oxygen one I added button feature to lock the screen to save the value for recording as well as a recalibrate and ability to change PO just because I could. Now I just need my own compressor!
 
  • Like
Reactions: Pao
@Pao How did you determine the constant in your code?
const float multiplier = 0.0625F;

I'm using a different cell which reads 10.00mV in air and 49.00mV at 100%

Hi. That is a constant preset for x2 gain and corresponding voltage range of the ADS1115 ADC . Here is a snippet in the example sketch for it:

// The ADC input range (or gain) can be changed via the following
// functions, but be careful never to exceed VDD +0.3V max, or to
// exceed the upper and lower limits if you adjust the input range!
// Setting these values incorrectly may destroy your ADC!
// ADS1015 ADS1115
// ------- -------
// ads.setGain(GAIN_TWOTHIRDS); // 2/3x gain +/- 6.144V 1 bit = 3mV 0.1875mV (default)
// ads.setGain(GAIN_ONE); // 1x gain +/- 4.096V 1 bit = 2mV 0.125mV
// ads.setGain(GAIN_TWO); // 2x gain +/- 2.048V 1 bit = 1mV 0.0625mV
// ads.setGain(GAIN_FOUR); // 4x gain +/- 1.024V 1 bit = 0.5mV 0.03125mV
// ads.setGain(GAIN_EIGHT); // 8x gain +/- 0.512V 1 bit = 0.25mV 0.015625mV
// ads.setGain(GAIN_SIXTEEN); // 16x gain +/- 0.256V 1 bit = 0.125mV 0.0078125mV

I chose the x2 range since 1 bit corresponds to the nice round # of 1mV.

Each time you power on or press the push button it determines the calibration value for air (20.9 %).
pertinent line is "calValue = 20.9000/currentmv;"
You can also calibrate it using 100% by changing "20.9000" to "100.0000".
Since the sensor is not entirely linear it is always best to calibrate it with a known gas near the % mixes you will be using it with. Air is always available and I will be using this most with 32% so I chose that value and it is also the de facto "industry standard".
You can play with the code if you are so inclined. :)
 
Great thread. I built both the oxygen analyzer and a CO analyzer using the SPEC sensor. The oxygen one I added button feature to lock the screen to save the value for recording as well as a recalibrate and ability to change PO just because I could. Now I just need my own compressor!

Nice! Can you share the plans and code? :)
 
Nice! Can you share the plans and code? :)
Yes, please do!

Electronics noob question; you mentioned either here or in your notes the two versions of holding current for the 5v step-up module; how do you determine which amperage a particular instance is if it's not on the product specs?
 
Great thread. I built both the oxygen analyzer and a CO analyzer using the SPEC sensor. The oxygen one I added button feature to lock the screen to save the value for recording as well as a recalibrate and ability to change PO just because I could. Now I just need my own compressor!
Do you keep your CO analyzer constantly powered or do you fire it up a couple hours before heading out to test a tank?
 
https://www.shearwater.com/products/perdix-ai/

Back
Top Bottom