CO2 ppmv & ppmw math

Hi folks.
Anybody here knows CO2 atmospheric math?
I'm using this sensor to measure CO2.

It measures CO2 in ppm by volume aka atmosphere.
What I'm using it for is to measure CO2 concentration in water which is measured in ppm by weight.

This is what I have so far.

 double co2 = K_30.getCO2('p') * 3; //returns co2 value in ppm ('p') or percent ('%')
  
  //there's a glitch sometimes with the sensor output
  if(co2 >= 0 && co2 <= 30000) {
      co2 = co2 * 0.8317 * 44.01 / 10000;
      //  quicker than co2/1000000 * 0.8317 * 44.01 / 1000000
      //  0.8317 accounts for Henry's Law
      // max ppmw will be 36.6 with 10,000 ppmv
  }

The sensor floats on the waterline detecting any CO2 bouncing out of the water. Do I even need to account for Henry's law?
Is the math right?

I don't see how you can relate the concentration of CO2 in air to the concentration of CO2 in water. In particular, I don't see how you can differentiate between the "CO2 bouncing out of the water" and the CO2 already in the air.

Pete

Co2 is co2. I'm trying to convert ppmv to ppmw like how to convert Celsius to Fahrenheit . Just measurements.

Can you explain what your code does ?
And what is Henry's law?

Henry's law has some to do with finding the concentration of a gas in water based on the amount of the gas bouncing out of the water i.e. gas concentration above the water.
The math for it is super complicated.

But In my wiki search I thought I found the constant 0.8317 is good enough for CO2, assuming normal water density (not salt water etc) and temp of 70F.
Henry's law - Wikipedia

ppm is parts per million or
ppm(volume) = mg/L
ppm(weight) = molar weight/1000 kg/m^3

1000 kg/m^3 is the density of water and can be substituted with 1000000 mg/L to get the formula simplified.

for my thought to get the weight of it would be
co2_weight = co2_volume/1000000 * .8317 (henry's) * 44.01 (mole weight of CO2) / 1000000

The wiki page on Henry's Law says that the law does not apply when the gas reacts chemically with the solvent and gives the specific example of carbon dioxide and water which form carbonic acid. So you can't use Henry's Law.

Pete

el_supremo:
The wiki page on Henry's Law says that the law does not apply when the gas reacts chemically with the solvent and gives the specific example of carbon dioxide and water which form carbonic acid. So you can't use Henry's Law.

Pete

Thanks!

From Wikipedia

When carbon dioxide dissolves in water it exists in chemical equilibrium producing carbonic acid:[2]
CO2 + H2O is in equilibrium with H2CO3
The hydration equilibrium constant at 25°C is called Kh, which in the case of carbonic acid is [H2CO3]/[CO2] ? 1.7×10?3 in pure water[3] and ? 1.2×10?3 in seawater.[4] Hence, the majority of the carbon dioxide is not converted into carbonic acid, remaining as CO2

I believe that you can still use Henry Law.

The ability of the dissolved carbon dioxide to leave the water, depends on a lot of things, including the temperature, the pH, the amount of CO2 in the water, how much you shake the bottle, what other gases are present in the water and above it, and how quickly the carbon dioxide that leaves the water can disperse into the atmosphere.
I am unconvinced that measuring the atmospheric concentration above the water, can actually tell you very much that is meaningful about the concentration in the water, at all.

I believe that mistergreen wants to measure dissolved CO2 in a fish tank.

If you want to measure the CO2 concentration in a fish tank that's way easy. You don't measure it directly. You measure carbonate alkalinity and pH and the CO2 concentration can be had from there via a very simple set of equations.

Measuring pH in a continuous mode is not a simple task. Usually sensors degrade with time because the liquid junction between the electrode and the liquid to measure and you need to recalibrate the meter very often because of the sensor drift.

I believe that mistergreen wants to measure dissolved CO2 in a fish tank in continuous mode.

Assuming you had a stable setup where the amount of air circulation in the room, and other such factors were controlled, then you might be able to observe some variations in the atmospheric concentration of CO2 just above the water surface. But I don't think you will see much variation. Gases diffuse pretty fast.

But anyway, supposing you can detect variations, you would need to make a series of measurements of the water concentration using the carbonate method, and the atmospheric test, and observe whatever correlation there might be, or not. If you actual get a useable correlation, then use that for your process control. Good luck.