**2.2 pH fuzzy logic control system for nutrient solution in embedded and flow hydroponic culture**

The fuzzy-based control system was developed for maintaining a proper acidity level of nutrient solution used in potted flower cultivation of Chrysanthemum embedded and flow hydroponic cultures. Two control valves maintained the nutrient solution pH at a desired set point as follows: (1) acid valve (to manage the addition of acid solution necessary) and (2) base valve (to keep the addition of base solution necessary) (**Figure 11**). The developed control algorithm was based on membership functions of fuzzy arrangement.

Fuzzy rules had 21 linguistic statements to achieve smoothness, by trials and errors using the membership functions based on the operator skills and experience. The fuzzy logic controlled nutrient solution pH and increased the smoothness of the pH the during control course. The culture vessel consisted of six blocks, each of which containing four potted flowers. The nutrient solution flows into and fills the cultivation bench until a certain level, 5–10 cm from pot base. The embedded system kept the plant growth media in 10 min, before it then flows back into the tank and flows into the next block. The flow rate of the nutrition used in this experiment was 2.4 L min<sup>−</sup><sup>1</sup> and the measuring apparatus was Hanna pH-meter (HI8710E model).

The control system maintained 0.3 M H3PO4 and 0.4 M KOH, which flowed constantly from Marriott tube. The valve used was of solenoid type with 1/8 in. in diameter. Calibration of the pH-meter was done on voltage basis using PCL-812PG

**Figure 10.** *Experiment of RTOS.*

#### **Figure 11.**

*Embedded and flow system with pH control system.*

interface. Marriott tube was also used to calibrate the flow rate as well as on the relay circuit. The measurement result of the pH of nutrient solution was in the form of DC voltage and was transferred to 88 shunt circuit in order to get input voltage at a range of 0–5 V conforming to the working voltage of the PCL-812PG interface. This voltage became the reference digital signal for the computer to conduct data processing with control program. The output of the control action was the duration of the solenoid valve opening depended upon the input signal. A solenoid valve was activated by a relay circuit, which obtained voltage from the computer.

Process error (E) was calculated based on the difference between the set point (Sp) and the actual pH. If an E positive value was obtained, it indicated that the position of the actual pH was above the Sp and negative value of E indicated that the position of the actual was under the Sp. The error difference (dE) was the change in E to time. The error difference (dE) was the change in E to time. If the dE were positive, the error E had the tendency to increase. Conversely, if dE were negative, the error E decreased. Every numeric variable was plotted into a fuzzy system consisted of Large Positive (LP), Fair Positive (FP) and Small Positive (SP), Zero (ZO), Large Negative (LN), Fair Negative (FN) and Small Negative (SN). The control action was based on decision matrix in which there are criteria of Quick Acid (QA), Fair Acid (FA), Slow Acid (SA), Neutral (ZO), Quick Base (QB), Fair Base (FB) and Slow Base (SB).

The measurement result of the pH of nutrient solution was in the analog form of DC voltage and was transferred to defuzzification by means of weighting to the absolute membership value from every label with the membership degree obtained. A change in valve opening time, either for base tube or acid tube was due to the final output of the fuzzy. The computer program for the control system was developed using the Pascal language in DOS environment (**Figure 12**). The output voltage from the PCL-812PG had a range of 0−+5 V. The debit of the base and acid

**35**

reached to 1.5–1.8 dS<sup>−</sup><sup>1</sup>

4.3 cm3

**Figure 12.** *Pascal environment.*

s<sup>−</sup><sup>1</sup>

*Automation and Robotics Used in Hydroponic System DOI: http://dx.doi.org/10.5772/intechopen.90438*

flows from the Marriott tube was kept constant at 1.3 eels for base solution and

6.0 to 7.0. That indicated that at the same period of time [H+

acid was more than that of the ion [OH<sup>−</sup>] freed by the KOH base.

solution did not change very much due to the small change in [H+

the start up. This frequency decreased at the following blocks [10].

outlet at the Marriott tubes for base and acid solutions, respectively. The initial pH of the solution was above the set point and kept on moving to reach the pH = 6. To change the pH solution from 7.0 to 6.0, it took 26 s and a 100 s to increase pH from

The supplied voltage from PCL to relay circuit was on when the voltage reached 1.4 V and off when the voltage decreased to 1.1 V. The pH of the nutrient solution in first block can be controlled to approach the set point of pH = 6. To decrease the pH toward the set point it requires 68 s. After reaching the set point. The pH of the

Moreover, the straight line approaching the set point tendency of the error curve during the control indicates that the fuzzy logic control can maintain the solution pH at the set point. An overshoot not occurred in this pH control. The nutrient solution pH in second and third block can be controlled faster than in first block. The same phenomena occur in third block and the following blocks. In that manner, the set point indicates that the fuzzy logic control can maintain the solution pH at the set point. Both of valves frequently open in turns since the control load was still high at

**2.3 Hydroponics in combination with an automated drip irrigation system**

A grapevine rootstock in hydroponics in combination with an automated drip irrigation system was developed, which consisted of a hardware and software of the automated hydroponics system for grapevine in pots. Each pot had the same amount of fertilizer and the drip irrigation system was used. It was also constructed a time-based closed loop hydroponics and used a microcontroller for supplying the water to the pots (**Figure 13**). The irrigation system consisted of a 200 L water storage tank, containing Hoagland solution, which was modified to regulate the optimum 6.2 pH and electrical conductivity levels between 1.0 and 1.3 dS<sup>−</sup><sup>1</sup>

green cuttings of grapevine. Nutrient solution has been renewed when its EC level

inside the water storage tank. A steel structure was built to keep pots at height of 1.5 m from the ground level of the greenhouse and water storage tank and controller

. A submersible pump operating at 12 DCV was installed

for acid solution. There were differences in the heads of the air inlet and

] freed by the H3P04

] concentration.

for the

*Automation and Robotics Used in Hydroponic System DOI: http://dx.doi.org/10.5772/intechopen.90438*

**Figure 12.** *Pascal environment.*

*Urban Horticulture - Necessity of the Future*

interface. Marriott tube was also used to calibrate the flow rate as well as on the relay circuit. The measurement result of the pH of nutrient solution was in the form of DC voltage and was transferred to 88 shunt circuit in order to get input voltage at a range of 0–5 V conforming to the working voltage of the PCL-812PG interface. This voltage became the reference digital signal for the computer to conduct data processing with control program. The output of the control action was the duration of the solenoid valve opening depended upon the input signal. A solenoid valve was

Process error (E) was calculated based on the difference between the set point (Sp) and the actual pH. If an E positive value was obtained, it indicated that the position of the actual pH was above the Sp and negative value of E indicated that the position of the actual was under the Sp. The error difference (dE) was the change in E to time. The error difference (dE) was the change in E to time. If the dE were positive, the error E had the tendency to increase. Conversely, if dE were negative, the error E decreased. Every numeric variable was plotted into a fuzzy system consisted of Large Positive (LP), Fair Positive (FP) and Small Positive (SP), Zero (ZO), Large Negative (LN), Fair Negative (FN) and Small Negative (SN). The control action was based on decision matrix in which there are criteria of Quick Acid (QA), Fair Acid (FA), Slow Acid (SA), Neutral (ZO), Quick Base (QB), Fair

The measurement result of the pH of nutrient solution was in the analog form of DC voltage and was transferred to defuzzification by means of weighting to the absolute membership value from every label with the membership degree obtained. A change in valve opening time, either for base tube or acid tube was due to the final output of the fuzzy. The computer program for the control system was developed using the Pascal language in DOS environment (**Figure 12**). The output voltage from the PCL-812PG had a range of 0−+5 V. The debit of the base and acid

activated by a relay circuit, which obtained voltage from the computer.

**34**

**Figure 11.**

*Embedded and flow system with pH control system.*

Base (FB) and Slow Base (SB).

flows from the Marriott tube was kept constant at 1.3 eels for base solution and 4.3 cm3 s<sup>−</sup><sup>1</sup> for acid solution. There were differences in the heads of the air inlet and outlet at the Marriott tubes for base and acid solutions, respectively. The initial pH of the solution was above the set point and kept on moving to reach the pH = 6. To change the pH solution from 7.0 to 6.0, it took 26 s and a 100 s to increase pH from 6.0 to 7.0. That indicated that at the same period of time [H+ ] freed by the H3P04 acid was more than that of the ion [OH<sup>−</sup>] freed by the KOH base.

The supplied voltage from PCL to relay circuit was on when the voltage reached 1.4 V and off when the voltage decreased to 1.1 V. The pH of the nutrient solution in first block can be controlled to approach the set point of pH = 6. To decrease the pH toward the set point it requires 68 s. After reaching the set point. The pH of the solution did not change very much due to the small change in [H+ ] concentration. Moreover, the straight line approaching the set point tendency of the error curve during the control indicates that the fuzzy logic control can maintain the solution pH at the set point. An overshoot not occurred in this pH control. The nutrient solution pH in second and third block can be controlled faster than in first block. The same phenomena occur in third block and the following blocks. In that manner, the set point indicates that the fuzzy logic control can maintain the solution pH at the set point. Both of valves frequently open in turns since the control load was still high at the start up. This frequency decreased at the following blocks [10].

## **2.3 Hydroponics in combination with an automated drip irrigation system**

A grapevine rootstock in hydroponics in combination with an automated drip irrigation system was developed, which consisted of a hardware and software of the automated hydroponics system for grapevine in pots. Each pot had the same amount of fertilizer and the drip irrigation system was used. It was also constructed a time-based closed loop hydroponics and used a microcontroller for supplying the water to the pots (**Figure 13**). The irrigation system consisted of a 200 L water storage tank, containing Hoagland solution, which was modified to regulate the optimum 6.2 pH and electrical conductivity levels between 1.0 and 1.3 dS<sup>−</sup><sup>1</sup> for the green cuttings of grapevine. Nutrient solution has been renewed when its EC level reached to 1.5–1.8 dS<sup>−</sup><sup>1</sup> . A submersible pump operating at 12 DCV was installed inside the water storage tank. A steel structure was built to keep pots at height of 1.5 m from the ground level of the greenhouse and water storage tank and controller

**Figure 13.** *Grapevine experimental setup.*

circuit were installed immediately under the pots. The excess water was easiest to return to the reservoir by the drainage pipes connected to the drainage holes of the pots. Electrical conductivity of the irrigation water (ECw) was measured by an EC59 meter. Pots were irrigated with the same amount of nutrient solution. The required water was supplied by using 16 inches of diameter pipes with 4 L h<sup>−</sup><sup>1</sup> drippers at a spacing of 33 cm, with three drippers serving each pot. Some connection apparatus and valves were used in the irrigation system to integrate all items.

At the beginning of the test, all substrates were filled up to field capacity, then the automated system started irrigation at 4 h intervals and run the submersible pump only 1 min throughout the whole growing season so that this irrigation management kept the soil moisture at the level of field capacity in each substrate since excess water was drained to the reservoir back after each irrigation event. The controller circuit, in which main power supply was 12 DCV, providing power to the controller and relays, but it was reduced to 5 DCV for microcontroller by using a regulator of 7805 and relay (**Figure 14**).

The program providing the automation in the hydroponics system was simple and basic and very easy to load into the memory of the microcontroller, which repeated the actions throughout the whole growing season. The dosage of water was determined according to the pumping time of water. The microcontroller switched on relaying to pumping water to the root territory only for 1 min. After that, supplying of water has been stopped to the pump and then waited for 4 h of interval for the next irrigation session. The system took over the irrigation events successfully for the whole growing season. The system conveys a properly balanced nutrient solution to the plant root area. The system saved water and fertilizer, but the water level in the reservoir must be checked with 2- or 3-weeks interval or water level sensor should be added to the controller circuit. Perlite due to its characteristics has more advantages as being used in the hydroponics system as compared with peat and peat + perlite (1:1, v:v). This system can be used for small producers from small hydroponic systems [11].
