pH Calculator - The Cunning Lemon

pH Calculator
This program has been designed to be small and simple, it calculates the concentration of [H]+ or
[OH]− ions in the pH adjustor you are using and the concentration in your current sample solution and
informs you how much of the adjustor would be required to adjust the sample to a particular pH. As
it is anticipated that a highly concentrated adjustor will be used effects due to dilution are ignored, as
are any buffering properties that the sample solution may posses, however these both of these factors
are working for you as it is always easier to add more adjustor than to neutralise it.
+
[H] = 10−pH
or
−
[OH] = 10−(14−pH)
(1)
Using equation 1 the number of [H]+ or [OH]− present in both the adjustor and sample can quickly
be determined, as well as the target ion concentration. From here simply subtracting the target ion
concentration from the current ion concentration, divided by the adjustor ion concentration will reveal
the ratio required. Multiplying this by the sample volume and subsequently by a thousand, to convert
from mL to µL, it is possible to work out the required volume of adjustor to change the sample pH to
the desired pH, as outlined in equation 2. Naturally, [H]+ can be substituted for [OH]− in equations 2
and 3.
+
Adjustor Volume =
+
[H]Target − [H]Current
+
[H]Adjustor
!
× Volume × 1000
(2)
As one might imagine, if neutralisation should be required before the adjustment shown in equation
2 this will increase the amount of adjustor required. This can be determined by equation 3 and the
program will, depending on the numbers input, work out whether only neutralisation is required or
whether neutralisation is required in addition to further alteration of the pH. For full details on how
this is implemented review the program comments in the source code.
−
+
Adjustor Volume =
[H]Target + [OH]Neutralisation
+
[H]Adjustor
!
× Volume × 1000
Last Updated – May 28, 2015
Tim Snow – http://www.cunninglemon.com
(3)
1
The figure on the left shows the program startup screen. Simply entering numbers, as shown on the
figure on the right, will provide the volume of adjustor, in µL, required to change the given volume of
sample solution, in mL, depending on parameters entered by the user. The numbers given here can also
be scaled by thousands, e.g. the volume, in mL, required to adjust the pH of a sample, in L.
Last Updated – May 28, 2015
Tim Snow – http://www.cunninglemon.com
2
Requirements and License
This software should work work with any Macintosh computer running Mac OS 10.10 or later and is
released under the BSD 3-Clause license, as follows:
c
Copyright 2015,
Tim Snow
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the copyright notice, this list of conditions and
the following disclaimer.
2. Redistributions in binary form must reproduce the copyright notice, this list of conditions
and the disclaimer found in the license file and/or other materials provided with the distribution.
3. Neither authors’ names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ”AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Last Updated – May 28, 2015
Tim Snow – http://www.cunninglemon.com
3
`