• 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

An alternative approach to CO2?

I would do this, as a mechanical engineer who knows enough soldering to be dangerous:
solenoid.png

IRFZ34N is the most basic MOSFET I have on hand, but there are countless alternatives that would do. Important bits of the datasheet:
  • Drain-to-Source Breakdown Voltage: needs to be above 12V to switch in a 12V system. This one does 55V, I'm not sure if they make MOSFETs that can't switch 12v
  • Drain-to-Source On-Resistance: 40 mOhm, so for a 3W 12V solenoid (250 mA) the MOSFET will dissipate 2.5 mW. IRFZ34N is in the TO-220 package, so is overbuilt for this load by a factor of 1000 without needing any additional heatsink
  • Gate Threshold Voltage: >2V, so should be switched by 3.3V logic level. The max in the datasheet is 4V, so I admit I am playing a bit loose - there's a chance the specific MOSFET you get won't be switched by 3.3V, but it probably will (and definitely will be switched if the ucontroller has 5V logic level)

I think chatGPT is right about the flyback diode (the 1N4001 in the diagram), but the capacitors and gate resistor are not needed for a simple implementation like this. The gate resistor wouldn't hurt to add though if you wanted to though. This device also doesn't need a manual shutoff valve; the user can either turn off the regulator connected to the CO2 bottle or just unplug the whole thing if you need to stop the CO2 addition in an emergency.

You could switch an LED light in the same manner without the flyback diode, but if it needed more than a couple amps I'd recommend either adding a heatsink or a lower resistance MOSFET like IRLB8314. Come to think of it IRLB8314 also has a lower gate threshold, so should reliably trigger at 3.3V - it would be a better choice.


A DC motor controller lets you PWM the output to fine-tune the speed of a motor. It'll also work as a switch, but is overkill for a solenoid that just has to be on or off. It would be useful if you had a proportional solenoid valve, PWMing that would let you adjust how open the valve was.

Motor controllers will also you you reverse the polarity across the motor, so you can reverse its direction. I think a solenoid supplied with the reverse voltage will be unharmed but won't do anything - the coil will have the same resistance either way so the power draw will be the same, but it'll be working with the spring instead of against it. If it does try and turn the solenoid on backwards, just swap IN1 and IN2
Thank you for your detailed explanation! I’m too tiered from the business this week to dig into the details though. Will do this the upcoming days.


For a non-expert like me, it is often easier to opt for an off-the-shelf solution than to understand the details.
I’m tempted to buy the off-the-shelf solution as well, to eliminate errors in design from my side, buying the individual parts and soldering the whole thing. I’m aware now it is overkill, and some extra attention is needed in getting it wired up.
 
I'm doing the same thing. Blowing breath in it and testing how fast the CO2 is disappearing in the waterless test tank. I already printed a new lid which lowers the air gaps. The metric would be the time for CO2 to decrease from 1% to 0,5%. I started with the first prototype from 15 minutes, next adjustment 30 minutes and currently near 60 minutes. Still working on a gasket/seal which will make a notable difference I assume.
I’ve glued the sensor base to the lid, eliminating an air gap. For the metric quoted above, the CO2 loss time is increased from 60 to 100 minutes, so the gain is quite substantial. The measurements is in the graph below.

Now two spots for CO2 loss remain.
1. Between the printed sensor base and the sensors itself.
2. Between the glass and the lid, where implementing a gasket/seal is still on my to do list. (Neutral-cure) silicone gasket or PTFE tape might do the trick.

Until the next update

1767985735895.png
 
It seems that I cannot edit the previuos post anymore so will just put the short results here. There were four experiments with different water circulations:

Experiment 2.1. Fast stirring
output.gif

K_La value determined: 0.649 (hourly timeframe)

Experiment 2.2. Slower stirring

output2.gif


K_La value determined: 0.321

Experiment 2.3. No stirring

K_La value determined: 0.038

Experiment 2.4. Slowest stirring with smaller magnet

output3.gif
K_La value determined: 0.106

The K_leak of the container (tightly sealed) was 0.0205 and 0.0199.

So with this system, unless the water is still, the conductance into the water is significantly larger than the conductance of the lid. Maybe with a good surface agitation we could maintain the difference even in a real aquarium system. We will see.
 
The corresponding measured partial pressure changes and the fitted models in the four experiments:
Experiment 2.1. Fast stirring
1768130156961.png
Experiment 2.2. Slower stirring
1768130189578.png
Experiment 2.3. No stirring
1768130278097.png

Experiment 2.4. Slowest stirring with smaller magnet

1768130223208.png
In the last two experiments, I thought that was some error in the model fit, since the modeled water CO2 partial got above the gas CO2 partial pressure. However, it makes sense; once the CO2 flux into the water gets slower than the flux into the air, the container gas CO2 pressure (PgCO2) drops below the water PwCO2, and the transport reverses. From that point the CO2 is transported from water into container gas and then into room air. We can see the same pattern in all four plots, it just gets more apparent as the conductivity of water and air decreases.
 
There is also another important aspect of the results above. The determined K_La values apply equally to reversed CO2 transport, that is, from the water back into the air. Therefore, if we simply ask the question from which system more CO2 is lost into the air—an open aquarium with no lid (assuming no losses through CO2 bubbles), or an aquarium with a well-sealed lid and headspace CO2 delivery—we can directly compare the K_La values of air–water exchange to the K_leak value of the aquarium seal.

If K_leak is smaller than K_La, then CO2 loss through the seal will always be smaller than the CO2 loss from an open aquarium with a classical CO2 delivery method. In other words, the seal becomes the less dominant loss pathway compared to the open water surface.

I do not yet know what realistic K_leak and K_La values would be in a real aquarium setup. However, for K_La, my guess is that it lies somewhere between the values obtained in experiments 2 and 4 (after scaling with surface area), that is, roughly 3–10 times higher than what K_leak values I measured in my well-sealed container. This would correspond to a reasonably well-circulated aquarium without extreme surface agitation.

The logical next question, therefore, is what a realistic K_leak value could be for a real aquarium with a strengthened seal, and whether it can be kept below the effective K_La under typical operating conditions.

The other important question is how effective CO2 delivery into the water will be with the headspace CO2 system. One thing we can already simulate is how much time is required to raise the water CO2 level to a desired value using different K_La values in the container system.

This again follows a first-order process. When the headspace CO2 partial pressure is kept constant, the water CO2 partial pressure evolves as:

PwCO2(t) = PgCO2 - (PgCO2 - PwCO2_initial) * exp(-K_La/Vw * t),

where Vw is the water volume

Using the four different K_La values, assuming 1% CO2 in the headspace and an initial water CO2 partial pressure of 0.001 atm, we can estimate the time needed for CO2 buildup in the water.
1768133775652.png
Based on these simulations, the CO2 delivery rate may be too slow for a short (e.g. 8-hour/day) dosing period, but it could be sufficient for continuous 24-hour operation. Still, I guess that this delivery rate is not much different than the delivery rate in many aquariums where CO2 is dosed for 24-hour/day with diffusion (lower bubble counts and not too intensive surface agitation).

An the third important question is, how much CO2 is taken up by the plants and whether the CO2 diffusion through the water surface can keep up with that.
 
I had little time lately to update. I did a few measurements; however, I will need time to wrap it all up into digestible explanations.

In my earlier experiments with RO water, I modeled only the water-side CO2 partial pressure (p_w), assuming that dissolved CO2 behaved linearly with the gas phase.

If I want to switch to real aquarium water, I need to include carbonate chemistry, because CO2 is not present only as dissolved CO2 but is distributed between:

CO_2, HCO_3-, CO_3--

and this distribution depends on pH and alkalinity (KH).

Instead of modeling only (p_w), I reformulated the model in terms of total inorganic carbon:

C_T = [CO_2] + [HCO_3-] + [CO_3--]

and total alkalinity (A_T), which is calculated from KH.

If (A_T) is known, then for any value of (C_T) the carbonate equilibrium uniquely determines:

  • the pH
  • the dissolved CO₂ concentration
  • the equivalent water-side CO₂ partial pressure (p_w)

So in the new model:

  • the variable that I fit is C_T(t), not p_w(t)
  • at each time step, carbonate equilibrium is solved to obtain pH(t) and p_w(t)

In the original simplified model, the equations were:

dp_w/dt = k_La * (p_g - p_w) # rate of CO2 partial pressure change in the water
dp_g/dt = -Vw/Vg * k_La * (p_g - p_w) - k_leak * (p_g - p_room_avg) # rate of CO2 partial pressure change in the headspace

In the updated model, the first equation is replaced by a carbon mass balance:

dC_T/dt = k_La * K_0 (p_g - p_w) # where K_0 is the Henry's constant

and p_w is no longer an independent variable but is calculated from C_T and A_T using carbonate chemistry.

This allows the model to:

  • account for buffering by bicarbonate
  • predict both pH(t) and p_w(t)
  • remain valid for real aquarium water with nonzero KH

while the headspace equation remains unchanged:

dp_g/dt = -Vw/Vg * k_La * (p_g - p_w) - k_leak * (p_g - p_room_avg)

I measured these CO2 concentrations in the container and the room air using water from my aquarium:

1769291174177.png

So with all the changes above in the calculation I got these fitted values:

1769291191873.png

Interestingly, if I use the simpler model without the carbonate chemistry, the model fits almost as well:

1769291209439.png

This suggests that carbonate buffering had only a minor effect under these experimental conditions (CO2 range and KH used). This is expected because when CO2 changes are large, most of the change appears as dissolved CO₂ itself, while the accompanying pH shift partially compensates the relative redistribution into bicarbonate. (higher CO2 --> lower pH --> the distribution shifts for less relative HCO3- from CO2, when CO2 is expected to partially convert to HCO3-)

The two calculated K_La were 0.45 and 0.44
 
The next step was to perform measurements in my 900-liter aquarium. First, I will briefly introduce the aquarium, and then I will show the measurements.

This aquarium has a closed lid, although it is not airtight. Originally, I planned to restrict air diffusion as much as possible, leaving only small holes for the wires to pass through. The lids are made of polycarbonate sheets and rest on rubber self-adhesive strips. However, during summer, the temperature rose to 29 °C despite the room temperature being only 23–24 °C, mainly because of the lamps and the two 60 W pumps inside the tank.

Therefore, I had to mount two fans on opposite sides (one blowing air in, the other blowing air out) to cool the water by about 1–2 °C below room temperature. They run only after the lights are off, but they inevitably introduce a leak in the aquarium's seal.

So the aquarium has a total volume of 900 liters and is fairly well planted:

IMG_20251231_075701531.jpg
I use tap water (KH about 12 dKH, GH about 18 dGH), and CO₂ delivery is done by injecting soda water from a soda keg through a connected tube with a valve. Opening the valve for 45 seconds (about 5-6 liters of soda water) leads to a drop in pH to about 6.8–6.9, which corresponds to roughly 40–45 ppm CO₂:
CO2_dosing.gif

1769513793363.png
As you can see, the CO₂ level rises rapidly in the morning and then decreases to about 5–7 ppm by the next morning. The yellow stripes show the lighting periods, and the grey stripes indicate when the fans are on. We can see that the CO₂ decline is steeper during the light periods and when the fans are running.

You can see the lights and the fans mounted on the lid here:

IMG_20251231_075051834_HDR_AE.jpg

There is a hole cut into the lid to accommodate the CO₂ detector. The lid of the container can be placed inside an open-bottom container that ends either in the headspace (for headspace CO₂ measurements, placed in the hole) or in the water (a longer container box reaching below the water surface, on the top of the lid in the picture):

IMG_20251231_075351233_HDR_AE.jpg
I also cut a hole to place the pH electrode into the water, approximately in the middle of the tank.

With this system, I can simultaneously measure the pH in the water and the CO₂ concentration in both the headspace and the room air. I will show some results in the next post.
 
However, during summer, the temperature rose to 29 °C despite the room temperature being only 23–24 °C, mainly because of the lamps and the two 60 W pumps inside the tank.
A peltier based water chiller can work really well for this. Lots of commercial options and good homebrew possibilities as well.
 
I have not heard about the Peltier coolers before, but I'll check them.
Well... it worked great in the lab, but looking into it a bit I think it won't scale suitably for your 900L setup. If you don't mind homebrew, you could pump the water through a car heater core with fan to act as a passive ambient heat exchanger. If that's not enough cooling, you can blow cool air over the core from a portable air conditioner - these can be pretty affordable used. The upside is you can keep your tank relatively sealed and you don't have to replace a lot of water from evaporation.
 
Well... it worked great in the lab, but looking into it a bit I think it won't scale suitably for your 900L setup. If you don't mind homebrew, you could pump the water through a car heater core with fan to act as a passive ambient heat exchanger. If that's not enough cooling, you can blow cool air over the core from a portable air conditioner - these can be pretty affordable used. The upside is you can keep your tank relatively sealed and you don't have to replace a lot of water from evaporation.
Regarding the sealing seemed to me that it didn't matter that much; I am still getting very similar CO2 profiles to those in my previous aquariums without cooling, although it is hard to compare. I run the fans only during the night. And I have no before-and-after measurements with this aquarium yet, but I plan to do the before part soon... So we will see. One clear benefit of this evaporation is that without it, with the daily 5-6 liters of soda, the headspace is filling up quickly. With all-night (during summer) evaporation, I lose roughly the same amount that is injected in the morning. During the winter, I do not run the fans all night because the air gets too oversaturated with water in the house and it condensates. But the room temperature is now cooler too, so there's no need for that much cooling.
With evaporation and the weekly water changes, the KH goes up about 10% above the tap water KH, but I don't think that matters that much.
 
@hax47 Excellent testing and results, although the entire modelling is beyond my expertise at the moment. Did you continue on this project? Where are you at?

From my end spare time for this project is available again, so my planned steps are:
1- further decrease leaking by using PTFE tape
2- recalibrating the CO2 and oxygen sensors and making sure they work properly.
3- put some water in the test bin and add some baking soda. Not sure which dKH to aim for...
4- reinstalling the water thermometer so I can convert CO2 air reading to calculated CO2 in the water with improved accuracy.
5- I will check whether my pH probe is still alive in order to incorporate my pH monitor as well, so I can double check CO2 readings and see how fast CO2 is diffusing into the water.
6- I've ordered a solenoid air valve so the ESP32 can control CO2 on it's own. But up until then, breathing into it will suffice.

Cheers!
 
Last edited:
Back
Top