**Introduction**

It is possible to **control pH digitally** using electronic valves and various solutions(acidic, basic and distilled water). The schematic diagram is attached below. The valves work in such a way that when a voltage is past through the gate, the valves which is normally closed, will open and allow the solution to flow through it. To lower the pH of the solution(make it more acidic), voltage can be past through the valves containing the acidic solution to allow it to flow through and mix with the solution making it more acidic. Likewise for increasing the pH, basic solution can be added. The purpose of distilled water is to dilute the solution. For example if i wan to increase the pH of the solution from 5 to 6, i can just add water instead of a base to increase the pH. This is to prevent the formation of minerals. The drain is used to keep the volume of the solution constant to make the measurement simple. This can be done by draining the same volume of solution before adding the acid or base.

The choice of the acid is **Hydrochloric Acid** and base is **Sodium Hydroxide**. The reason is because when they combine, they produce **Sodium Chloride** which is salt which is not harmful to the plant. The range of pH that we are interested is between the range of 3 to 11. So we will have to use diluted Hydrochloric Acid with pH of 4 and diluted Sodium Hydroxide with pH of 11.

*The flow rate of the valves should be noted to compute the time taken for the required amount of solution to flow out. The exact calculation will be illustrated in the following section.

**Schematic Diagram**

**Equations and Calculations**

*[H^{+}] refers to the concentration of H^{+}

*1 dm³ = 1000ml

*[H^{+}] x [OH^{-}] = 10^{-14} mol/dm³

For HCl of pH 3, [H^{+}] = 10^{-3} mol/dm³

For NaOH of pH 11, [OH^{-}] = 10^{-3} mol/dm³

*Case 1: To decrease the pH of the solution from 7 to 5*

*Case 1: To decrease the pH of the solution from 7 to 5*

Let A be the volume of HCl needed in dm³ and B be the volume of original solution needed in dm³.

**Total volume of the solution required is 1 dm³, hence**

A + B = 1 => B = 1 - A (1)

**Comparing the concentration of H ^{+},** —assuming H

^{+}in original solution do not recombine with OH

^{-}

A(10

^{-3}) + B(10

^{-7}) = 10

^{-5}

A(10

^{-3}) + (1 - A)(10

^{-7}) = 10

^{-5}— substituting (1)

A(10

^{-3}) - A(10

^{-7}) = 10

^{-5}- 10

^{-7}

A = (10

^{-5}- 10

^{-7}) / (10

^{-3}- 10

^{-7})

= 0.0099

Which is approximately 0.01 dm³.

Hence volume of HCl required is 0.01 dm³ and volume of original solution needed is 0.99 dm³.

In order to achieve this, we have to drain 0.01 dm³ of the original solution first, then add 0.01 dm³ of HCl into the solution.

**General Solution for decreasing pH if initial pH is below 7.**

Let X be the pH of the original solution.

Let Y be the pH of the required solution.

Hence,

**The volume of HCl needed in dm³ = (10 ^{-Y} - 10^{-X}) / (10^{-3} - 10^{-X})**

*Case 2: To increase the pH of the solution from 7 to 9*

*Case 2: To increase the pH of the solution from 7 to 9*

Let A be the volume of NaOH needed in dm³ and B be the volume of original solution needed in dm³.

**Total volume of the solution required is 1 dm³, hence**

A + B = 1 => B = 1 - A (1)

**Comparing the concentration of OH ^{-},** —assuming H

^{+}in original solution do not recombine with OH

^{-}

A(10

^{-3}) + B(10

^{-7}) = 10

^{-5}

A(10

^{-3}) + (1 - A)(10

^{-7}) = 10

^{-5}— substituting (1)

A(10

^{-3}) - A(10

^{-7}) = 10

^{-5}- 10

^{-7}

A = (10

^{-5}- 10

^{-7}) / (10

^{-3}- 10

^{-7})

= 0.0099

Which is approximately 0.01 dm³.

Hence volume of NaOH required is 0.01 dm³ and volume of original solution needed is 0.99 dm³.

In order to achieve this, we have to drain 0.01 dm³ of the original solution first, then add 0.01 dm³ of NaOH into the solution.

**General Solution for increasing pH if initial pH is above 7.**

Let X be the pH of the original solution.

Let Y be the pH of the required solution.

**Hence the volume of NaOH needed in dm³ = (10 ^{-(14-Y)} - 10^{-(14-X)}) / (10^{-3} - 10^{-(14-X)})**

*Case 3: To increase the pH of the solution from 4 to 6*

*Case 3: To increase the pH of the solution from 4 to 6*

Let A be the volume of H_{2}O needed in dm³ and B be the volume of original solution needed in dm³.

**Total volume of the solution required is 1 dm³, hence**

A + B = 1 => B = 1 - A (1)

**Comparing the concentration of OH ^{-},** —assuming H

^{+}in original solution do not recombine with OH

^{-}

A(10

^{-7}) + B(10

^{-4}) = 10

^{-6}

A(10

^{-7}) + (1 - A)(10

^{-4}) = 10

^{-6}— substituting (1)

A(10

^{-7}) - A(10

^{-4}) = 10

^{-6}- 10

^{-4}

A = (10

^{-6}- 10

^{-4}) / (10

^{-7}- 10

^{-4})

= 0.99 dm³.

Hence volume of H_{2}O required is 0.99 dm³ and volume of original solution needed is 0.01 dm³.

In order to achieve this, we have to drain 0.99 dm³ of the original solution first, then add 0.99 dm³ of H_{2}O into the solution.

**General Solution for increasing pH if initial pH is below 7.**

Let X be the pH of the original solution.

Let Y be the pH of the required solution.

**Hence the volume of H _{2}O needed in dm³ = (10^{-Y} - 10^{-X}) / (10^{-7} - 10^{-X})**

*Case 4: To decrease the pH of the solution from 10 to 8*

*Case 4: To decrease the pH of the solution from 10 to 8*

Let A be the volume of H_{2}O needed in dm³ and B be the volume of original solution needed in dm³.

**Total volume of the solution required is 1 dm³, hence**

A + B = 1 => B = 1 - A (1)

**Comparing the concentration of OH ^{-},** —assuming H

^{+}in original solution do not recombine with OH

^{-}

A(10

^{-7}) + B(10

^{-4}) = 10

^{-6}

A(10

^{-7}) + (1 - A)(10

^{-4}) = 10

^{-6}— substituting (1)

A(10

^{-7}) - A(10

^{-4}) = 10

^{-6}- 10

^{-4}

A = (10

^{-6}- 10

^{-4}) / (10

^{-7}- 10

^{-4})

= 0.99 dm³.

Hence volume of H_{2}O required is 0.99 dm³ and volume of original solution needed is 0.01 dm³.

In order to achieve this, we have to drain 0.99 dm³ of the original solution first, then add 0.99 dm³ of H_{2}O into the solution.

**General Solution for decreasing pH if initial pH is above 7.**

Let X be the pH of the original solution.

Let Y be the pH of the required solution.

**Hence the volume of H _{2}O needed in dm³ = (10^{-(14-Y)} - 10^{-(14-X)}) / (10^{-3} - 10^{-(14-X)})**

*Case 5: To obtain exact pH of 3, 7 or 11*

*Case 5: To obtain exact pH of 3, 7 or 11*

In order to obtain the exact pH of 3, 7 or 11, it is easier to totally drain out all the solution then add in HCl, distilled Water or NaOH.

*Calculating Flow rate*

*Calculating Flow rate*

Assuming the flow rate is A dm³/s,

Time taken to drain out or add a certain volume of solution = (Volume required / A) s

**Hence in order to drain out a certain volume of solution, the particular valve must be open electronically for (Volume required/A) s.**