You are on page 1of 4

The 18th International Symposium on Communications and Information Technologies (ISCIT 2018)

IoT-based Versatile Platform for


Precision Farming
Theerayod Wiangtong Phaophak Sirisuk
Electrical Engineering Department, Faculty of Engineering International College
King Mongkut Institute of Technology Ladkrabang, Thailand King Mongkut Institute of Technology Ladkrabang, Thailand
Emial: theerayod.wi@kmitl.ac.th Emial: phaophak@gmail.com

Abstract—This paper presents the use of IoT (Internet of Advance communication technologies such as NB-IoT,
Things) in agriculture such as smart or precision farming. The LoRaWan, or incoming 5G help us to capture data from IoT
versatile controller is developed to monitor and control devices efficiently. Issues on safety and IoT security are being
temperature and relative humidity in different ways to serve addressed and improved continuously.
different types of use. Control methods including timer,
hysteresis control, condition control, can be arranged in Many applications based on IoT are carried out such as
different sequences and periods of time. Eight multifunction smart city, smart grid that increase living quality of mankind.
output ports are available for actuators or loads. Results from One of application areas focused on this paper is using IoT in
real implementation are shown. Temperature and humidity in a agriculture that brings technology into crop fields and get
greenhouse can be controlled in predefined ranges to suit with more productive results using less effort. People can sit and
planting processes. Data on the cloud can be monitored in real- watch their plants growing in a greenhouse all year round.
time on PC or mobile application. Temperature, humidity and lights are controlled appropriately
for many types of plants.
Keywords—IoT, Precision Farming, Embedded System, Cloud
Services This paper presents an IoT control platform for precision
farming. The system is designed for versatile uses such as
I. INTRODUCTION temperature and humidity control for greenhouses, food
drying cabinets, hatchery incubators or weather monitoring
Internet of Things (IoT) is an ecosystem consists of the stations. The different control methods include timer,
‘things’ connected to a cloud server through the internet. As hysteresis control, condition control, can be arranged in
seen in Fig.1 hardware and sensors collect and transfer data different sequences and periods of time also used with
over a network to IoT cloud services without manual different types of loads to suit with the plant process. For
assistance or intervention from human. Users or clients can example, the wood drying process requires different setpoints
access to the cloud to monitor and control remotely. in each drying stage to prevent timber from bending.
Embedded technology plays an important role in IoT as a
hardware platform. Today’s technology can reduce the size II. PREVIOUS WORK
also power consumption that extends lifetime of the sensor Since the word Internet of Things has been coined. There
nodes. High performance embedded controller can make are many research works carried out. IoT is a combination of
decision based on storing or incoming data to efficiently electronic and information technologies. For agriculture, [1]
control its actuators. provides an overview of Internet of Things (IoT) and data
analytics. Benefits and challenges are addressed. Applications
of using IoT for monitoring in smart farming are shown in [2].
System models of IoT are proposed in [3] for monitoring soil
properties such as temperature, moisture and pH. This
information is used to support advisory models for Pest &
Disease forewarning.
Temperature and humidity are two important parameters
to be controlled in a green house. Many control topologies are
observed and implemented. In [4], the PI (Proportion and
Integral) control is proposed to control a greenhouse using
evaporative cooling system. The system is modelled in
MATLAB/Simulink to simulate and obtain proper gain and
coefficient values in the process. A fuzzy logic controller is
developed in [5] to control a greenhouse. The process of
Fig. 1. General IoT Architecture designing a temperature controller working in discrete time is
described in [6].
Gartner, the world's leading research and advisory
company, predicts that in 2020 there will be 20 billion IoT This work proposes multiple control methods including
devices deployed and used. Massive data will be collected and timer, hysteresis control, and conditional control. They can be
analyzed intelligently using AI (Artificial Intelligent). Lots of combined in run sequentially for any time intervals. This
decisions in terms of business, political activity, agriculture provides varieties of uses to control many load types used in a
plan and many more will base on data analytic greenhouse. The next section explains a system designed in
information.

978-1-5386-8458-0/18/$31.00 ©2018 IEEE 438


The 18th International Symposium on Communications and Information Technologies (ISCIT 2018)

this work. Section IV demonstrates real implementation • Loop time control: an actuator can be turned on for
results before conclusions are made in the last section. some period of time repeatedly. For example, a fan is
turned on for 10 minutes every half an hour.
III. SYSTEM DESIGN • Specific time control: an actuator can be controlled at
Hysteresis control also known as a bang–bang control (2 predefined time intervals. For example, a light bulb is
step or on–off control). It is a feedback controller that switches on at 18:00-22:00 and 01:00-05:00.
abruptly between two states, and often used to control a plant
that accepts a binary input and produce two states of outputs • Temperature hysteresis control: it can be both heating
e.g. on and off. For example, a sprinkler pump is either and cooling action. The temperature will be regulated
completely on or completely off trying to keep the inside between two setpoints, e.g. 30-35 degrees.
humidity between 80%-90% as shown in Fig.2. • Humidity hysteresis control: the relative humidity will
be regulated between two setpoints, e.g. 80%-90%.
An actuator can be humidifier or exhausting fans to
increase and decrease humidity respectively.
• Conditional control: this mode uses the current values
of temperature and humidity compared with setpoints
to define output control states. In this work, there are
9 conditions include XHYH, XHYO, XHYL, XOYH,
XOYO, XOYL, XLYH, XLYO, XLYL. Where parameters
X and Y could be either temperature or humidity.
Fig. 2. Hysteresis control Subscription H means the current value is higher than
the high setpoint (ߙሻ, O means the current value is in
‫ ݒ‬ൌ ൅ͳ݂݅‫ ݑ‬൐ ߙሺ‫ݐ݊݅݋݌ݐ݁ݏ݄݄݄݃݅݁ݐ‬ሻ between the high and the low setpoints (ߚሻ, L means
‫ ݒ‬ൌ െͳ݂݅‫ ݑ‬൏ ߚሺ‫ݐ݊݅݋݌ݐ݁ݏݓ݋݈݄݁ݐ‬ሻ the current value is lower than the low setpoint. Users
‫ ߚ݂݄݅݀݁݃݊ܽܿ݊ݑݏ݊݅ܽ݉݁ݎݒ‬൏ ‫ ݑ‬൏ ߙ can define on/off state as an output for each condition.
Here ‫ ݒ‬is a control signal for actuator, ‫ ݑ‬is a control The conditional control mode can be set as hysteresis
parameter such as temperature or humidity. ߚǡ ߙ are two control, also can be applied to many scenarios. For example,
defined setpoints. Desired control range is between ߚ ൏ ‫ ݑ‬൏ instead of using air conditioners, inlet fans can take the
ߙ. For example, to control temperature (‫ ݑ‬ൌ ܶ݁݉‫ )݌‬in a green cooling air from outside into a greenhouse if outside
house using an air conditioner (cooling action), the temperature is less than 20oC and inside temperature is greater
compressor will be turned on ( ‫ ݒ‬ൌ ൅ͳሻ if ܶ݁݉‫ ݌‬൐ ߙ and than 30oC ሺܶ௢௨௧ ൏ ʹͲܽ݊݀ܶ௜௡ ൐ ͵ͲሻǤ Supposed that X and
turned off (‫ ݒ‬ൌ െͳሻwhen ܶ݁݉‫ ݌‬൏ ߚǤ In case of using a Y are defined as outside and inside temperature respectively.
heater as an actuator (heating action), the system will work in The high setpoints (ߙ) of X and Y are set to 30 oC while the
the other way around. The heater will be turned off (‫ ݒ‬ൌ low setpoints (ߚሻ of X and Y are set to 20 oC. From the 9
൅ͳሻif ܶ݁݉‫ ݌‬൐ ߙ and turned on (‫ ݒ‬ൌ െͳሻwhen ܶ݁݉‫ ݌‬൏ ߚǤ conditions, the one that will be set to “1” is XHYL to turn on
the inlet fans. The rest will be “0”.
Naturally, the temperature in atmosphere is changing
slowly and agriculture doesnot require fast control. Hence, the A TFT 3.5” with the resolution of 480x320 is used for
hysteresis controller can be employed. The temperature or GUI. Users can see information of each function graphically.
humidity is regulated and kept between two setpoints, high For example, in hysteresis control mode, a graph with high
and low setpoints. Comparing to a system that uses a single and low setpoint lines is displayed, and the value of
setpoint, the hysteresis control method can prevent temperature or humidity is plotted in real-time. In the loop
introducing on and off states very often. timer control mode, a circle contains a red sector that indicates
the proportion of time during the on state (see Fig. 3).
As seen previously in Fig.1, the IoT system consists of a)
hardware and sensors b) cloud services and c) clients. In this Users can command and set parameters via a remote
work, they are described in the following. control. There are 8 output ports connected to Triacs or
mechanical relays to control electrical loads as shown in Fig.4.
A. Hardware and sensors
Arduino Mega2560 is used as a hardware platform for
rapid developing with many hardware shields and libraries
supported. It can handle two I2C sensors from Sensirion,
SHT21with ±0.3C and ±2%RH accuracy, for measuring
temperature and relative humidity. Data can be sent to cloud
using ESP2866, a cheap WiFi chip with full TCP/IP stack.
The program, written in C, is developed based on real
requirements from farmers. Apart from temperature and
humidity control, a plant might need a light during the night
or air flow from ventilation fans from time to time to get rid
of CO2. Hybrid control methods proposed in this work are
implemented including 1) loop time control 2) specific time Fig. 3. Controller GUI that shows (from left to right, top to buttom)
control 3) temperature hysteresis control 4) humidity temperature histeresis control, condition control, loop time control and
specific time control
hysteresis control and 5) conditional control.

439
The 18th International Symposium on Communications and Information Technologies (ISCIT 2018)

Fig. 4. System overview


Fig. 5. Example of function allocation

B. Cloud system As shown in Fig.5, the first stage runs the hysteresis
humidity control mode for 20 hours before changing to the
While the IoT hardware is up and running, there will be a
loop time control mode for 10 hours in the second stage. The
lot of data measured from sensors to be produced. It can be
third stage is set to be again the hysteresis humidity control
stored locally or sent to a cloud system through the internet.
mode for 150 hours. The conditional control and specific time
Data can be stored, processed and analyzed on the cloud.
control modes are in the forth and the fifth stages respectively.
IoT cloud systems called Xively and ThingSpeak are used
The hardware is programmed to read information from
in this work. The former is a platform owned by Google. The
sensors and make decision locally to control the system
latter is an open source IoT application which integrates with
actuator every defined time interval. The values of reading
MATLAB software allowing users can analyze and visualize
temperature and humidity are also sent to the cloud for
uploaded data. Normally cloud systems provide API
monitoring and analyzing in the future.
(Application Programming Interface) functions to store and
retrieve data from the things using the HTTP protocol. To
exploit the cloud services, users have to register to get Channel IV. TEST AND RESULTS
ID and API key for writing and reading data. The hardware This section presents results of running system. First
writes data to the cloud using the writing API key. demonstrate graph monitoring retrieve from the cloud, called
ThingSpeak. Users can login to the system via web browsers
C. Clients and display recorded values in time domain. Values can be
Clients can monitor data in real-time or display historical raw, median or average values, as shown in Fig. 6.
data records via PCs or mobile phones that will be shown in Additionally, it can be exported in Excel files also analyzed
the next section. using MATLAB. Fig. 7 shows applications for monitoring via
android mobiles.
The remote loads can be controlled by clients thru the
could service. However, there must be some feedback The system is implemented and run in a mushroom
information, i.e. from current sensors at loads or relays, to (Oyster Mushroom) greenhouse. Xively is exploited as a
make sure that a controlled load is actually turned on or off. cloud service. Actuators include sprinklers and exhaust fans
Since a command is delivered thru multiple routes in the for humidity and temperature controlling. The room size is
internet and might be lost, this can cause fault controls. This around 12 square meters and 1-day results of no control and
feature must be well designed and integrated in future. controlled plant are compared and shown in Fig. 8a) and Fig.
8b) respectively. As can be seen, temperature and humidity of
D. System control setup: The example no control plant is fluctuated during the day. Temperature is
rising high during the afternoon while humidity is decreasing.
The system hardware, sensors, internet gateway and the
cloud system are brought together to be the IoT-based control
platform for precision farming. Each output control port
connected to an actuator can be set in different types of control
modes. For any output port, it could be set to be one of the 5
function types including 1) the loop time control, 2) the
specific time control, 3) the hysteresis temperature control, 4)
the hysteresis humidity control, and 5) the conditional control.
It can run either for some periods of time or infinitely.
To be versatile or extend platform capability, each control
port can also change its function modes after working for a
while. It can be set to work in 5 consecutive stages. Each stage
can run maximally for 1000 hours. Hence the number of
possible control patterns from the system, that includes 5
control modes, 5 stages and 8 output ports, equals ͷ ൈ ͷ ൈ
ͷ ൈ ͷ ൈ ͷ ൈ ͺ ൌ ʹͷǡͲͲͲǤ
Fig. 6. Temperature and Humidity monitoring in ThingSpeak

440
The 18th International Symposium on Communications and Information Technologies (ISCIT 2018)

a) Without control process (1 day)

Fig. 7. Monitoring in Mobile application

The plant with the control process, where the humidity


setpoints are 80% and 90%, and temperature setpoints are 26
and 30 degrees, can maintain the temperature and humidity in
the ranges. Hence the graph in Fig. 8b) is quite flatten. For a
closer look in Fig. 8c), it is similar to Fig.2. The system turns
on and off sprinkler to control humidity in hysteresis control
mode from time to time. To control the temperature, this b) With control process (1 day)
system uses fans or blowers. In fact, there is a mutual
relationship between values of temperature and humidity. We
cannot control one of them solely. For example, water can be
used to increase humidity and decrease temperature at the
same time as we can see a fluctuation of both values.
This control system can be applied for other types of
mushroom such as Cordyceps Militaries, Abalone. It can be
implemented in precision farming for poultry or bird net
which also required temperature and humidity controls.
Actuators might be air conditioners, evaporative cooling
systems, fan inlets and outlets, LED lightings, high pressure
sprinklers.
c) With control process (6 hours zoom-in)
V. CONCLUSIONS
Fig. 8. Temperature and Humidity Result Comparisons
This paper presents the versatile controller developed to
regulate temperature and relative humidity in precision
agriculture. Varieties of control methods are available for use, REFERENCES
including timer, hysteresis control and condition control. They [1] O. Elijah, T. A. Rahman, I. Orikumhi, et al, “An Overview of Internet
can be arranged in different sequences. Each sequence of Things (IoT) and Data Analytics in Agriculture: Benefits and
contains five control stages working in different periods of Challenges,” IEEE Internet of Things Journal, (Early Access), 2018
time. There exist eight control ports connected to actuators. [2] Prathibha S R, Anupama Hongal, Jyothi M P, “IoT Based Monitoring
System in Smart Agriculture,” IEEE International Conference On
The local hardware processor make decision to turn on or off Recent Trends In Electronics Information Communication
actuators depending on the running control mode and data Technology, May, 2017, pp.81-84.
from sensors. Measured data are, at the same time, sent to the [3] K. A. Patil, N. R. Kale, “A Model for Smart Agriculture Using IoT,”
cloud service via internet gateway wirelessly. Clients can International Conference on Global Trends in Signal Processing,
monitor values in real-time on PC or mobile application. Information Computing and Communication, 2016, pp.543-545.
Results from real implementation are shown that temperature [4] M. Thumma, W. Wiboonjaroen, T. Sooknuan, “The Implementation of
and humidity in a greenhouse can be regulated to get suitable PI Controller for Evaporative Cooling System in Controlled
environment for productive farming. Environment Greenhouse,” International Conference on Control,
Automation and Systems (ICCAS), 2017, pp.852-855.
[5] R. B. ALi, E. Aridhi, M. Abbes, et al, “Fuzzy Logic Controller of
temperature and humidity inside an agricultural greenhouse,”
International Renewable Energy Congress (IREC), 2016, pp.1-6.
[6] H.A. Soto, E.R. Lozano, O.B. Hernandez, “Design and simulation of a
discrete time controller for regulating temperature in a scale
greenhouse,” International Congress of Engineering Mechatronics and
Automation (CIIMA), 2014, pp.1-4.

441

You might also like