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!

I’m about to tackle your original nitrox analyzer model using the Arduino mini. If I can make it through that I’ll come back to attempt to comprehend that trimix model 😂
 
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.
It's basically the same model with a few extra pins, but the functionality is the same.
I’m about to tackle your original nitrox analyzer model using the Arduino mini. If I can make it through that I’ll come back to attempt to comprehend that trimix model 😂
With Arduino it's possible to do all the basic measurements. It just doesn't have enough juice to support a color display with fast refresh rates.
The esp32 can easily do that. The current firmware uses the first cpu core to display everything on screen and handles the menu structure. The second cpu core is continuously reading all gas sensors.
 
Although I had a drawer of various esp32 boards, this was the first time I actually used one. Obviously I was planning to do something with them but hadn't gotten around to it yet.

Thanks for the nudge, @Miyaru! Turns out, I like the esp32 platforms quite a bit.

I've actually been considering laying out a custom board that includes one of the ESP32 chips and a 32 bit ADC onboard. I've also been discussing it with Lilygo who says they'll produce such a board if it seems like something that others might buy. I like talking to those guys - they seem like hobbyists that have made it professionally.
 
I've actually been considering laying out a custom board that includes one of the ESP32 chips and a 32 bit ADC onboard.
Which A/D chip provides 32bits of accuracy?

I am using a custom board, but with a devkit module. Been experimenting with the bare esp32 chips, but they overheat after a couple of hours.
1640703642633.png

Prototype is now being tested by a couple of techdivecenters. Runs on a single 18650 battery.
 
Final design. Lots of people asked me for the schematics, this is it:
esp32-tmx-co-schematic.jpg

The picture above was automatically resized, so download the attached pdf for a more detailed schematic.

Lots of additional electronics compared to the initial design, details will follow. I read that schematics should be created from left to right, something I didn't do here. The added value is that seasoned engineers will have to do some puzzling.

There is no on/off switch, instead the ESP32 is put into deep sleep mode.
There are two circuits A and B, that will cut the power to other components.
Circuit A switches the 3.0V power to the helium sensor, circuit B switches the 3.3V power to the ADS1115 and INA219 chips.
Only the touch switches are always powered so they can be used to wake up the ESP32.

Circuit C is the charging circuit for the lithium-ion battery (which you can find top right). It's a standard charger circuit, based around the TP4056 chip with a protection circuit that keeps the battery from draining completely. Just above it you can see a mosfet and schottky diode - when a USB charger is plugged in, these two components will power the analyzer directly, while the TP4056 can charge the battery without a load.
I have tried several TP4056 chips (the bad copies) and one of those chips started to smoke while charging a battery that was drained a lot. Other copies get really hot. The original chips have this logo:
1641498102248.png

The original chips do a better job charging the battery, and don't overheat. Still I think it's a good idea not to charge the battery unattended (I should probably write this in a legal anti-litigation way, but I'm not a lawyer).
At the bottom of the circuit is a (tactile) switch. When a battery is plugged into the analyzer, the TP4056 is still asleep. Either plug in the USB power to wake up the unit, or momentarily press this pushbutton.
The unit runs for about 6 to 8 hours on a full battery. Standby time is several days, after removing all unnecessary LEDs.

Circuit D is the Wheatstone bridge with the MD62 sensor. This sensor needs to warm up before it will do it's job best, so to keep an eye on that a temperature sensor is touching the sensor. That's the DS18B20 on the left of the character D.

The battery voltage, which ranges between 2.8V and 4.2V, goes to two buck/boost converters:
3.3V -> DD0603SB_3v3
3.0V -> DD0603SB_3V
Both buck/boost modules look the same with just a tiny difference:
2016_0421_025258_001-jpg.691920
2016_0421_025317_002-jpg.691921

These modules do an excellent job in providing the correct voltage, regardless of the voltage that the lithium-ion battery has.

Some components can be modified:
1641499648756.png

The ESP32 Devkit module has a red and a blue LED. The red LED stays on all the time and does a good job in draining the battery. De-solder it. The blue LED is on when the analyzer is powered. No added value, so de-solder it.

1641500050146.png

The bottom of the TTP223 capacitive touch switch: de-solder the LED (lower right circle) and connect both solder points next to A.

The screen in the schematic has these connections:
1641500464652.png

If you use a different screen, change the pin connections accordingly. Any ILI9341 screen will work.

Description of the remaining components:
There are 2 ADS1115 analogue-to-digital converters. The first one is connected to the oxygen cell and the helium sensor. These voltages are in the range of 0mV to 500mV. The second converter is for the carbonmonoxide sensor (ZE07-CO or ZE15-CO) and that sensor outputs a voltage between 0.4V (=0ppm) and 2.0V (=500ppm).

The INA219 chip (bottom right) keeps an eye on the battery voltage and the power drawn from it. The battery icon on the screen uses the information from this chip to show how much power is in there.

And that's the hardware.

Software: firmware based. See post #76 for details.

FAQ

Q: I can buy a complete analyzer from you?
A: Yes you can. Price is 300 Euro for the analyzer, housing and flow restrictor. 18650 battery not included (not allowed in shipping). Oxygen cell not included - any oxygen cell will work, supplied connection is molex. Send me a direct message to order.

Q: Can you please send me the source code?
A: No

Q: Can you please send me the source code, pretty please with sugar on top?
A:
computersaysno2.gif


Q: How does it work?
A: See the attached pdf for detailed instructions

Q: Can I have my Divecenter logo on the display?
A: Yes. Contact me for details.
 

Attachments

Amazing job indeed !
 
Awesome job @Miyaru !

I'm an electronics designer, and I've been looking at your design since I don't really wanna pay >$1000 for an O2/He analyzer.

There's one thing I don't get though. The MD61/MD62 sensor that you are using is used for He detection, it's actually an inert gas sensor. Are you working under the assumption that the only inert gas present (in any relevant quantities) would be He? Hydrogen, Methane, etc are all assumed to be more or less non-existent ?
 
Awesome job @Miyaru !

I'm an electronics designer, and I've been looking at your design since I don't really wanna pay >$1000 for an O2/He analyzer.

There's one thing I don't get though. The MD61/MD62 sensor that you are using is used for He detection, it's actually an inert gas sensor. Are you working under the assumption that the only inert gas present (in any relevant quantities) would be He? Hydrogen, Methane, etc are all assumed to be more or less non-existent ?
You can call it an inert gas sensor, but it's actually a sensor for measuring carbon-dioxide, and it does so by measuring the thermal conductivity of the gas. Helium has a much higher thermal conductivity, and that is why this sensor reacts perfectly.
If you measure a hydrogen/helium mix, the result would be incorrect. That also goes for acoustic measurement (Divesoft), no idea what chemical helium sensor will show in that case.

So yes, this analyser is used under those assumptions. Next to that, a tmx analyser is used to confirm the results from EAN or TMX blends, not to analyze unknown gasses.
 
Back
Top Bottom