How to get specific concentration of carbonic acid in solution?
To get a specific amount of $\ce{H2CO3}$, you should monitor and adjust the $\mathrm{pH}$ of the water to the $\mathrm{pH}$ that would correspond to $5\:\mathrm{g}$ of $\ce{H2CO3}$. For this you would need to know the acid dissociation constant, $K_\mathrm{a}(\ce{H2CO3})=1.738 \times 10^{-4}$, and the following equations:
$$\ce{CO2(g) +H2O(l) -&gt;H2CO3(aq)}$$

$$\ce{H2CO3(aq) +H2O(l) -&gt; HCO3- (aq) +H3O+(aq)}$$

So now we can calculate, using:

$$K_\mathrm{a}=\frac{[\ce{HCO3-}]\cdot [\ce{H3O+}]}{[\ce{H2CO3}]\cdot [\ce{H2O}]}$$

$[\ce{H2O}]$ is omitted, as it remains mostly constant ($55.5084\ \mathrm{M}$). The only time it needs to be considered is when working with extremely concentrated solutions. From this we now get:

$$K_\mathrm{a}=\frac{[\ce{HCO3-}]\cdot [\ce{H3O+}]}{[\ce{H2CO3}]}$$

Disregarding any autoprotolysis, the $[\ce{H3O+}]=0$ before any $\ce{CO2}$ is added and any $\ce{H2CO3}$ is formed. Therefore, we know that all $\ce{H3O+}$ comes from the carbonic acid, and that $[\ce{H3O+}]=[\ce{HCO3-}]$. Therefore:

$$[\ce{H2CO3}]=\frac{[\ce{H3O+}]^2}{1.738 \times 10^{-4}}$$

Here, we can greatly simplify this equation, and introduce a parameter that we can actually measure--$\mathrm{pH}$. We know:

$$\mathrm{pH}=-\log[\ce{H3O+}] \Rightarrow [\ce{H3O+}]=10^{-\mathrm{pH}}$$

Substituting, we get:

$$[\ce{H2CO3}]=\frac{(10^{-\mathrm{pH}})^2}{1.738 \times 10^{-4}}$$

This, however, only gives you the amount of $\ce{H2CO3}$ that is not dissociated into $\ce{H+}$ and $\ce{HCO3-}$. If we want to calculate exactly how much $\ce{H2CO3}$ is in solution, even in the dissociated form, we must add to it the amount that is dissociated, which as you may recall is $[\ce{H3O+}]=10^{-\mathrm{pH}}$:

$$\text{Total}\ \ce{[H2CO3]}=\frac{(10^{-\mathrm{pH}})^2}{1.738 \times 10^{-4}}+10^{-\mathrm{pH}}$$

From this you can calculate the mass of the $\ce{H2CO3}$ in solution by multiplying this value by the volume of solution present.