You are on page 1of 6

2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), 9 November 2020, Shah Alam, Malaysia

Automatic Climate Control for Mushroom


Cultivation Using IoT Approach
Muhammad Azizi Mohd Ariffin, Muhammad Izzad Ramli, Mohd Nazrul Mohd Amin, Marina Ismail, Zarina Zainol,
Nor Diana Ahmad and Nursuriati Jamil
National Autism Resource Centre
Faculty of Computer and Mathematical Sciences, UiTM Shah Alam
Selangor, Malaysia
mazizi@tmsk.uitm.edu.my, izzad@tmsk.uitm.edu.my, nazrul@tmsk.uitm.edu.my, marina@tmsk.uitm.edu.my, zarina@tmsk.uitm.edu.my,
lizajamil@computer.org

Abstract—In Malaysia, most farmers only depend on among home residents, school and institution in Malaysia.
traditional agricultural practices. To improve the efficiency as Understanding the benefits of urban farming, the Malaysian
well as the productivity of their farms, modern agricultural government has allocated RM 10 Million through PENJANA
technology was proven to be better than traditional practices. program to encourage more Malaysians to get involved in
Internet of Things (IoT) is usually related in modern urban farming [4]. However, the current practice of urban
agriculture which provides the farmer with a real-time farming needs to be improved significantly so that it is easier
monitoring condition of their farm from anywhere and and more attractive for adoption by urban dwellers. For
anytime. Nowadays, oyster mushroom is one of the favorite example, current practice is tedious and time-consuming as a
plants to be cultivated among Malaysian farmers. However, it
farmer needs to manually water the plant and check its
is still overshadowed by the traditional cultivation approach,
growing conditions (e.g. temperature, humidity, light
which is costly, low productivity and more maintenance.
Therefore, this work aims to develop an automatic climate intensity). Moreover, urban dwellers cannot easily move
control system at a minimized cost, which can control the their plant setup in case they need to use the space for other
condition of the farm as well as optimize the resources. Our occasions. These limitations may cause urban farming less
proposed IoT-based design was tested in real environment at attractive to urban dwellers which has a busy and dynamic
NASOM Bandar Puteri Centre. Oyster mushroom requires an lifestyle.
optimum temperature ranging from 20 to 30°C and humidity Meanwhile, Internet-of-Things Technology (IoT) has the
from 70 to 80 percent. Two sensors were placed at the center
potential to act as a catalyst which can increase the yield and
and corner of the mushroom house to measure the temperature
and humidity which were transmitted to the remote
efficiency of urban farming especially indoor mushroom
monitoring station via a micro-controller unit for further cultivation [5]. The IoT can make urban farming easier by
action. The result conducted for six days showed that an automating the process of watering the plant and controlling
efficient automatic monitoring system, which can control the its growing environment. With the advent of cloud
farm’s house as well as minimized the resources and human computing, data from the sensors can be processed on the
efforts. cloud using machine learning for better analytics and smart
decision making. To add further value, the data can be
Keywords—IoT, Climate Control, Smart Farming, Industrial visualized so that users are able to remotely monitor and
Automation control their plant via a smartphone [6]. IoT components are
also small, lightweight and compact which makes it suitable
I. INTRODUCTION for implementing it to a startup or big scale project.
Climate change which occurs in the world today has
threatened food security globally and we need to rethink the II. RELATED WORK
way we grow food to avoid mass food shortage [1]. To make There are many plants that are suitable for urban farming.
matters worse, the recent Covid-19 pandemic has disrupted Mushroom is among the list of plants which is suitable for
the global food chain which has caused rising food price. urban farming as it takes up small space, doesn’t require
Malaysia is not exempted from this problem, with food direct sunlight and takes a shorter time to harvest. It is also
prices in Malaysia rose by 1.6 percent year-on-year in June sustainable and environmentally friendly as we can use
of 2020, following a 1.2 percent rise in a month earlier [2]. It agriculture waste (e.g. sawdust, husk) for its growing
was the highest food inflation since December 2019. To medium and organic fertilizer [7]. But mushroom cultivation
overcome food security is by crop improvement, efficient has specific growing conditions (temperature and humidity)
land management and increasing food yield [1]. We can to produce high yield, therefore we need an IoT system to aid
achieve that by encouraging urban farming among the the cultivation process. Temperature and humidity are the
Malaysian population. two parameters that need special attention to grow the
mushroom. The oyster mushroom does well in a climate with
Urban farming is seen as a sustainable practice with the
temperatures ranging between 22 to 28°C and humidity with
social, economic and urban environment benefits. It is
70 to 90 percent [8]. In this best condition, the oyster
currently seen as having important roles of curbing the
mushroom is able to produce higher quantity, quality and can
impact of rising food prices, reducing urban poverty and
maximize the harvesting cycle.
food insecurity, supplementing people’s income and easing
the financial burdens of urban dwellers [3]. Urban farming Conventionally, mushrooms are cultivated in an indoor
provides communities in the cities the opportunity to space depending on the condition of the natural environment.
maximize the usage of unused space by growing food. We Ttemperature and humidity are controlled by sprinkling the
can see that urban farming has increasing uptake trends water to the floor manually to ensure optimal growth. This

978-1-7281-9910-8/20/$31.00 ©2020 IEEE 123

Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on September 12,2021 at 08:30:42 UTC from IEEE Xplore. Restrictions apply.
2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), 9 November 2020, Shah Alam, Malaysia

idea is to reduce the temperature and increase humidity.


However, manual monitoring of the humidity and
temperature is cumbersome and time-consuming. To
overcome this limitation, researchers have introduced IoT in
the whole urban farming system where it can monitor and
control the temperature and humidity in the farm [9]. The
IoT devices are usually integrated with a decision support
system (DSS) in which rules are developed from the
collected data through the network.
Related work on IoT-based mushroom cultivation
conducted by [9] – [13] described the development of a
smart system to monitor the indoor environment of a
mushroom farm. In [9] and [10], an IoT system were used to
monitor air temperature, air humidity and soil moisture of Figure 1. Overall System Design Diagram
oyster mushroom cultivation in an indoor space. However,
The system was designed with several elements such as
only work in [9] tested the system in a real mushroom
the mushroom house, IoT control box, and Web Client
cultivation, while the authors in [10] used a simulation
interface. The mushroom house provided a controlled
model. A work done by [11], also considered temperature,
environment for mushroom cultivation and protection from
humidity, light intensity, and CO2 as the observable
external elements such as insects and pests. For protection,
parameters to cultivate shitake mushrooms. Even though the
the mushroom house wall was built with a fine mesh netting
implementation of these smart mushroom systems has
to keep pests outside while allowing free airflow. The
optimized the usage of resources and maximized the quality
mushroom house was equipped with a water pump to spray
and productivity of the mushroom, the additional parameters
the floor and outside netting with water to regulate
required complex hardware requirements and logical design
temperature and humidity level without indirectly wetting the
that increased the initial setup costs and maintenance costs.
mushroom to avoid it from spoilage. The water flowed
The research in [12] and [13] utilized machine learning to
through PVC pipes before spilling on the floor or the netting
monitor humidity and temperature in the cultivation of oyster
via a misting nozzle. Moreover, the mushroom house was
mushroom. The testing was simulated using MATLAB and
also equipped with an exhaust fan for regulating the
showed promising results. However, the high computation of
machine learning required a higher-end microprocessor and temperature and humidity.
data training which will increase resource requirements and The IoT control box contained the climate control
cost especially for large-scale farming. Therefore, this paper system, which automate the process of regulating the optimal
proposed an automatic IoT-based climate control system at climate for oyster mushroom cultivation. The operation of
minimal cost and was proven to work in the actual setting of both water pump and exhaust fan was controlled by the
oyster mushroom cultivation. system via the electrical relay. The system was also equipped
with sensors to obtain the current temperature and humidity
III. SYSTEM DESIGN inside the mushroom house. At least two sensors were
required positioned at the center ceiling of the mushroom
The design of the system is divided into three sections: house to ensure accurate and reliable reading. Moreover, the
mushroom cultivation parameters, climate control systems, system was connected to the Internet via an Internet gateway
and the web interface. using a Wi-Fi connection. The Internet gateway obtained
Internet connection from ISP either via ADSL, GPON, or
A. Mushroom Cultivation Parameters LTE connection. This allows the system to be remotely
The system is designed to automatically regulate the accessed from anywhere. Lastly, the system was also
oyster mushroom growing environment to its optimal designed with a web client interface to provide easy access to
parameters. The optimal growing condition for oyster the network using any mobile devices.
mushroom is in a climate with a temperature range of 20 –
30 °C and humidity in 70-80% [8], [11]. Furthermore, the B. Climate Control System
oyster mushrooms cannot be in contact with water, are prone The brain of the system is the climate control system
to micro bacterial infection and easily spoiled in a wet equipped with several components; the Climate Control
environment [14]. During the growing process, the System Schematic is shown in Figure 2. The system
mushroom also needs to be protected from insects and pests. processing capabilities are provided by Node MCU ESP8266
Based on these limitations, an automatic climate control [15]. It has a Tensilica 32-bit RISC CPU Xtensa LX106
system was proposed. The overall system design is shown in microcontroller, 128KB RAM, 4MB flash memory, and
Figure 1. running at 80 MHz clock speed. It was also equipped
ESP8266 SOC, which enabled the system to connect with IP
network using 802.11b/g/n Wi-Fi connection. Since the
microcontroller operating voltage is 3.3v and 80mA, it can
be powered using batteries and solar panels, but for this
work, the system was powered using a 5V 2A USB adapter
to minimize cost.

124

Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on September 12,2021 at 08:30:42 UTC from IEEE Xplore. Restrictions apply.
2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), 9 November 2020, Shah Alam, Malaysia

Figure 2. Climate Control System Schematic Diagram

An algorithm was fed into the microcontroller to process


the input data from sensors and control the water pump and
the exhaust fan using a relay. Since the Node MCU ESP8266
was compatible with the Arduino platform, the control
algorithm is implemented using the Arduino IDE. Further
description of the algorithm is found in Section IV. Internet
connectivity also enabled the algorithm of the system to be
updated remotely over the air (OTA). The DHT22 sensor
provided the system input in the form of temperature and
humidity value. DHT22 is an accurate sensor, works well in
tropical climate, and more importantly, it is cheap, which
makes it suitable for this work [16]. Figure 3. System Web Interface

The system controls the water pump and exhaust fan


which were running on AC power by using a 5V two- IV. SYSTEM OPERATIONS
channel relay. When the system algorithm executes a The climate control system took the sensor reading as
corrective action for environmental regulation, the inputs and processed them on the microcontroller based on
microcontroller triggered the relay via GPIO. The relay the pre-defined algorithm and take corrective action by
switched on or off the water pump and the exhaust fan based activating the relay output. The overall system operation is
on the trigger from the microcontroller. To ease the operation shown in the flowchart in Figure 4.
and maintenance, the system was also equipped with an LCD
display that was connected to the system via the Inter-
Integrated Circuit (I2C) Protocol. The LCD was able to
display the current system status, uptime, temperature and
humidity value.

C. Web Client Interface


The web client provides users or stockholders of
mushroom plantation with an interface that can be accessed
by any mobile devices installed with a web browser. Since
the system is connected to the Internet, any mobile device
which has access to the Internet either via Wi-Fi or LTE
connection was able to access the system using an IP
address. The web interface displayed the real-time value of
the temperature and humidity inside of the mushroom house,
and the system uptime. Figure 3 shows the system's web
interface.

125

Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on September 12,2021 at 08:30:42 UTC from IEEE Xplore. Restrictions apply.
2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), 9 November 2020, Shah Alam, Malaysia

operation. This ensured the minimal cost by not wasting


water and electricity resources while implementing
corrective action to reduce the temperature and humidity of
the mushroom house. Moreover, running parallel in the
system background is the IoT subsystem, which maintained
web server connection and display sensors data to the
external web client. The IoT subsystem also displayed the
current running program and system uptime to the web
client.

V. RESULTS AND DISCUSSION

A. System Implementation
Based on the proposed system design and operations, an
automatic Climate Control system using IoT was installed in
a community mushroom house which was located at
NASOM Bandar Puteri, Klang, Malaysia. Figure 5 – 9 show
the implementation on IoT system in the mushroom house.

Figure 4. Overall System Operation Flow Chart

Based on the flowchart in Figure 4, the system worked in


a loop until it was turned off. Initially, the system waited for
5 seconds before taking a reading from the temperature and
humidity sensor because DHT22 was only able to provide
reading after a time lapse [17]. As part of the error detection
mechanism, if an error occurred during the reading resulting
to a NULL value, the system retried until it succeeded. If the
sensor value is not NULL, the system calculated the average Figure 5. Mushroom bags in an Oyster Mushroom House.
temperature and humidity values from multiple sensors.
Based on the average values, the system executed one of the
following three sub-programs:
• Program 1 – If the average temperature exceeded the
threshold of 27 °C, the system turned on the water pump
and exhaust fan via relay for 20 seconds to cool down
the temperature of the mushroom house. Before the
program ends, program 1 counter was incremented to
keep track of how many times it was executed.
• Program 2 – If the humidity level of the mushroom
house environment exceeded 80% and program 1 was
not currently running, the system turned on the exhaust
fan via relay for 20 seconds. Before the program ends,
program 2 counter was incremented to keep track of
how many times it was executed.
• Program 3 – If the humidity level of the mushroom
house environment was less than 60% and program 1
Figure 6. IoT Control Unit
and 2 were not currently running, the system turned on
the water pump via relay for 20 seconds. Before the
program ends, program 3 counter was incremented to
keep track of how many times it was executed.
Before the system returned to the beginning of the loop,
it checked the number of times program 1, 2, and 3 was
executed. If it was executed more than three times, the
system entered a rest state for 2 hours before resuming its

126

Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on September 12,2021 at 08:30:42 UTC from IEEE Xplore. Restrictions apply.
2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), 9 November 2020, Shah Alam, Malaysia

respectively. The temperature and humidity readings were


taken three times daily, which were at 10.00 am, 12.00 noon
and 2.00 pm. Then the average was calculated. The graph in
Figure 10 indicates that the temperature average is lower
most of the day after implementing the Climate Control
system. Even though the reading of temperature average on
day 5 is a bit higher, nevertheless overall reading is still
lower. The same result appears in the humidity average
graph in Figure 11, whereby the humidity is higher after
implementing the Climate Control system. These results
proved that the Climate Control design concept can be
applied in maintaining and controlling the environment
requirement automatically for the implementation of a
mushroom house.

Figure 7. Exhaust Fan

Figure 10. Comparison Between the Temperature Average Before and After
Implementing the IOT

Figure 8. Water pump

Figure 11. Comparison Between the Humidity Average Before and


After Implementing the IOT.

VI. CONCLUSION
In this paper, we have designed and implemented an
automatic IoT-based Climate Control system for cultivating
oyster mushrooms in an indoor space. Even though there are
many similar climate control systems used in smart urban
farming, our proposed work is different as our design was
kept at a minimal cost in terms of hardware resources and
practicality. Furthermore, the proposed system was
implemented and tested in a real case study in the National
Figure 9. Mist spray for external net Autism Society of Malaysia (NASOM) center, Bandar
Puteri, The successful implementation of this system
improves the productivity of mushroom farming especially
B. Temperature and Humidity Control the labour needed in monitoring and maintaining the
To evaluate the effectiveness of the IoT system, we mushroom house environment requirement. The system is
captured the temperature and humidity inside the mushroom considered as a self-sustained system, whereby it can be
house before and after the implementation of the system. adopted by any “mushroom-preneur”.
Figure 10 and Figure 11 show the results related to the
average temperature and humidity monitored for 6 days,

127

Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on September 12,2021 at 08:30:42 UTC from IEEE Xplore. Restrictions apply.
2020 IEEE 10th International Conference on System Engineering and Technology (ICSET), 9 November 2020, Shah Alam, Malaysia

ACKNOWLEDGMENT an IoT system for monitoring and controlling temperature and


humidity in mushroom cultivation fields,” ICECOS 2019 - 3rd
The authors would like to express gratitude to the Int. Conf. Electr. Eng. Comput. Sci. Proceeding, pp. 326–331,
National Autism Resource Centre (NARC) and Faculty of 2019.
Computer and Mathematical Sciences, UiTM Shah Alam for [10] H. A. Wahab et al., “Investigation of temperature and humidity
providing grant (600-TNCPI/PBT 5/3 (017/2020)) to control system for mushroom house,” Int. J. Integr. Eng., vol. 11,
complete the research. no. 6, pp. 027–037, 2019.M. R. M. Kassim, I. Mat, and I. M.
Yusoff, “Applications of internet of things in mushroom farm
management,” Proc. Int. Conf. Sens. Technol. ICST, vol. 2019-
REFERENCES Decem, 2019.
[1] R. Anderson, P. E. Bayer, and D. Edwards, “Climate change and [11] Kassim, M. R. M., Mat, I., & Yusoff, I. M. (2019, December).
the need for agricultural adaptation,” Curr. Opin. Plant Biol., vol. Applications of Internet of Things in Mushroom Farm
56, pp. 197–202, 2020. Management. In 2019 13th International Conference on Sensing
Technology (ICST) (pp. 1-6). IEEE.
[2] “Malaysia Food Inflation | 2011-2020 Data | 2021-2022 Forecast |
Historical | Chart,” 2020. . [12] G. M. Fuady et al., “Extreme learning machine and back
propagation neural network comparison for temperature and
[3] N. Othman, R. A. Latip, M. H. Ariffin, and N. Mohamed, humidity control of oyster mushroom based on microcontroller,”
“Expectancy in Urban Farming Engagement,” Environ. Proc. J., 2017 Int. Symp. Electron. Smart Devices, ISESD 2017, vol.
vol. 2, no. 6, p. 335, 2017. 2018-Janua, no. 1, pp. 46–50, 2017, doi:
[4] E. Shamsudin, “PENJANA: Lebih ramai disasar ceburi pertanian 10.1109/ISESD.2017.8253303.
bandar,” 2020. [Online]. Available: [13] R. Y. Adhitya et al., “Comparison methods of Fuzzy Logic
https://www.bharian.com.my/berita/nasional/2020/06/700925/pe Control and Feed Forward Neural Network in automatic
njana-lebih-ramai- disasar-ceburi-pertanian-bandar. [Accessed: operating temperature and humidity control system (Oyster
12-Aug-2020]. Mushroom Farm House) using microcontroller,” 2016 Int. Symp.
[5] N. Mungai Bryan, K. Fei Thang, and T. Vinesh, “An Urban Electron. Smart Devices, ISESD 2016, pp. 168–173, 2017, doi:
Based Smart IOT Farming System,” IOP Conf. Ser. Earth 10.1109/ISESD.2016.7886713.
Environ. Sci., vol. 268, no. 1, 2019. [14] M. Hamidizade et al., “Bacterial brown pit, a new disease of
[6] C. Kerang, H. Lee, and H. Jung, “Task management system edible mushrooms caused by mycetocola sp.,” Plant Dis., vol.
according to changes in the situation based on IoT,” J. Inf. 104, no. 5, pp. 1445–1454, May 2020.
Process. Syst., vol. 13, no. 6, pp. 1459–1466, 2017. [15] Last Minute Engineers, “Insight Into ESP8266 NodeMCU
[7] M. Rosmiza, W. Davies, R. C. Aznie, M. Jabil, and M. Mazdi, Features & Using It With Arduino IDE,” 2019. .
“Prospects for Increasing Commercial Mushroom Production in [16] R. A. Koestoer, N. Pancasaputra, I. Roihan, and Harinaldi, “A
Malaysia: Challenges and Opportunities,” Mediterr. J. Soc. Sci., simple calibration methods of relative humidity sensor DHT22
no. March, 2016. for tropical climates based on Arduino data acquisition system,”
[8] P. Sihombing, T. P. Astuti, Herriyance, and D. Sitompul, in AIP Conference Proceedings, 2019, vol. 2062, p. 020009.
“Microcontroller based automatic temperature control for oyster [17] T. Liu, “Digital-output relative humidity & temperature
mushroom plants,” J. Phys. Conf. Ser., vol. 978, no. 1, 2018. sensor/module DHT22 (DHT22 also named as AM2302)
[9] T. H. Nasution, M. Yasir, Fahmi, and Soeharwinto, “Designing Capacitive-type humidity and temperature module/sensor.”

128

Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on September 12,2021 at 08:30:42 UTC from IEEE Xplore. Restrictions apply.

You might also like