Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

System Monitoring pH and TDS Hydroponic Bok

Choy Plants Using Fuzzy Logic as a Controller


Raudah Alfiani
Faculty of Electrical Engineering
Mercu Buana University
Jakarta, Indonesia
raudahalfiani@gmail.com

Abstract—Hydroponic plants are being widely used adjusting to the needs of the value of vegetables these factors
by novice farmers who want to learn to plant without can continue to change, so we need a control system that can
requiring a large area of land or can be planted in their adjust the value of the vegetable factor must be automatic. A
own yard. This study monitors the pH and TDS set of control systems that can be used for hydroponic
Monitoring System for Bok Choy Hydroponic Plants vegetable cultivation is a fuzzy system [3]. Fuzzy logic is
Using Fuzzy Logic as a controller that can be simulated easy to implement because it is simple and can follow a
in a matlab application consisting of pH and TDS logic simple control process. Completed by humans. The ancient
Sangat Kurang (SK), Kurang (K), Normal (N), Tinggi control system can only control and monitor the system from
the position of the system installed making it difficult to
(T), Sangat Tinggi (ST). Maintenance of Bok Choy has
control and monitor if the user of the system is not where the
several conditions in order to grow effectively such as pH system is installed. In modern agriculture, use the Internet to
susceptible 7 TDS 1050 - 1400 this study tries to promote the maintenance of farmland. The condition of
maintaining pH and TDS in the range with a fuzzy based agricultural land can be directly monitored from anywhere
monitoring system. via the internet. The problem in this research is how the
application system Sugeno fuzzy inference method in
Keywords—Bok Choy, pH, TDS, matlab, Fuzzy Logic determining the approximate amount of pH and nutrition for
the Bok Choy Hydroponic This research aims to create a
I. INTRODUCTION
system of fuzzy inference zero-order Sugeno method that can
In recent years, hydroponic systems have become be used to estimate the a number of simulation models of
increasingly popular in many countries. Thanks to a closed production and making the FIS Sugeno method using
system that can adjust the number of chemicals used to Matlab.
control growth and prevent pests. Hydroponic systems use a
water-based recirculating system, which contains essential II. LITERATURE REVIEW
nutrients needed for plant growth. One type of hydroponics is
the deep flow technique, which is a type of hydroponics, A. Hydroponic Deep Flow Technic
which achieves a continuous flow of nutrients, and a puddle Hydroponics is the method of farming where plants can
of half the diameter of the pipe drowns the plant roots. The be grown in nutrient-fortified water, instead of in soil [4]
DFT system is designed to optimize nutrient uptake by Deep Flow Technic) is one method of hydroponic water
plants. Special attention needs to be paid to the elements of culture that uses water as a medium for providing nutrients
hydroponic plant growth to produce good and healthy where plant roots always submerged in a nutritional solution.
plants. Compared to traditional farming, the advantages of The DFT system constantly flows water-soluble nutrients
hydroponics include reduced soil pathogens, increased used in cropping plants to provide nutrient solutions, through
water use efficiency, more equitable distribution of nutrients, the plant roots at a constant depth in the planting tray. Plants
and higher yields [1]. In hydroponic cultivation of plants, in are cultivated in drainage channels with a nutrient solution
addition to nutrition, the most important thing in plant that is about 4-6 cm in height thatflows continuously, where
growth is pH (Power of Hydrogen) which is the degree of the roots of plants are always submerged in the nutrient
acidity or alkalinity of a particular substance. The pH in solution. Nutrition solutions will be collected back into the
hydroponic cultivation has an impact on the absorption of nutrient basin, then pumped through a distribution pipe to the
nutrients needed by the plant. Likewise, if the TDS in planting pond continuously[4].These nutrients flow in the
hydroponics is not stable, it will cause yellowing and wilting tray through the roots of the plant and therefore returns to the
of leaves, plants will be stunted, and plants will grow mixing tank, and so on in this research, the system applied in
slowly. Therefore, with the application of fuzzy logic to agriculture with hydroponics [5].
adjust the pH value of the aquaculture content, it is expected
to maintain the predetermined pH value [2]. However, this
study only focuses on regulating the PH content of nutrients,
and does not regulate the TDS content of nutrients. In fact,
the role of TDS is very important for the growth of
hydroponic plants. Therefore, to answer some of the
problems above, a tool has been developed that can
automatically regulate PH and TDS in hydroponic nutrient
solutions so that nutrients are maintained. The application of Fig 1. Dynamic Floating Technique (DFT)
the fuzzy logic method in this tool aims to provide nutrients
that can be adapted to the nutritional needs of plants [2].After

XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE


B. Fuzzy Logic consuming defuzzification process. The advantages fuzzy
Fuzzy means are fuzzy or vague. In fuzzy logic, the degree Sugeno are:
of membership has a value range of 0 to 1. Fuzzy logic is • Computationally efficient
used to translate an expressed quantity using language • Works well with linear techniques, such as PID control
(linguistics), for example, the magnitude of slow speed, • Works well with optimization and adaptive techniques
rather fast, vehicle speed fast and very fast. Fuzzy logic • Ensure the continuity of the output surface
shows the extent to which a value is true and the extent to • Very suitable for mathematical analysis
which a value is false. Not a classical logic, a value has only C. Bok Choy Plant
2 the probability that is a member of the set or not. The
Bok Choy is a type of vegetable group mustard that has
degree of membership 0 (zero) means the value is not a
been cultivated since the 5th century. This plant is one of the
member of the set and 1 (one) means that value are members
important vegetables of Asia, especially in China. This plant
of the association [12]. A fuzzy inference system is a
has stemmed-shaped leaves lightly oval dark green and
process of formulating mapping from a given input to output
shiny, not forming head, grows slightly upright or half
with using fuzzy logic. This system involves fuzzy logic and
horizontal. A good air temperature for Bok Choy growth is
components in it such as membership functions, operations
an area that has a temperature of 15.6°C at night and during
fuzzy logic and if-then rules.
the day21.1°C, more or less than the temperature of the Bok
Choy plant cannot grow properly. This is because of the
temperature of the air which is very influential on the
growth of Bok Choy. Temperature mismatch will result in
obstruction of processes that may result in the termination of
production of starch (carbohydrates) and respiration
increased even greater.
Fig 2. Blok Diagram Fuzzy Logic
Figure 2 is a block diagram of fuzzy logic that begins from
input, fuzzification, the reasoning using predetermined rules,
then defuzzification and that. The last one is the output.
The Fuzzy is set to save the pH of the solution and nutrients
in order to maintain the set value. Fuzzy-logic membership
functions are designed to produce a fast reaction time for the
control [6], the result of fuzzification that will determine
whether it enters the specified value for each sensor pH and
TDS. Fuzzy logic implementation to apply and control the
computer system by using some conditions to control the
system. To analyze the nutrient uptake of plants. This
method is a method of fuzzy reasoning that expresses the
rules. In the form of IF-THEN, the system output is not a
fuzzy set, but a constant or linear equation. This method was
proposed by Takagi-Sugeno Kang in 1985. The Sugeno
model uses a Singleton membership function, ie a
membership function has a membership degree of 1 in one Fig 3. pH and TDS for each vegetable
brittle value, and a membership degree of 0 in another crisp (Source: Hidroponikpedia.com)
value. For order 0 with the formula:
Each vegetables has different nutritional needs, especially
IF (x1 is A1) ° (x2 is A2) ° ... ° (xn is An)
Bok Choy in figure 3 it can be seen the pH of the right
nutrient water for Bok Choy plants, namely pH 7 while the
THEN z = k, (1) nutritional needs tanged from 1050 ppm up to 1400 ppm.
With AI is a fuzzy set to i as an antecedent (reason), ° is a
fuzzy operator (AND or OR) and k is a strict constant as a D. pH Sensor
consequence (conclusion). Whereas the Order 1 formula is: The pH sensor is a sensor for detection acidity and
IF (x1 is A1) ° (x2 is A2) ° ... ° (xn is An) alkalinity in a solution or liquid. pH sensor is measured in a
scale range of 0-14 pH degrees and basicity degrees and
THEN z = p1 * x1+…+ pn* xn + q, (2) basicity are declared neutral if the scale is at 7ph The pH
sensor used in this study is a pH sensor which using a glass
With AI is a fuzzy set to I as an antecedent, ° is a fuzzy electrode. These electrodes consist of a rod made of glass
operator (AND or OR), pi is the constant i, and q is also the that contains the well. The bracelet membrane that thin walls
result constant [7]. In the Sugeno method, fuzzification, are sensitive to H+ ions. The pH sensor element is located in
fuzzy operations, and the meaning are the same as the the center and in the sphere of liquid silver – silver chloride
Mamdani method. The difference is only in aggregation and (Ag-AgCl). Part The bottom of this sensor element is in
defuzzification. If the value method is under the curve, then contact with the glass membrane and contains a silver-silver
under the Sugeno method. In Sugeno's zero-order case chloride solution.
model, each fuzzy rule is constant, so all membership
functions pass through spikes. Sugeno has better processing
time since the weighted average replaces the time-
Fig 7. LCD

H.
RTC

Fig 4. Module pH sensor


E. TDS Sensor
TDS (Total Dissolved Solid) is a electrical conductivity
of the nutrient medium was used as an indicator of broad
nutrient consumption because plant tissues absorb nutrients
to promote growth [8]. that the tissue culture environment
promotes rapid growth but is subject to continued optimal
nutrient levels. Uptake by plants is reduced. This system is RTC (Real-time clock) is a device that can receive and
specially designed for real-time monitoring of Pakchoy store real-time data in the form of time decryption, such as
Hydroponic. Also performed in system design day, date, month, and year. In this study, the RTC used is
Determination of analog voltage conversion equation PPM the RTC DS3232 type. Automatically, RTC is able to store
unit value on the TDS sensor[8]. all data for time, day, date, month, and year, up to month
differences that have 30 days or 31 days.[9]

Fig 5. TDS (Total Dissolved Solid)


F. Relay
The relay module is a device that uses electromagnetics
to operate the switch contacts. A simple relay module
arrangement consists of a coil conducting wire wrapped Fig 8. RTC
around the core iron. When the coil is energized, the field
magnet formed attracts the axis of the armature which is I. Water Pump
used as a lever for the switch mechanism. This relay module
can also be used as a switch to run various electronic A water pump is a machine that delivers or compresses
equipment. For example, electric light Electric motors, and liquid. The water pump is used to move water from a low
various other electronic equipment. Control ON or OFF place to a higher place or to a place further away [12].
Button (relay), completely determined by the output sensor, Pumps move fluid by using energy to increase the amount of
after receiving the Microcontroller will generate a command pressure in the system, shown in the simplified form below.
to relay to perform the ON or OFF function. Diaphragm pumps belong to the group of positive-
displacement pumps. Positive displacement pumps operate
by changing the volume in a closed system. When the
pressure increases, the volume of water will decrease,
otherwise, when the pressure decreases, the volume of water
will increase. This change in pressure causes the liquid to be
sucked into the system and pushes it in the desired direction.

Fig 6. Relay Fig 9. Water Pump


G. LCD
LCD (Liquid Crystal Display) is a type of display media
that using liquid crystal as the main viewer. The features
presented in this LCD are Consist of 16 characters and 2
lines. Has 192 saved characters, there is a programmable
character generator, addressable with 4-bit and 8-bit modes,
equipped with a backlight. The process of initializing the
Arduino pin which is connected to the RS LCD pin, Enable,
D4, D5, D6, and D7, performed in the Liquid Crystal row
(2, 3, 4, 5, 6,127), where LCD is a variable that is called
every time an instruction related LCD will be used.
J. NODE MCU ESP8266
A processor-type microcontroller that has been
integrated with the Arduino IDE. ESP8266 is a low-cost
development board that consolidates GPIOs, 12C, UART,
ADC, PWM, and Wi-Fi for rapid prototyping [10]. Node
MCU ESP8266 has a memory capacity of 4MB.
Considering the implementation of consensus algorithms on
hardware requires a large memory allocation, then the
memory capacity of the Node MCU ESP8266 is sufficient
for the implementation of the minimum consensus.

Fig 10. NODE MCU

III. WORKING STEPS


The system is designed to be able to monitor the nutrient
and pH needs of the plants. Generally, we purpose a system
design based on the IoT concept and fuzzy logic to support C. Wiring Diagram
the monitoring and controlling process, in real-time. In this
section, we discuss the design architecture, fuzzy logic In this section before implementing directly here
design, and flowchart of the system. the author makes a wiring diagram as follows:
References to what kind of image will be made there are:
A. Design Architecture 1. 4 motors
The architecture of the system consists of five major 2. 4 Relays
modules, i.e., ESP8266 as microcontroller module, pH sensor 3. 1pc Node MCU ESP 8266
module, TDS sensor module they’re connected to relay and 4. 1 piece LCD
pumps, and LCD. The design that the mini-submersible- 5. 1 module pH Meter V1.1
pump to on or off the curtain. In designing applications to be 6. 1 piece of TDS Sensor (Total Dissolved Solid)
able to control each one input from the sensor and the output First, the pH meter and TDS sensor reads the data of a
to be performed, the author also uses C language compiled predetermined value, and then the motor instructs to
using the Node MCU ESP8266-open SDK toolchain via
increase and decrease the pH and nutrients
Arduino IDE to write programs in Arduino Uno
microcontroller. Each input from the sensor will be read by
ESP8266 and then by using fuzzy logic to decide what to do.
Then the microcontroller will read each value that will be
sent by each sensor to be then analyzed. The microcontroller
will connect the BLYNK server via an existing internet
connection to managed measurement data.
B. Flowchart
The flowchart starts when the RTC shows the time that has
passed set then if it is suitable the pump for the main water
flow will turn on then reading the pH on hydroponic Bok
Choy plants, shows pH > 7.5 then pump for lowering the pH
will turn on and vice versa if the pH shows < 6.8 then the
pump will raise the pH to a normal value. In addition to Fig 12. Wiring Diagram
reading nutrition on Bok Choy plants with the specified ppm
unit if < 1050 then the pump turns on to give nutrition. The flowchart starts when the RTC shows the time that has
When all modules have been read and then processed by the passed set then if it is suitable the pump for the main water
NODE MCU ESP 8266 as microcontroller and proceed to flow will turn on then reading the pH on hydroponic Bok
the LCD and then read remotely using the same device Choy plants, shows pH > 7.5 then pump for lowering the pH
owned by the user, then the user can monitor the movement will turn on and vice versa if the pH shows < 6.8 then the
of this pH monitoring until a certain time determined then pump will raise the pH to a normal value. In addition to
all pumps will turn off. reading nutrition on Bok Choy plants with the specified ppm
unit if < 1050 then the pump turns on to give nutrition.
When all modules have been read and then processed by the
Fig 11. Flow Chart NODE MCU ESP 8266 as microcontroller and proceed to
the LCD and then read remotely using the same device
owned by the user, then the user can monitor the movement
of this pH monitoring until a certain time determined then
all pumps will turn off.
D. Fuzzy Logic System
There are several stages that must be done to design fuzzy
logic, including: Fig 14. Membership Function TDS
1. Fuzzification
1. Interference System
a. Determining Membership Function PH
Range This section connects fuzzy input with fuzzy rules.
NO Description A B C There are 10 rules of fuzzy logic, divided into two
Sangat consists:
1 Kurang - 0 4
2 Kurang 0 4 6.8 1. If (PH is SK) then (PH__UP is LAMA) and
(PH__DPWN is DIAM)
3 Normal 4 6.8-7.5 9.5
2. If (PH is K) then (PH__UP is SEDANG) and
4 Tinggi 7.5 9.5 14
(PH__DOWN is DIAM)
Sangat
3. If (PH is N) then (PH__UP is DIAM ) and
5 Tinggi 9.5 14 14
(PH__DOWN is DIAM)
4. If (PH is T) then (PH__UP is DIAM) and
(PH__DOWN is SEDANG)
5. If (PH is ST) then (PH__UP is DIAM) and
(PH__DOWN is LAMA)

6. If (TDS is SK) then (TDS__UP is LAMA) and


(TDS__DPWN is DIAM)
7. If (TDS is K) then (TDS__UP is SEDANG) and
(TDS__DOWN is DIAM)
8. If (TDS is N) then (TDS__UP is DIAM ) and
(TDS__DOWN is DIAM)
Fig 13. Membership Function pH 9. If (TDS is T) then (TDS__UP is DIAM) and
(TDS__DOWN is SEDANG)
b. Determining Membership Function TDS 10. If (TDS is ST) then (TDS__UP is DIAM) and
Range (TDS__DOWN is LAMA)
NO Description A B C
Sangat 2. Defuzzification
1 Kurang - 500 750
2 Kurang 500 750 1050 Defuzzification is changing the fuzzy value to the
3 Normal 750 1050-1400 1400 original value
4 Tinggi 1400 1800 2000
Sangat The equation for defuzzification :
5 Tinggi 1800 2000 2000
( a₁ x z ₁ ) + ( a ₂ x z ₂ ) + ( a ₃ x z ₃ ) +..(aₙxZₙ)
Output =
a ₁+a ₂+a ₃+.. aₙ
[3]

Description

Output : The value used to turn on the relay

aₙ : The result of the fuzzification process

IV. RESULT AND DISCUSSION


In this section, we discuss system implementation and
evaluation. The evaluation includes the fuzzy logic
evaluation and evaluation of controlling from fuzzy logic.
A. Fuzzy Logic in Software Testing
In the fuzzy logic testing section, we compare the results
of the fuzzy logic program in Matlab with manual
calculations, in this test using the PH and TDS values of the
Minus, Normal, and High values.
a. Calculation For PH value of 4 PH Fig 17. Value 1020 TDS UP in Matlab
The value in Matlab shows curve is 2500 for making pH up

Fig 18. Value Calculation 1020 PPM


µKurang (1000) = 0.9
µNormal (1000) = 0.1
Obtained rules :
Fig 15. Value PH UP in Matlab  IF TDS Kurang THEN TDS Sedang (2500) AND
TDS Down Diam (0)
Result:
( 0.1 x 2500 )+(0.9 x 0)
TDS UP= =250 TDS UP
0.1+0.9
0
TDS Down= =0 TDS Down
0.1+0.9
c. Calculation For PH value of 7 PH
The value 0 in Matlab for normal condition have 2 curves
PH UP and PH Down.

Fig 16. Value Calculation 4 pH

µKurang (4) = 0
µNormal (4) = 1

Obtained rules :
 IF PH Kurang THEN PH UP Sedang (2500) AND
PH DOWN Diam (0)
Result:
( 1 x 2500 ) +( 0 x 0)
PH UP= =2500 PH UP
1+ 0
0
PH DOWN = =0 PH DOWN
1+ 0 Fig 19. Value PH Down in Matlab

b. Calculation For TDS value of 1020 PPM


The value in Matlab shows curve is 250 PPM for making
TDS up
Fig 22. Value TDS DOWN in Matlab
Fig 20. Value PH UP in Matlab

Fig 21. Value Calculation 7 pH


Fig 23. Value Calculation 1400 PPM
µKurang (7) = 0
µNormal (7) = 1 µKurang (1400) = 0.2
Obtained rules : µNormal (1400) = 0.8
 IF PH Normal THEN PH UP Normal (0) AND PH  IF TDS Normal THEN TDS Normal (0) AND TDS
Down Diam (0) DOWN Diam (0)
Result: Result :
( 1 x 0 ) +(0 x 0)
PH UP= =0 PH UP ( 0,2 x 0 )+(0,98 x 0)
1+ 0 TDS UP= =0 TDS UP
0.2+0.8
0 0
PH Down= =0 PHDown TDS Down= =0 TDS Down
1+ 0 0.2+0.8
e. Calculation For PH value of 8 PH
d. Calculation For TDS value of 1400 PPPM The value in Matlab shows curve is 650 for making PH
The value 0 in Matlab for normal condition have 2 curves Down because the value PH is too high.
TDS UP and TDS Down.

Fig 22.
Fig 25. Value 8 PH Down in Matlab

Fig 24. Value TDS UP in Matlab

Fig 26. Value Calculation 8 PH

µKurang (8) = 0.25


µTinggi (8) = 0.75 real-time. Here the author will direct the addition of the
 IF PH Tinggi THEN PH up Diam (0) AND PH Blynk IoT application
Down Sedang (2500)
Result : ACKNOWLEDGMENT
This project would not have been possible without the
( 0.25 x 2500 ) +( 0.75 x 0) support of many people. Thanks to the Mercu Buana
PH Down= =625 PH Down University for awarding me a dissertation completion
0.25+ 0.75 Fellowship, providing me with the financial means to
0 complete this project. And thanks to my parents and my
PH UP= =0 PH UP
1+0 friends who always offering support

f. Calculation For TDS value of 1900 TDS REFERENCES

Mintz, A. (2019). Integrating Sustainable Practices:


[1]
Compost Tea as a Nutrient Supplement for Aquaponic
Plant Production (Doctoral dissertation, Evergreen State
College).J. Clerk Maxwell, A Treatise on Electricity
and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon,
1892, pp.68–73.
[2] Dewa, W. S., & Somawirata, I. K. (2020). Perancangan
Pengatur Kandungan TDS dan PH pada Larutan Nutrisi
Hidroponik Menggunakan Metode Fuzzy Logic.
ALINIER: Journal of Artificial Intelligence &
Applications, 1(1), 33-43.K. Elissa, “Title of paper if
known,” unpublished.
[3] Dani, Akhmad W. "Optimalisasi Pertumbuhan Pada
Sayuran Hidroponik Nutrient Film Technique Dengan
Metode Fuzzy Logic Berbasis Internet of Things."
Jurnal Teknologi Elektro, vol. 11, no. 1, Jan. 2020, pp.
1-10, doi:10.22441/jte.2020.v11i1.001. JTE.
[4] Changmai Tanabut, Gerthphol Sethavidh, Chulaka
Fig 27. Value 1900 TDS DOWN in Matlab Pariyannuj (2018). "Smart Hydroponic Lettuce Farm
using Internet of Things". Bangkok,Thailand IEEE
[5] Fuangthong, M., & Pramokchon, P. (2018, February).
Automatic control of electrical conductivity and PH
using fuzzy logic for hydroponics system. In 2018
International Conference on Digital Arts, Media and
Technology (ICDAMT) (pp. 65-70). IEEE.
[6] M. D. S., “A Review on Plant without Soil-Hi A review
on plant
without soil-hydroponics,” Int. J. Res. Eng. Technol.,
vol. 02, no.
03, pp. 299–304, 2015
[7] Wachdani, Rosida, et al, 2014, Application of Fuzzy
Inference System (FIS) Sugeno Method in Determining
Energy and Protein
Needs in Toddlers, Malang: State Islamic University
Maulana Malik Ibrahim Malang.
Fig 28. Value Calculation 1900 PPM [8] D. Eridani, O. Wardhani and E. D. Widianto,
"Designing and implementing the arduino-based
nutrition feeding automation system of a prototype
µKurang (1900) = 0.25 scaled nutrient film technique (NFT) hydroponics using
µTinggi (1900) = 0.75 total dissolved solids (TDS) sensor," 2017 4th
 IF TDS Sangat Tinggi THEN TDS up Diam (0) International Conference on Information Technology,
Computer, and Electrical Engineering (ICITACEE),
AND TDS Down Lama (5000) 2017, pp. 170-175, doi:
Result : 10.1109/ICITACEE.2017.8257697
[9] Benny, Swamardika, I. B. A. & Wijaya, I. W. A.,
( 0.25 x 0 ) +(0.75 x 5000) 2015. Rancang Bangun Sistem Tracking Panel Surya
TDS Down= =3750TDSDown Berbasis Mikrokontroler
SPEKTRUM, 2(2), pp. 115-120.
Arduino. E-Journal
0.25+0.75
[10] R. K. Kodali and S. Soratkal, “MQTT based home
automation system using ESP8266,” 2016 IEEE Region
0 10 Humanitarian Technology Conference (R10-HTC),
TDS UP= =0 TDSUP 2016.
0.2+0.75
[12] Zikri, A. Rancang bangun sistem penyiraman tanaman
otomatis berbasis Raspberry PI 3 dengan
memanfaatkan thingspeak dan interface android
sebagai kendali (Bachelor's thesis, Fakultas Sains dan
V. FUTURE WORK Teknologi Universitas Islam Negeri Syarif Hidayatullah
Jakarta).
Along with the advancement of IoT 4.0, the systems used
will be accessible via Ethernet and remotely controlled in
IEEE conference templates contain guidance text for conference. Failure to remove template text from
composing and formatting conference papers. Please your paper may result in your paper not being
ensure that all template text is removed from your published.
conference paper prior to submission to the

You might also like