en:ph

# pH

In this term we means acidity and alkalinity of soulution. Definition of pH:

$pH=-\log a(H^+)$

In words it is negative decimal logarithm of activity of hydrogen cations. In ideal conditions we can assume activity to be the same as the concentration. And the equation become to more favourable form: pH = – log c(H+) So it is a concentration of hydrogen cations expressed on logarithmic scale, which means that, if we want to change pH about one degree we must scale up ion concentration ten times. It means, the higher the concentration of hydrogen cations is, the lower is pH(remember negative sign before logarithm). So for pH=7 it is c(H+) 10-7 and for pH 3 it is c(H+)10-3.

### Why measure pH

Acidity of nutrient solution is essential for plant. It affects possibility of roots soak up ions dissolved in solution. In inappropriate pH, the plant will suffer by deficit of some nutrients.

### Principle of measuring pH

Value of pH can be taken by potentiometric measuring (Measuring potentional of elektrochemical cell). We measure potencial between two electrodes, referent (with constatn potentional) and the measured one. You can find more about this topic here. Most often reference electrode used is silver-chloride electrode and for measuring electrode it is glass electrode. Usaly we have both electrodes in one compact unit (on picture) called , “pH electrode” or better pH probe.

The potencial of chloride electrode is given by:

$E=E^0-\frac{RT}{F}\ln a_{cl^-}$

Because concentration of chloride ions inside pH probe is same during the time, the electrode has constant potential in constant temperature .

Second one is glass electrode. This electorde is made from special very thin hydrogen sensitive glass. This electrode hydrolyze in water solution, that means that the hydrogen ions changes with sodioum ions in glass, as result of this this change is grow of potential on the surface of glass electrode. Potential of ion-selecting electrode is given by Nicolsky-Eisenman equation:

$E=K+\frac{RT}{z_xF}\ln ([x]+\sum_i(K_i[i]^\frac{z_x}{z_i}))$

If we assume that the electrode interact only with cations of hydrogen, we can simlify the equation:

$E=K+\frac{RT}{F}\ln a_{H^+}$

So the potential of all cell is given by:

$U=U_m-U_{ref}$

From combination of above equations we get potential of pH probe.

### Code and schematic

Potential of pH probe is in range of hundreds of millivolts and has impedance of MΩ. If we want to process this signal by arduino, it is necessary to amplify it. Good solution can be use of operational amplifier. E.g. like in schema on picture.

This schema is one of the simplest, but for our purposes it is more then sufficient. It is originaly taken from this pages of project wiki. In first step signal is amplified by operational amplifier in “closed loop” mode. It is possible to change amplify by potentiometer pot1 (gain):

$V_{out}=-\frac{R1}{R2}V_{in}$

In second step signal is looped and offset is set by potentiometer pot2. On output we get signal which can be meassure by arduino.

Circuit simulation in java applet by Paul Falstad.

Sorry, you need a Java-enabled browser to see the simulation.

Kód:

ph.ino
#define PHInput A1

#define SAMPLES 100 //number of samples readed by voltage() function

float PHa=1; //koeficients of aproximation line
float PHb=1; //for correct pH reading need calibration

float ph;

void setup()
{
}

void loop()
{
delay(500);
}

float PHf;
PHf=(voltage()/PHa)+PHb;
return PHf;
}

float voltage(){
long sensorValue=0;
for(int i=0;i<SAMPLES;i++){
delay(10);
}
sensorValue/=SAMPLES;
return sensorValue;
}

### Temperature dependency of pH

At first the temperature move with dissociation constant of molecules. So it affect pH. As you can see on table copied from calibration solution:

teplota[°C] pH
0 7,13
5 7,10
10 7,07
15 7,04
20 7,03
25 7,01
30 7,00
35 6,99
40 6,98
45 6,98
50 6,98

From table is obvious decreasing pH with increasing temperature. But I am not sure by generality of this rule.

From above equations one can be seen dependency of potential of electrodes on temperature.

Although temperature dependency of pH is inherent fact, for purposes of measuring acidity of nutrient solution, with temperature range 15-25°C, we can neglect the efect of temperature without making big mistake.