DIY Gas 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!

A small update got the O2 sensor in the mail from Germany to day, so it was time to hook it up to the board. It was pretty straight forward, and didn't need any Op-Amp, got sensible readings when I, in software, configurated the referance voltage to Internal 1.1V. still have to figure out hov to calculate the 02 percent from the voltage reading, and the documentation for this sensor is hard to find on the internet.

How did you code it to get good readings without the op-amp? I'm new to the Arduino world, and had a gander at it today but got poor results. Setting the internal reference to 1.1v, then converting the analog input signal to mV by multiplying the analog input by (1.1/1023)*1000 gives varied results. Watching it stream to serial, sometimes it's spot-on at 10.75 mv (for my Inspo oxygen cell), but it alternates between that and 9.6 mv for some reason. Not sure why, but would love to see how you got your good results...

Thanks!
Jim
 
How did you code it to get good readings without the op-amp? I'm new to the Arduino world, and had a gander at it today but got poor results. Setting the internal reference to 1.1v, then converting the analog input signal to mV by multiplying the analog input by (1.1/1023)*1000 gives varied results. Watching it stream to serial, sometimes it's spot-on at 10.75 mv (for my Inspo oxygen cell), but it alternates between that and 9.6 mv for some reason. Not sure why, but would love to see how you got your good results...

Thanks!
Jim

I don't do any magic, I hooked up the oxygen sensor ( a Teledyne R22) as shown in the diagram in post #24, which gives me a decent stable output.
In software I have two mode "Continuous" and "Analyze", the "Continuous" mode is real time readings where I have a circular rolling array where I store the sensors readings and displays the mean value of the circular array. In analyze mode I give the sensors time to stabilize before I take readings from the sensors for x numbers of seconds and outputs the median value.
 
I ended up doing a similar sort of project with an Arduino Uno and a Teledyne R17S sensor. Getting it working as an analyzer was easy enough (I used an ADS1115 ADC to boost the output from the oxygen sensor), and I have the output displayed on a 20x4 LCD.

That wasn't really my goal though - I wanted the Arduino to control the oxygen input to the compressor so I don't have to stand there fiddlefarting with the valve while making nitrox. I normally run 20 psi O2 from a welding regulator to a Dwyer flowmeter, and it was a trivial mater to remove the knob from the flowmeter and replace it with a gear. I then put a servo next to the flowmeter with another gear on it, and boom - servo controlled flowmeter.

IMG_6673.jpgIMG_6672.jpg

I named the contraption "Brandon's Blender", and it has three modes:

  • When it starts up, it calibrates itself to air (tank o2 valve isn't on), then enters Analyzer Mode. That simply displays the compressor input 02 percentage; and I use an average of 20 sensor readings (which happens in less than a second) to smooth the output.
  • If you press the green button, it enters Blending Mode. The default O2 value is 21%, and it's adjustable in 1% increments to 39%. Pick your O2 value, and it'll monitor the compressor input and adjust the flow of oxygen accordingly. If the O2 values are below 20% or more than 39.5%, it'll kick itself out of this mode and return the servo to the valve closed position. I've tested that function; it's reliable and happens quickly. Practically speaking, at 20psi the flowmeter can't deliver more than about 39% o2 to the compressor anyway, so it's more a safeguard against the compressor shutting down for some reason.
  • If you press the blue button, it enters Calibration Mode. This mode returns the O2 servo to the valve closed position, grabs an average of 20 sensor readings, then resets the calibration value. This runs in a loop until cancelled.
It works darn well. I just finished it and ran it for a couple hours last night - it will hold the O2 input stable within .2% accuracy, and I could probably increase the sensitivity and get that up to .1%.

There's a little bit of chasing that happens initially, but it stabilizes within about 30 seconds. There's also a bit of sensor drift that I suspect comes from having 45F input slowly cooling a 80F sensor (my garage is really warm), but I account for that by recalibrating every time I drain the moisture separators. The final output remains within .2% of target when I analyze, so I'm not all that concerned. It's at least as accurate as I can manage by hand.

Future upgrades include a pressure transmitter and a second o2 sensor for output o2, and I'm pretty sure I can also simplify my code to increase efficiency. It's pretty rough at the moment. I may also add wi-fi so I can have a display on my iPhone, but at that point I'm pretty certain I'm just screwing around for the hell of it.

But that's part of the fun of DIY...
 

Back
Top Bottom