• You are viewing the forum as a Guest, please login (you can use your Facebook, Twitter, Google or Microsoft account to login) or register using this link: Log in or Sign Up

Gas-exchange experiments

Have you ran the air pump with the duck weed removed to see the effect of that without the surface gas exchange restriction?

I ended up disassembling both the sensor and the aquarium, so unfortunately there is no update on the aeration effect. However, I do not expect to get very different data from my previous experiment.

I have rebuilt the sensor, and it has now a few modifications:

  • I pump water inside the box with the sensors to have faster equilibration with the box air:
  • it has an additional O2 sensor now (DFRobot O2 sensor)
  • it measures the box parameters only, I am running a separate sensor for the ambient air.
  • the MH-Z19 sensor is replaced with SCD41, which has a detection range of up to 40000 ppm instead of 5000 and also measures humidity and temperature (inside the sensor)

First I wanted to also include an ammonia sensor, but if my calculations are right, the 1 ppm air ammonia threshold that these sensors have makes no sense in an aquarium. I would need a few ppm of ammonia in water to be able to detect it.

The water is now pumped from the aquarium through a pipe into a tightly sealed plastic box. The water is then dispersed on a plastic pot scrubber to facilitate the gas exchange, then it flows back to the aquarium:

sensor.jpg
1727113798296.png1727113823378.png1727113840239.png1727113857272.png
Now with the increased range, I can follow the CO2 changes in my soda-water-supplied aquariums as well. This is what a few days of data look like in this aquarium:
1727114163111.png
The shown values are calculated from the measured gas concentrations, using the following solubility data (at 25°C):

CO2_solubility = 1449 mg/l/atm
O2_solubility = 40 mg/l/atm

The dashed lines separate days, and the yellow stripes show the photoperiods (two 4-hour periods a day). During the photoperiod, the oxygen levels rise, while they decrease with turned-off lights. The equilibrium with air is about 8.4 ppm, so O2 goes above equilibrium during photosynthesis. CO2 is dosed every morning with soda water, and we can see the changes in the rate of CO2 consumption when the lights are turned up or down.
The aquarium has a lid with a tight fit which slows down the dissipation of the increased CO2 and O2.
 
I ended up disassembling both the sensor and the aquarium, so unfortunately there is no update on the aeration effect. However, I do not expect to get very different data from my previous experiment.

I have rebuilt the sensor, and it has now a few modifications:

  • I pump water inside the box with the sensors to have faster equilibration with the box air:
  • it has an additional O2 sensor now (DFRobot O2 sensor)
  • it measures the box parameters only, I am running a separate sensor for the ambient air.
  • the MH-Z19 sensor is replaced with SCD41, which has a detection range of up to 40000 ppm instead of 5000 and also measures humidity and temperature (inside the sensor)

First I wanted to also include an ammonia sensor, but if my calculations are right, the 1 ppm air ammonia threshold that these sensors have makes no sense in an aquarium. I would need a few ppm of ammonia in water to be able to detect it.

The water is now pumped from the aquarium through a pipe into a tightly sealed plastic box. The water is then dispersed on a plastic pot scrubber to facilitate the gas exchange, then it flows back to the aquarium:

View attachment 222589
View attachment 222590View attachment 222591View attachment 222592View attachment 222593
Now with the increased range, I can follow the CO2 changes in my soda-water-supplied aquariums as well. This is what a few days of data look like in this aquarium:
View attachment 222594
The shown values are calculated from the measured gas concentrations, using the following solubility data (at 25°C):

CO2_solubility = 1449 mg/l/atm
O2_solubility = 40 mg/l/atm

The dashed lines separate days, and the yellow stripes show the photoperiods (two 4-hour periods a day). During the photoperiod, the oxygen levels rise, while they decrease with turned-off lights. The equilibrium with air is about 8.4 ppm, so O2 goes above equilibrium during photosynthesis. CO2 is dosed every morning with soda water, and we can see the changes in the rate of CO2 consumption when the lights are turned up or down.
The aquarium has a lid with a tight fit which slows down the dissipation of the increased CO2 and O2.

This is awesome - there is a commercial product waiting to happen here!
 
Hi all,
First I wanted to also include an ammonia sensor, but if my calculations are right, the 1 ppm air ammonia threshold that these sensors have makes no sense in an aquarium. I would need a few ppm of ammonia in water to be able to detect it.
I think you are right, by the time you can <"detect ammonia">? It is already too late.
The water is now pumped from the aquarium through a pipe into a tightly sealed plastic box. The water is then dispersed on a plastic pot scrubber to facilitate the gas exchange, then it flows back to the aquarium:

sensor.jpg

1727113798296.png
1727113823378.png
1727113840239.png
1727113857272.png

Now with the increased range, I can follow the CO2 changes in my soda-water-supplied aquariums as well. This is what a few days of data look like in this aquarium:
1727114163111.png

The shown values are calculated from the measured gas concentrations, using the following solubility data (at 25°C):

CO2_solubility = 1449 mg/l/atm
O2_solubility = 40 mg/l/atm
That is just fantastic.
This is awesome - there is a commercial product waiting to happen here
I genuinely think it could be, the aquarium market wouldn't be huge, but there are applications in aquaculture and waste water management.

Aquaponics might be an option? Which the big boys don't have sewed up? Dissolved oxygen is less of an issue, but it is difficult to measure CO2 in water electrochemically and this would get around that problem (in a similar way to what a drop checker does).
I am going to become a share holder!
We could definitely have a <"range of merchandise"> for the <"more discerning"> planted tank keeper. In fact I may already have an opportunity for you - <"New Eheim Canister">.

cheers Darrel
 
Hi all,
Free duckweed with every pump in a bucket? 🙂
Possibly, if it really was Lemna minor? It might <"put off punters"> and you wouldn't get any repeat sales? But on the other hand "pump in a bucket" will be indestructible (and last for ever), so we wouldn't get any repeat sales any way.

It is a difficult one.

Free <"Secret Ingredient Soup"> with every purchase might be better?, But we'd need to find a different name. Continuing with the <"march towards transparency"> "plant and microbes" might be an option?

cheers Darrel
 
Last edited:
Possibly, if it really was Lemna minor? It might <"put off punters"> and you wouldn't get any repeat sales? But on the other hand "pump in a bucket" will be indestructible (and last for ever), so we wouldn't get any repeat sales any way.

It is a difficult one.

Free <"Secret Ingredient Soup"> with every purchase might be better?, But we'd need to find a different name. Continuing with the <"march towards transparency"> "plant and microbes" might be an option?
Ill think on it, but I will leave you with this.....

Delboy.PNG
 
Hi all,
Well, it crossed my mind for a second, but I don't think I will start a business with this sensor. I'll put together a GitHub page with instructions for those who want to build it.
Good on you, open source is the true spirit of UKAPS <"GitHub: Let’s build from here">.

Cheers Darrel
 
Last edited:
Awesome thread, hax47! Your work and posting are much appreciated!

I’d really like to copy/build your sensor. I’ve done my own controlled test for a couple of months to check the effects of heavy aeration on the pH/CO2 in equal non CO2 tanks. No strange outcome: the aerated tank is always higher in pH (lower in CO2) than the non aerated one. Plant growth seemed a bit better in the non aerated one.
But what I found more interesting: the aerated tank looked much healthier in terms of algae and surface film. I did not expect this, as I assumed better plant growth means a healthier tank. My hypothesis is the new fresh tanks needed a lot of O2 for ‘maturing’, and the aerated tank provided much better oxygen levels (and surface film breakage) and thus a healthier microfauna and less ‘startup issues’.

When rerunning the experiment, I definitely want to use your sensor and continues 24/7 recording of CO2 and O2 levels. What are the costs of the sensors?

I guess you connect the sensors to a single board like a Arduino? It would be fun to connect a pH sensor as well, and calculate the alkalinity (taking in account for CO2 changes reading a bit slower than the pH).
 
Oh hax47, do you take in account the temperature when calculating the exact absolute ppm of CO2 in the tank based on the CO2 sensor reading? You might be aware that cooler water takes up/contains more CO2 for the same partial pressure (same for oxygen btw) I have derived a negative exponential formula for the Henry’s Law Coefficient of CO2 if you like to have it, I could share the entire Excel sheet if you want.hax47.png
 
Last edited:
I’d really like to copy/build your sensor. I’ve done my own controlled test for a couple of months to check the effects of heavy aeration on the pH/CO2 in equal non CO2 tanks. No strange outcome: the aerated tank is always higher in pH (lower in CO2) than the non aerated one. Plant growth seemed a bit better in the non aerated one.
But what I found more interesting: the aerated tank looked much healthier in terms of algae and surface film. I did not expect this, as I assumed better plant growth means a healthier tank. My hypothesis is the new fresh tanks needed a lot of O2 for ‘maturing’, and the aerated tank provided much better oxygen levels (and surface film breakage) and thus a healthier microfauna and less ‘startup issues’.
I am writing the detailed readme file for the GitHub repo, I'll upload it in the coming days with code and detailed instructions. Feel free to use it, I would like to see someone else's data too, I hope you will share them.

These are the sensors I used:
CO2: SCD40 SCD41 gas sensor module detects CO2 carbon dioxide temperature and humidity in one sensor I2C communication - AliExpress 502
O2: Gravity: Electrochemical Oxygen / O2 Sensor (0-25%Vol, I2C)

So the CO2 sensor is 13-22 EUR depending on your chosen option, and the O2 is $53.90. You also need a development board (Arduino, esp32, NodeMCU, or similar), a 5V adapter, a small pump, and a chamber.

Regarding the aeration, the oxygen levels remained good, or even oversaturated in the tanks I tested so far. However, I have good surface agitation and I limit the gas exchange with aquarium lids. Regarding the algae and the surface film, I am not sure, I would expect that it is more complicated than simply the O2 levels. But good oxygen levels are required for a healthy aquarium for sure.
In non-CO2 tanks, I don't think someone can go too high with CO2 without sacrificing oxygen levels unless using some tricks like an aquarium lid. But this is just my theory, I have not run experiments, you can read about it here.

Oh hax47, do you take in account the temperature when calculating the exact absolute ppm of CO2 in the tank based on the CO2 sensor reading?
Yes, I calculated with 25°C, these are the constants I used:
CO2_solubility = 1449 mg/l/atm (from your table, 0.033363 corresponds to 1467 mg/l/atm)
O2_solubility = 40 mg/l/atm (from your table, 0.001263 corresponds to 40.416 mg/l/atm)

These will change a little bit depending on the temperature. However, I think the dynamics of the changes are much more interesting than the absolute levels. The errors in calibrations might be bigger than the differences in solubility within a few degrees of Celsius.

What is a little bit trickier, is the air temperature and humidity, and how that changes the measured air gas levels. My understanding is that, at least in the case of the SCD40/41 sensor, the sensor corrects itself for these effects (it has built-in humidity and temperature sensors). In the case of the O2 sensor, I don't know. At least for the humidity, the difference in the oxygen levels at ~50-60% room humidity, and at the theoretical 100% humidity in the chamber is negligible.
The measured humidity in the chamber does not reach 100%, it stays around 90%, but the temperature in the chamber is also a little bit higher than in the water, which explains this difference.


It would be fun to connect a pH sensor as well, and calculate the alkalinity (taking in account for CO2 changes reading a bit slower than the pH).
I have been thinking about measuring pH continuously, but it has a few more technical issues than the air-CO2 measurements. But I would like to see some comparisons between the two data.
 
Here is the GitHub page with instructions. Note that building the monitor requires some skills like soldering, programming of development boards, and data handling.
The monitor now connects to mqtt broker and sends mqtt messages that need to be caught and stored somehow. I use Home Assistant for that, for others, HA might not be an option. I plan to add a digital display to the monitor.
Any ideas are welcome for different data storage options.
 
nice work, all my questions I wanted to ask, are covered in your Github page instructions. I don't have any experience with development boards, this is an exceptional good opportunity to get some 😉
I'm moderately skilled in physics and computer science/programming, so your instructions don't scare me off initially. I was thinking about first get this thing working on a Arduino, but the NodeMCU platform is very affordable and the comfort of cloning your stuff seems worth trying out.

A digital display always comes in handy, as I would foresee:
  • reporting the latest values, not having set up the whole MQTT part just yet
  • troubleshooting/reporting issue like failing WIFI/MQTT connections.

I would suggest having a possibility to bypass the MQTT part. This would simplify requirements for others.
I'm not sure storage is big enough on a NodeMCU, but storing (consolidated per hour?) data and a possibility to fetch this data, could be handy. This would be my first go-to, but maybe not for others as well.
Maybe running a webserver on the NodeMCU, so a smartphone or computer could access it? Server-Sent Events (SSE) seems nice for updating data to the browser. Or maybe load a nice graph you showed your results in. I'm not into web development though.

Anyways, first step for me is getting the initial hardware.

Do you have any objection if I sent you a PM when I have some detailed questions?
 
I would suggest having a possibility to bypass the MQTT part. This would simplify requirements for others.
I'm not sure storage is big enough on a NodeMCU, but storing (consolidated per hour?) data and a possibility to fetch this data, could be handy. This would be my first go-to, but maybe not for others as well.
Maybe running a webserver on the NodeMCU, so a smartphone or computer could access it? Server-Sent Events (SSE) seems nice for updating data to the browser. Or maybe load a nice graph you showed your results in. I'm not into web development though.
I also think that mqtt would be the biggest obstacle for most. Maybe a local webserver on the NodeMCU could work, I have no experience with that. But it shouldn't be difficult to do. An SD card could be used to store the data.
The display can be also added. I have some D091-12832-I2C/BL displays already lying around, this shouldn't be a problem. Since it has a 128x32 pixel resolution, maybe even a graph would fit on it 🙂

Do you have any objection if I sent you a PM when I have some detailed questions?

Of course not, feel free to shoot me a PM if you have any questions.
 
@hax47 you should put a drop checker in there too and take some colourimetric readings!


I compared the CO2 readings with a drop checker (sort of). I made the usual 4 dKH water + indicator solution, and also two control solutions. One with high pH and the other one with low pH for minmax reference. The sensor is attached to an aquarium currently in a dark start period.
The "drop checker" was connected to the chamber through a plastic tube:
0.jpg

I injected CO2 with soda water and followed the CO2 levels. Here are the readings, for two days in two rows (the upper line is the first day). In the third row, is an actual dropchecker in the aquarium on the second day (timepoints are the same for the second and the third row):
drop_checker.jpg


I am not one with good color vision, but it seems that it takes some time for the solution to equilibrate. On the second day, the CO2 started from a higher value, that's the faster equilibration. I am not sure to which theoretical value the colors correspond.

Here are the sensor data for reference. Ignore the dent at the end of the first day, the cable got unplugged for some time:
1728245420593.png
 
Last edited:
I have noticed an interesting thing in my readings. There is a sudden drop in O2 values when CO2 is added:

1728565706236.png
The purple is the oxygen. This tank was in a dark start, so no significant oxygen production or consumption was present. I realized that when the fraction of the CO2 increases to significant levels (~3%), the fraction of the O2 must decrease, resulting in lower O2 readings. So what happens is that the sum of all the partial pressures of gases in the water will be higher than the atmospheric pressure at which value I measure them. So I came up with the following correction formula:

corrected_O2 = measured_O2 * (1 + CO2_fraction)

The 1+ CO2_fraction would be the sum of partial pressures in the water, and I correct the measured values on atmospheric pressure to that total pressure. It is much better now, although still not perfect, I think this is acceptable now:

1728565569405.png
It might get more complicated though if both gases change in parallel, one would affect the other and vice-versa.
 
Hi, nice discovery and good to be aware of. How did you add the CO2? With a soda bottle I guess looking at the sudden spike? What ratio (Volume addition and tank) did you add? The amount of oxygen (or absence?) in the soda bottle might affect your oxygen reading as well…? The sensor actually reads o2 percentage right?

Your finding in my own words: a lot of co2 is added to the water. This will equilibriate with the trapped and measured air. Because co2 will increase in the air and it’s co2 reading. The percentage o2 is affected and will read lower, even the amount of oxygen in the trapped air and water is the same.

Maybe there is an effect oxygen gets ‘pushed back’ in the water as well, but maybe the effect on total trapped and dissolved oxygen is negligible.

Very nice you came up with a correction formula to to calculate the actual amount of dissolved oxygen, as in the end adding pure co2 might not affect the total dissolved oxygen a very little I can imagine…

I don’t have a physics degree though…
 
Back
Top