OWL2c/e interface guide

(c) 1998 , 2003 EME Systems, Berkeley CA U.S.A.
 <stamp index> <home>

Contents (updated 1/12/2003)

Ph sensors, interface and calibration

top

The pH electrode is essentially a simple single cell battery. The voltage is directly proportional to the hydrogen ion concentration surrounding the electrode. The pH is the logarithm of the hydrogen ion concentration.

The ideal pH electrode:

But the electrode is practically never ideal:

The above values depend somewhat on the construction of the individual electrode, and its aging. That is why it is necessary to calibrate and standardize the pH monitoring and recording instrument from time to time, depending on the conditions it is subjected to. "Standardize" means to adjust the offset so that the instrument reads zero in neutral (pH 7) solution. "Calibrate" means to trim the slope of the pH/mV response to the the correct value for the electrode at that point in time. The instrument should probably have automatic temperature compensation, to adjust the slope in response to different calibration and working temperatures.

The kicker from the electronic standpoint is that the output impedance of the pH electrode is extremely high. The electrode acts like voltage source, however, there is a 10 to 50 mega ohm resistor in series with the voltage. Any voltmeter that measures the output of a pH electrode has to have extremely high input impedance, 1 tera ohm or more. Even many digital multimeters, which have 10 or 20 mega ohms of input resistance, will load down a pH electrode and give a reading that is much lower than it should be.

It is the glass membrane of the probe that is responsible for the high resistance. It a special glass with tiny "pores" that cannot support much electrical current.

The usual approach to pH electrodes is to amplify and buffer the signal, with an MOS or CMOS input operational amplifier. When properly constructed with attention to the input circuit layout, it can easily achieve the necessary high input resistance.

Here is the circuit of a pHx amplifier:

pHx amplifier circuit

This amplifier produces 1 volt output in neutral, pH=7, buffer. Adjust RT1 to set this offset. This adjustment could also be used to set the output to 1.0 volts when the pH probe at the input is placed in neutral pH buffer.

The resistor R6 sets the gain. With 221k½ installed at R6, the overall gain will be x2, and the full scale output will be nominally 0.16 to 1.84 volts to cover the 0 to 14 pH range.

This circuit does not have a gain control. The idea is that the main calibration will be done in software. Similarly, although the trimmer RT1 can trim the offset (1 volts output in neutral pH), the idea is to do the recurring calibration in software.

Here is the first cut on how to program it on the Basic Stamp: This assumes that the output of the pH electrode is exactly 0 volts at pH7, and that it has a Nernst slope of exactly 59.16 mV per pH unit:

pHloop:
  gosub ADread ' return millivolts, mV, not shown
  pH = mV ** 55405      ' stamp's way to multiply times 700/828 (see below)
  pH = pH - 845         ' 845 is the 1 volt offset, times 700/828
  pH = 700 - pH         ' adjusts to pH 7.00 at 1 volt input, decreasing in acid
  debug rep "-"\pH.bit14,dec abs (pH/100),".".dec2 abs pH  ' display with decimal point xx.xx
goto  pHloop

This routine reads the voltage, then converts to pH units, and then prints out the pH result as XX.XX format. The display allows for a negative pH value, but that should never occur except in a super-acid, or unless something is wrong with the instrument.

The factor **55405 is the stamp's way of approximating the fraction (7.00 pH units per 0.828 volt change 700/828), to convert from millivolts to pH. (math: 700/828*65536=55405) The offset -845+700 is applied after the multiplication, because the ** operation does not work correctly on negative numbers. (The offset 845 comes from 1000 millivolts offset * 700/828 pH units per volt).

In the real world, the electrode will not have the ideal slope factor nor the ideal offset. What is more, the slope (Nernst potential) and offset will drift slowly with time as the electrode ages. Also, the pH measurement is temperature dependent. This is predictable, -0.002mV per degree C change in the slope factor.

I practice the pH electrode will have means for interactive calibration. The user first puts the sensor in neutral pH buffer and presses a button, and then puts the probe in either pH4 or pH10 buffer (depending on whether the measurements to come will tend to the acidic or the basic side), and presses a second button. The machine records the readings at those two calibration values and then computes the new slope and offset, which are applied to successive measurements. The temperature is measured too, and the temperature correction is automatically applied. All this can be done using the stamp. More on this later.

Additional considerations apply when measuring pH in real world solutions. Often these solutions contain minerals and other chemical species that affect the temperature dependence of pH in a manner quite different from the theoretical Nernst value of -0.002 mV/degree Celsius. "Cycle Chemistry pH Measurement" is one reference that discusses these issues.


 .<top> <index> <home> logo < mailto:info@emesystems.com >