# Corrected pH-KH-CO2

```As noted by Roger Miller, he was instrumental in clearing up my
confusion over the buffering article I posted Monday.  Here is a
corrected version, suitable for framing <g>.  Sorry about wasting the
previous bandwidth.

=======

This is detailed information about the carbonate buffering system in an
aquarium and how CO2 and KH and pH are related.

Buffering
---------

First of all, when strong acids like sulfuric or hydrochloric acid are
added to water, they completely ionize into hydrogen ions and the
corresponding salt (HCL -> H+ + Cl-).  However, when weak acids like
carbonic or phosphoric acid are added to water, they form "conjugate
acid-base pairs" (HA and A-) that are in equilibrium.  There is an
"equilibrium dissociation constant" (K) for a weak acid defined as:

[H+] [A-]   where [H+] = concentration of hydrogen ions
K = -----------        [A-] = concentration of the salt or conjugate base
[HA]            [HA] = concentration of the weak acid

This relationship is for the reaction:

HA <==> H+ + A-

The acid-base equilibrium is described by the Henderson-Hasselbach equation
(derived from the "equilibrium dissociation constant" relationship):

[A-]
pH = pK + log ----      or   pK = pH  when [A-] = [HA]  {since log(1)=0}
[HA]

The point where pH = pK is the point at which the system has the most
buffering capacity to handle additions of acids or bases and can occur at
multiple pH values for different buffering systems such as carbonate and
phosphate.

For example, with the carbonate buffering system, this occurs at pH
6.37 and pH 10.25 (with slight variances for temperature).  At pH
6.37, H2CO3 (carbonic acid) and HCO3- (bicarbonate) are present at
equal concentrations. At pH 10.25, HCO3- and CO3-- (carbonate) are
present at equal concentrations.

H2CO3  <==>  H+ + HCO3-  <==>  H+ + CO3--

Another common example is the phosphate buffering system (I believe
products like pH-UP and pH-DOWN are based on this system).  This has
equilibrium points at pH 2.13, 7.21 and 12.32.

H3PO4  <==>  H+ + H2PO4-  <==>  H+ + HPO4--  <==>  H+ + PO4---

At any pH point, the Henderson-Hasselbach equation describes the ratio of
[A-] (conjugate base) to [HA] (weak acid).  For example, consider the
carbonate system at pH = 7.0:

[A-]                          [HCO3-]
pH = pK + log ----     ->  7.0 = 6.37 + log -------  ->
[HA]                          [H2CO3]

[HCO3-]   4.27 - 1.0
0.63 = log (4.27)   ->  ------- = ----------   ->  77%
[H2CO3]       4.27

Therefore at pH 7.0, the carbonate system is 77% HC03- and 23% H2CO3.  If
you make a graph of pH versus the relative base/acid concentrations, you
will get a "S" curve due to the logarithmic nature of the equation.  An
important observation is that at the pK point the slope of the curve is
nearly vertical, i.e., a large change in relative concentration produces
only a small change in pH.

100% |             ___       ___
|            /         /
|           /         /
salt       |          |         |
concen.    |          |         |
50% |   H2CO3  +  HCO3-  +  CO3--
|          |         |
|          |         |
|         /         /
|    ___ /     ___ /
0% |___________________________
6.4      10.3
pH

(A graph of this appears on page 32 of the _Aquarium_Atlas_ (Baensch, 1987).

How this system relates to buffering can be seen from an example.  Consider
the process of protein ammonification (from "Water Chemistry in Closed
System Aquariums", A.J.Gianoscol, 1987).  One of the byproducts of this
process is phosphoric acid (H3PO4).  At a pH of around 7, phosphoric acid
will rapidly dissociate completely to H+ and dihydrogen orthophosphate
(H2PO4-) and dihydrogen orthophosphate will dissociate partially to H+ and
monohydrogen orthophosphate (HPO4--) (note that monohydrogen orthophosphate
won't dissociate to H+ and phosphate (PO4---) until the pH gets up around
the third equilibrium point at pH 12.32).  The free hydrogen ions (H+) can
then combine with bicarbonate (HCO3-) to form carbonic acid (H2CO3),
shifting the acid/salt balance slightly downward.  Since the reaction takes
place near the pK point, the slight shift in concentration does not
measurably affect pH.

To put it simply, the system is "buffered" since any free H+ ions can be
combined with bicarbonate without altering the pH much.  Naturally, as more
and more "buffering capacity" is used up, the pH will be able to shift more
and more.  Also, salts from the weak acids build up in the water.  Both
these consequences point to the need for occasional water changes.

Since the phosphate system has an equilibrium point at pH 7.2, you would
think it would be preferred to the carbonate system for freshwater
aquariums.  This is not true for three reasons.  First, aquariums naturally
produce organic acid compounds (metabolism by-products) so you are most
concerned about buffering acids.  If you keep your pH at around 7.0, you
are already below the pK point and will keep getting further away as acids
are buffered.  Using the carbonate system, pH 7.0 is above the pK so that
any acid buffering will move the pH even closer to the best buffering
point.  Second, plants can use the carbon compunds which are part of the
carbonate system.  Third, phosphates tend to grow algae, which is not
desired.

Calculating CO2 based on pH and KH
----------------------------------

Using the Henderson-Hasselbach equation and knowing 2 of the 3 values,
you can calculate the other value.  This is typically used to
determine CO2 concentration based on measured pH and carbonate
hardness (the concentration of bicarbonate ions, HCO3-). Since
carbonate hardness is usually measured in German degrees (dKH) by
commonly available aquarium test kits, we'll use that in the equation.

The H-H equation is:

[HCO3-]
pH = 6.37 + log -------
[H2CO3]

Since H2CO3 is synonymous with dissolved CO2,

[HCO3-]
pH = 6.37 + log -------
[CO2]

The molecular weight of bicarbonate is 61, so the molar concentration
of HCO3- ([HCO3-]) is

degrees KH * 17.8 mg/l
---------------------- = 0.292 dKH
61

The molecular weight of CO2 is 44, so the molar concentration of CO2
([CO2]) is (CO2 mg/l) divided by 44.

Performing substitutions and rearranging the equation gives:

CO2 = 12.839 * dKH * 10^(6.37 - pH)

Just to be complete:

CO2 mg/l * 0.07789
dKH = -------------------
10^(6.37 - pH)

pH =  6.37 + log ( (12.839 * dKH) / CO2 )

```