You are on page 1of 5

29T H ASEMEP NATIONAL TECHNICAL SYMPOSIUM 1

GENETIC ALGORITHM BASED FUZZY LOGIC


CONTROLLER FOR SMART FARMING
TECHNOLOGY
Jaycee R. Jalos
Jcel C Malaguit
Ralph Laurence G. Visaya
Master of Science in Electronics Engineering
Batangas State University
Batangas City, Batangas, Philippines
jaycee jalos@yahoo.com
jcelmalaguit@gmail.com
sayaviarvie@gmail.com

Abstract—This research discussed the methods of enhancing This study aims to help in achieving food security in the
and developing farming system through the use of technology near future, because according also to United Nations World
advancement in early 2019. The context focused on fuzzy logic Population Prospects that in 2030 the world population will
controller technology for smart farming technology with the use
of Arduino microcontroller with an Android Application. The grow up to 8.6 billion, and to increase further to 9.8 billion
project make use of Arduino IDE for programming platform of in 2050 and 11.2 billion by 2100. This implies that if food
Arduino, as well as, Blynk application for making an Android insecurity will not be minimize or lessen many people will
Application for data storming and monitoring processes. The suffer in hunger.
purpose of this smart farming is to optimize the growth of
plants using genetic algorithm, using grow lights as substitute
of sunlight, using of drip irrigation for controlled watering and With the help of technology in early 2019, this research
monitoring of necessary parameters using sensors in more acces- introducedfurther study on how to effectively and efficiently
sible way (using smartphones). Fuzzy logic controller technology grow various crops in farm and even in acontrolled
provides system in dealing with impreciseness and uncertainties. environment. Using adequate tools, a controlled environment
In these situations, it is notable to solve a large number of prob- can be built accordingly to particular crops. Arduino boards,
lems encountered using smart farming technology. Smart farming
technology provides soil moisture monitoring, temperature and Android, and Blynk Applications are sophisticated tools
humidity control, water level monitoring, drip irrigation system which are used in this Smart F arming T echnology ; The
synchronization to monitoring system, as well as provision of technology make use of sensors (i.e. temperature sensor,
intelligent system for supporting the decision making process. humidity, etc.) integrated with these tools to monitor different
Index Terms—Fuzzy Logic Controller Technology, Android, Ar- parameters needed. Drip irrigation is also incorporated in this
duino, Genetic Algorithm, Smart Farming, Blynk, MATLAB, Smart F arming T echnology for controlled watering based
Grow Light, Drip Irrigation System on needs of the crops.

Using Fuzzy Logic theory and application integrated in this


I. I NTRODUCTION technology, intelligent system for supporting the decision
Food is one of the basic necessities of people. However, the making process of farmers was provided. This was made
issue on poverty and hunger become the biggest issue world possible using different programming language and tools such
wide. In 2016, the United Nations Food and Agriculture as MATLAB, Python, and C.
Organization (FAO) estimates that about 815 million people
of the 7.6 billion people in the world, or 10.7%, were
suffering from chronic undernourishment. And according to
www.worldhunger.org one of the main problem of hunger
is F ood Insecurity which refers to limited or unreliable
access to foods that are safe and nutritionally adequate.

Batangas State University II. R EVIEW OF R ELATED L ITERATURE


29T H ASEMEP NATIONAL TECHNICAL SYMPOSIUM 2

A. Smart Farming or Precision Agriculture way to write a code and upload it to the board, it runs on
Smart Farming or Precision Agriculture[1] is a farming man- Windows, Mac OS X, and Linux. The environment is written
agement concept based on observing, measuring and respond- based on Processing, Java, and other open-source softwares.
ing to inter and intra-field variability in crops. Different meth- The software can be used with any Arduino board.
ods and tools can be used in implementing Smart Farming.
C. Fuzzy Logic Controller
B. Genetic Algorithm The first step in designing Fuzzy Logic System is to describe
[2]
The genetic algorithm is a method for solving both con- fuzzy sets, the information in terms of fuzzy linguistic terms
strained and unconstrained optimization problems that is based or can be regarded as values equal to 0 or 1 and values
on natural selection, the process that drives biological evolu- within them. The fuzzy membership function is used to
tion. The genetic algorithm repeatedly modifies a population assign values with respect to fuzzy sets and its degrees of
of individual solutions. membership. Moreover, the most commonly used technique
requiring four parameters to be specified with respect to its x
and y coordinates is called Trapezoidal Membership Function.
C. Internet of Things (Iot) Also, the Triangular Membership Function can be used in the
Internet of Things (IoT) technology[3] has brought revolution system which requires three parameter specifications. The first
to each and every field of common mans life by making step in designing Fuzzy Logic System is to describe fuzzy sets,
everything smart and intelligent. IoT refers to a network of the information in terms of fuzzy linguistic terms or can be
things which make a self-configuring network. The develop- regarded as values equal to 0 or 1 and values within them.
ment of Intelligent Smart Farming IoT based devices is day The fuzzy membership function is used to assign values with
by day turning the face of agriculture production by not only respect to fuzzy sets and its degrees of membership.
enhancing it but also making it cost-effective and reducing
wastage.

III. M ETHODOLOGY

A. Project Description
In this project, the crops that will be planted is on the soil bed
placed inside a closed cabinet. Only the doors of the cabinet
can be opened just to take the soil bed inside and outside
the cabinet. The cabinet is made up of wood. The soil bed
Fig. 1. Fuzzy Logic Controller Block Diagram
is made up of an aluminum. In this study, Arduino with wifi
module called Wemos is used in this study. Alongside with
it, a smartphone application called Blynk is used to make
an android application to connect the Arduino to smartphone. D. Hardware Block Diagram
MATLAB Fuzzy Logic Toolbox will be used in this study. Two
input parameters and one output parameter will be placed into
the different sensors with five triangular membership functions
in each input. Sugeno Style Fuzzy Logic Interference system
is also used in this study. With the use of MATLAB, this will
be the simulations for the trial and error for the crisp output
value pf the fuzzy logic will be made. MATLAB Simulink
will be used also to make the diagram for the fuzzy logic
controller for the smart farming.

B. Arduino IDE Fig. 2. Fuzzy Logic Controller Block Diagram


This project is a software controlled microcontroller based
system, which makes it intelligent, independent of operator In the figure 2, it shows the hardware block diagram for the
supervision and can adapt to a restricted set of changed smart farming. In the first block, input must be done before
requirements without any hardware change. The software for the fuzzy logic controller to decide based on the rules in the
this project was developed using a simple high level language FAM matrix. After that the controller will be fed to the input
in C++. It also used ARDUINO IDE sketchbook for PC of the Arduino microcontroller which is called Wemos. Using
to system interface. The software controls the input display the smartphone, the android application created through blynk
of the device and manipulates its polarity depending on the application will be used to control and monitor the device.
parameters of the equipment engaged through it. The Arduino With the use of the real time clock module, it will serve as
IDE is an opensource Arduino Software it provides an easy the time setting for the lights to be turn on or off. The red
29T H ASEMEP NATIONAL TECHNICAL SYMPOSIUM 3

and blue lights will be used in replace to the sunlight. The In the Figure above, shows the maximum and average op-
DC fan will be used to control the temperature and humidity timization for the mung beans. Through the generation, the
inside the cabinet where in based on several researchers, it has blue line symbolized the maximum optimization up to 579
been found that there is a great effect of the temperature and genomes which is the genomes of the mung beans. And the
humidity to the growth of the crops or plants. The solenoid black line plot shows the average value for the mung beans
valve will be used to make the automatic filling of the water genomes which is below 579 but not less than 500.
tank. The soil moisture sensor trigger also the water pump for
the irrigation system. B. Fuzzy Logic Toolbox Simulations

IV. R ESULT AND D ISCUSSION

A. Genetic Algorithm Simulation

Fig. 5. Sugeno Fuzzy Interference System in MATLAB Fuzzy Logic Toolbox

The study uses the MATLAB Fuzzy logic toolbox for the
simulation of the FIS. Sugeno-Style FIS is used for the
controller. Two inputs have been given to the toolbox namely:
Fig. 3. Generation and Average Fitness Plot height and rate of change and one output namely: growth.

In the Figure above, it shows the plot points for the generation
of 100 types and its average fitness for the 100 mung beans
generating the genomes.

Fig. 6. Input 1 in FIS

In Figure 6, shows the first input of the fuzzy logic which is


named height. In the toolbox, it shows also the 5 triangular
Fig. 4. Graphical Plot for the Maximum and Average Optimization membership functions used in the system parameters namely:
29T H ASEMEP NATIONAL TECHNICAL SYMPOSIUM 4

’Very Low Rise (VLowRise)’, ’Low Rise (LowRise)’, ’Normal


Rise (Normal Rise)’, and ’Very High Rise (VHighRise)’

Fig. 9. Rule View

In the figure shows the output of the fuzzy logic in the rule
view. Before having this simulation, the researchers made
Fig. 7. Input 1 in FIS twenty-five (25) rules after the input and output parameters
have been made. This rule serves as the decision making of
the control system. In the figure 9, when the height is 84.3
In the figure, it shows input two of the FIS Smart Farming. It and the rate of change for growing is 32.7, then the output
shows also the five triangular membership functions used in will be 0.432 which lies between 0.25 and 0.50 of the output
the system parameters namely: ’Very Slow (VSlow)’, ’Slow which is Slow and Normal respectively. So the output still lies
(Slow)’, ’Normal’, ’Fast’, and ’Very Fast (VFast)’. The x-axis on the slow decision because it did not pass to 0.5.
values ranges from 0 to 99 and the y-axis ranges from 0 to 1.
V. C ONCLUSION
As of now, the researcher are still working on this project.

VI. R ECOMMENDATION
As of now, the researcher are still working on this project.

VII. ACKNOWLEDGMENT
The Authors would like to acknowledge the help and guidance
of Dr. Celso Co. Without him, this tutorial would have not been
possible. Also, our loving family who always understands our
hetic schedule and most specially, God who always gives us
strength and wisdom to write this research paper

VIII. R EFERENCE

R EFERENCES
[1] Wikipedia, Precision agriculture, Copyright ©2018, From Wikipedia,
the free encyclopedia, https://en.wikipedia.org/wiki/Precision
agriculture accessed on March 1, 2019, ,
[2] Mathworks, What Is the Genetic Algorithm?, Copyright ©,
Fig. 8. Output of FIS https://www.mathworks.com/, https://www.mathworks.com/help/
gads/what-is-the-genetic-algorithm.html accessed on March 3, 2019, ,
[3] Nayyar, Anand & Puri, Vikram., Smart Farming: IoT Based Smart
Sensors Agriculture Stick for Live Temprature and Moisture Monitoring
The output ’Growth’ is shown in the figure above. It shows using Arduino, Cloud Computing & Solar Technology, Copyright
the five classification for the growth parameters namely: ’VS- ©2018, https://www.researchgate.net, https://www.researchgate.
lowGrowth’, ’SlowGrowth’, ’Normal’, ’FastGrowth’ ’VFast- net/publication/313804002 Smart farming IoT based smart sensors
agriculture stick for live temperature and moisture monitoring
Growth’. It’s values varies from 0, 0.25, 0.5, 0.75, and 1.0 using Arduino cloud computing solar technology accessed on March
respectively. 1, 2019, ,
29T H ASEMEP NATIONAL TECHNICAL SYMPOSIUM 5

[4] Engelhardt, Mike, LTspice XVII(x64), Copyright ©2018, Linear


Technology Corporation is now part of Analog Devices, Engr. Ralph Laurence G. Visaya earned his
https://www.analog.com/en/design-center/design-tools-and-calculators/ diploma as an Electronics Engineer from Lyceum of
ltspice-simulator.html accessed no Nov 5, 2018, , the Philippines University - Laguna Campus in 2016.
[5] Enthought, Enthought Python Distribution, Copyright ©2018, Enthought He was recognized as research best paper and best
Inc. All Rights Reserved, https://www.enthought.com/product/canopy/ speakerat Research Colloqium 2017 held at Lyceum
https://www.enthought.com/product/enthought-python-distribution/ ac- of the Philippines - Laguna Campus. He has been
cessed on Nov 6, 2018 , , guest speaker of various seminars and presented
[6] Haldane, Allan, cdavid, certik, Charles R. Harris, Jarrod Milman, jtaylor, different research papers in research conferences. He
Mathew Brett, Matti Picus, Ralf Gommers, rkern, Travis Oliphant, is currently pursuing Master degree from Batangas
Numpy 1.15.4, Copyright ©2018, Numpy Developrs. Created using State University Main Campus 2.
Sphinx 1.6.6 http://www.sphinx-doc.org/en/master/, https://pypi.org/ He is currently Technical Support Engineer at Tas Mustard Seed Systems
project/numpy/#files accessed on Nov 6, 2018, , Corporation since 2018.
[7] Hunter, John, Darren Dale, Eric Firing, Michael Droettboom , Mat-
PlotLib, Copyright ©2002-2012, 2012-2018, MatPlotLIb Development
Team, https://matplotlib.org/# accessed on Nov 6, 2018, ,
[8] Knuth, Donald, MikTex, Copyright ©2018, Chrisstian Schenk, https:
//miktex.org/ accessed on Nov 5, 2018, ,
[9] Python Packaging Authority , Python Package Index, Copyright ©2014,
Python Software Foundation, , https://www.pypa.io/en/latest/ https:
//pypi.org/ accessed on Nov 6, 2018 , , The Python Packaging Authority
(PyPA) is a working group that maintains many of the relevant projects
in Python packaging.
[10] Raybaut, Pierre, Spyder 3.2.8, The Sicentific PYthon Development Envi-
Ronment, Copyright ©2018, The Spyder Project Contributors, Licensed
under the terms of the MIT License, https://github.com/spyder-ide/
spyder accessed on Nov 5, 2018, ,
[11] Raybaut, Pierre, Gabi Dvar (Maintainer), Python(x,y)-2.7/10.0.exe,
Copyright ©2008,2015, GitHub, https://github.com/ https://python-xy.
github.io/ accessed on Nov 6, 2018 , , History:Python(x, y) was
concieved, developed and maintained by Pierre Raybaut since 2008 with
the above goals. Gabi Davar joined the project as a maintainer since
2011. Pierre moved to work on other projects since 2013 leaving Gabi
as the primary maintainer.

IX. A BOUT THE AUTHORS

Engr. Jaycee R. Jalos, ECE He earned his Bache-


lors Degree in Laguna State Polytechnic University
in 2009. After he graduated he took the ECE Li-
censure Exam in 2009 and passed the exam. He
is currently employed in CBK Power Company
Limited as Plant Automation and Communications
Engineer II since 2010.
He is currently taking his Masters Degree in Elec-
tronics Engineering in Batangas State University,
Batangas City, Batangas.

Engr. Jcel C. Malaguit earned her diploma as an


Electronics Engineer from University of Perpetual
Help System - DALTA Calamba Campus in 2015
and is pursuing Master degree from Batangas State
University Main Campus 2.
She is currently the Production Quality Engineer of
Camera Module Department at IM Digital Phil. Inc.

You might also like