Scientific Programming for Precision AgricultureView this Special Issue
Internet of Things-Based Smart Farming Monitoring System for Bolting Reduction in Onion Farms
According to the Pakistan Bureau of Statistics, Pakistan is amongst the top ten onion-producing countries in the world. Though in Pakistan, most of the districts of Khyber Pakhtunkhwa produce onions, Malakand division lonely contributes 60% of the total onion production of the country. In onion farming, bolting is an insidious phenomenon that occurs in onion plants due to fluctuations in environmental factors such as temperature, humidity, and light intensity. Due to bolting, the flowering stem of an onion plant is produced before the crop is harvested, resulting in a poor-quality harvest and yield. Therefore, from a farmer’s perspective, it is highly desirable to monitor and control the environmental factors to avoid bolting. In this paper, we propose and design a new prototype, namely, a smart farming monitoring system (SFMS) for bolting reduction, which is based on the generic three-layered IoT architecture. By using IoT (Internet of things) technology and careful remote monitoring, a more favorable environment can be provided to reduce and avoid onion bolting. To analyze the efficacy and performance of the proposed SFMS, a real test-bed implementation was carried out. The SFMS prototype was installed both in the open and in a greenhouse environment to monitor onion crops. Based on the data received via sensors, the percentage of onion bolting was recorded as 16.7% in the open environment while 3% in the closed environment. In the closed environment, optimal temperature, humidity, and light intensity were provided to the onion crops using the SFMS. For this reason, the percentage of onion bolting was reduced from 16.7% to 3%, consequently yielding better onion production. Moreover, the SFMS is a low-cost, easy-to-install solution that is developed with locally available hardware and resources, and we believe that this new solution can transform conventional onion farming into a more productive and convenient smart farming in the region.
The concept of the Internet of things (IoT), introduced by Kevin Ashton as a British technologist in 1999, has been proved to be one of the emerging technologies of recent times that have a slated effect on every industry and sector including the agriculture industry and farming . Technically, IoT is the idea of interacting with generic objects based on radio frequency identification (RFID) tags, IP addresses for smart objects (IPSO), and sensor/sensing technologies. Internet is an IPSO-based network, while things are generic objects that can be people, animals, household products, houses, offices, a laptop, or even a vehicle. The adoption rate of IoT technology is skyrocketing across the board, and nearly 43% of worldwide enterprises have employed IoT applications in one way or the other, and agriculture and farming have no exception. IoT-oriented farming or smart farming is now the future with promising applications and solutions which may include farm vehicle tracking, livestock monitoring, storage monitoring, crops/plants monitoring, and more. Smart farming promises greater efficiency, resources, and stock reduction, less human intervention, automation, data-driven processes, increased production, water conservation, real-time data and production insights and accurate farm and field evaluation, and many more.
1.1. High-Level Description
IoT-based smart farming/agriculture is highly effective compared to traditional approaches. IoT-based smart farming is a network typically designed with sensors (light, humidity, temperature, soil moisture, etc.) to monitor the crop field and automate farming activities. The farmers are able to track the conditions in the field from anywhere. The standard IoT technology architecture has three (03) layers, i.e., perception layer, transportation layer, and application layer, as indicated in Figure 1. The perception layer is the bottom layer of IoT, consisting of RFID tags, wireless sensor network (WSN) technology, and GPS technology, which collects information/data from objects/things. The transportation layer or network layer is responsible for communicating over the Internet or other network devices and servers. Finally, the application layer acts as an interface to provide different end-user services, such as data storage, data visualization, and analysis.
1.2. Onion Farming
Onion (Allium cepa L.) is a bulbous vegetable and a popular plant grown for its aromatic bulbs and leaves. It is one of the most valuable commodities widely used all over the world daily. Onion is native to Asia, and being a biennial vegetable, approximately 1.6 million tons of onions are produced annually in Pakistan, accounting for 2.5 percent of the global yield. Pakistan is ranked among the world’s top 8th onion-producing countries . Other districts of the Khyber Pakhtunkhwa province of Pakistan are also producing onion, while the Malakand division contributes 60% of the total onion production. Similarly, in Malakand Division, Swat and Dir districts are amongst the top ten onion-producing districts all over Pakistan . However, the farmers of these regions are less aware of the modern techniques (e.g., monitoring and tweaking of important environmental factors such as weather, humidity, temperature, soil moisture, and CO2) of farming, which greatly affect onion crop farming and production.
1.3. Onion Bolting
The main problem associated with onion is the bolting phenomenon, which occurs due to fluctuation in temperature, humidity, and photoperiod. Onion bolting is an environmental problem associated with the formation of the flower stalk in an onion crop as shown in Figure 2. Bolting is induced by plant hormones, and due to external environmental factors, the onion plant suffers stress; hence, bolting is a survival response. The plants under stress may respond by bolting so that they can produce seeds before they die. The optimal temperature for the occurrence of onion bolting ranges from 4°C to 10°C in winter or above 30°C in summer . During the starting few months of the growth of onion crops in winter, a high percentage of humidity can cause onions to bolt. While in the summer season, low humidity causes onions to bolt. Long photoperiod is the third environmental factor that causes the onion to bolt. Abnormal growing conditions make the onion think it is dying, and it sends up a flower so that it can reproduce . In bolted onions, the bulbs stop growing, and onions do not fully grow. Hence, they become unsuitable for consumption and market.
1.4. Objectives and Contributions
It is an intriguing area of active research that how smart farming techniques and IoT technology can be used to address the issue of onion bolting. Until recently, to the best of our ability, there were no IoT-based solutions found in the literature to address the issue of onion bolting monitoring and prevention, etc. Hence, there is a need for a technology-based smart farming and efficient monitoring system to reduce onion bolting. The contributions of this work are summarized as follows:(i)The design and development of a new IoT-based SFMS (smart farming monitoring system) prototype, based on the three-layer architecture of IoT for bolting reduction in onion farms.(ii)The proposed SFMS prototype is an indigenous, low-cost, and easy-to-install solution that is developed with locally available hardware and resources. We believe that it can transform conventional onion farming into more productive and convenient smart farming practices. This new system would help the farmer detect and identify the bolting phenomenon early and take preventive steps to stop bolting.(iii)The real test-bed implementation of SFMS prototype and its installation both in the open and in a greenhouse environment to monitor onion crops. Based on the data received from the sensors, the percentage of onion bolting was recorded 16.7% in the open environment. Similarly, the percentage of onion bolting was recorded as 3% in the closed environment. In the closed environment, optimal temperature, humidity, and photoperiod were provided to the onion crop. For this reason, the percentage of onion bolting was reduced from 16.7% to 3%, and resultantly the overall yield of the onion crop is increased.
The rest of the paper is structured as follows: Section 2 consists of an overview of the most related recent work. The design and development of the proposed SFMS are presented in Section 3. Section 4 addresses the implementation of SFMS for experimental tests in actual test-bed situations, while Section 5 presents the conclusion and future work.
2. Related Work
The most important process of agricultural production is real-time data collection. Real-time data can be temperature, humidity, CO2 contents, soil temperature, and moisture content. For this purpose, sensors are employed in the field of interest. These sensors sense the environment and provide data to a remote cloud-based server. The sensed data are sent to the gateway. The gateway carries out TCP/IP packaging of the data. Moreover, this acquired data are sent through the traditional network to a cloud server. In the field of agriculture, the monitoring system receives data, analyzes it, and takes certain actions based on the received data. Using servers or cell phones, the experts in the agriculture center can control the environmental parameters in real-time . Over the years, several designs and solutions have been proposed for smart agriculture based on IoT technology. We briefly review the body of related work that is available. To the best of our knowledge, in related work, there is no solution found which addresses the issue of onion bolting using IoT technology. However, IoT has been used in other related areas such as peach farming, smart irrigation, fungal detection, and apple vineyard monitoring. Each of these solutions has its specific characteristics, objectives, pros, and cons as discussed and analyzed below.
2.1. Precision Viticulture for Winegrowers in Europe
Orozco et al. proposed a system known as “an experimental evaluation of IoT technologies in precision viticulture.” They designed a monitoring system that consists of a wireless sensor network (WSN), UAVs (unmanned aerial vehicles), and a data processing and visualization engine. The goal was to develop a system to allow winegrowers/farmers to gain access to the data being collected, and then provide a user-friendly interface to carry out statistical analysis of the data. In a real environment, based on this data, the winegrower can take corrective actions in a vineyard. However, they do not address the issue that what are the optimal environmental conditions for the better growth of grapes and how to tweak them.
2.2. Smart Irrigation Using IoT
Khelifa et al. proposed a system named “smart irrigation using Internet of thing.” In this system, sensors continuously monitor the soil moisture, water tank level, and the water well level and then send these values through a ZigBee mesh network to a smart gateway. These data are then sent via a mobile data communication 4 G/LTE network to a web service that uses an intelligent software application to automatically analyze the data and act according to the obtained results, by selective activation of controllers as needed. Furthermore, the smart gateway also sends the received values (soil moisture values and water level values) via a mobile communication network (4G LTE) to a farmer. The farmer can check the soil moisture values and also water level in the tank and in the well with a smartphone application that connects directly to the smart gateway using HTTP or constrained application protocol (CoAP). Hence, the activation or deactivation of the electric water pump and opening and closing of solenoid valves can be controlled remotely by the farmer according to the specific needs. Contrary to the traditional irrigation system, this IoT-based system automates the irrigation process, which can save energy, water, and time. However, this system is based on simulation and has not been practically implemented.
2.3. Peach Frost Event Prediction Intelligent System
Brun-Lagun et al. designed and developed another interesting application based on IoT technology for smart farming. In this system, sensor nodes are deployed in the peach orchard. Sensors monitor the temperature and humidity of the peach orchard. Data from the sensors are sent to the SmartMesh IP manager (gateway). The SmartMesh IP manager is connected with the local computer using USB. Specialized application software known as Sensors Object Library (SOL) manager runs on the local computer. The SOL manager forwards data to the remote SOL server. The SOL server application allows users/farmers to visualize the sensors and measurements. “Sensor Object Library” (SOL) was developed to use a generic representation for the data produced by the mesh network. As the temperature drops and there is a chance of frost, a command is sent to the actuator to activate the stove. The stoves warm the environment of the peach orchard, and the inside frost is controlled because the frost event in the peach orchard prevents peach plants from producing flowers in large quantities, resulting in reducing the production of the peach fruit.
2.4. Fungal Detection System
Truong et al. designed a fungal disease prediction and management system based on IoT technology, which is capable of sending real-time data to cloud storage. Once the data are received, a machine learning algorithm is used to predict the environment for fungal detection and prevention. Based on the prediction, it can tell that in which condition fungi will attack the crop. Certain preventive measurements can then be taken to prevent the fungal attack on the crop. Fusarium head blight (a disease caused by fungi) and wheat rust are two dangerous plant diseases that affect different crops worldwide. The spores of this kind of fungal disease are greatly influenced by environmental parameters. The environmental data and environmental predictions provided by the IoT system will help the crop field managers and farmers by facilitating better management and prevention of fungal disease spread. This IoT system allows remote monitoring of the corps. However, they used specialized software and hardware, which may not be easily available.
3. The Proposed Smart Farming Monitoring System
In this section, we describe the architecture of our proposed IoT-based smart farming monitoring system (SFMS) for bolting reduction in onion farms. With the advancement of mobile and communication technologies, with the concepts of the Internet of things and with the power of cloud computing, it is possible to develop low-cost solutions and applications in smart farming. Our proposed SFMS system’s architecture is made up of sensors that collect data such as temperature, air humidity, and light intensity data. The raw data are transmitted through a gateway to a cloud platform for analysis. The farmer is then informed through e-mail or Short Messaging Service (SMS) or Mobile App to take any preventive measures accordingly. Perception, network, and application layers are the three generic architecture layers of IoT, as shown in Figure 3 . Real-world events are collected using various sensors, etc. at the perception layer, also known as the “sensing layer.” The network layer routes data over the Internet using Wi-Fi/Bluetooth, gateways, routing and switching operations, etc. The application layer directly interacts with the end-user. Each of these layers performs specific functions and tasks with their identified services .
Traditional farming is based on farmers’ experience only, and very little or no technology is used in traditional farming. There are no data analysis, prediction system, and information about the environmental parameters and their effects on the growth, health, and production of the onion crop. Our motivation is to fill the gap of the use of modern technological-based solutions for better cultivation and production of onion crops and onion bolting reduction. In addition, there is no indigenous technological solution for bolting reduction in onion farms. IoT-based farming can eradicate the drawbacks of traditional farming. IoT-based solutions can improve the quantity and quality of the onion crop, reduce onion bolting, and increase production.
3.1. System Design Overview of SFMS
The architecture of the proposed smart farming monitoring system (SFMS) is based on the abovementioned generic three-layer architecture of IoT, i.e., perception, network, and the application layer. Sensors have been deployed in the onion farm at the sensing layer of the architecture to capture various events occurring in the field. The captured data are then forwarded by the network layer to the remote cloud server where data are analyzed for making smart decisions, while data on the server-side are visualized at the application layer using the interface in real-time as illustrated in Figure 4 and explained further.(i)Tier 1: SFMS’s perception layer consists of three different types of sensor nodes to continuously monitor the environment, i.e., temperature, humidity, and light intensity sensors.(ii)Tier 2: data from the deployed sensors to the remote web-based cloud storage server; i.e., ThingSpeak is sent via the network layer of the SMFS. A Wi-Fi module acts as a gateway for sending the data.(iii)Tier 3: in Tier 3, at the application layer, a smartphone or PC/laptop has been used for accessing the stored data in the cloud server. An intelligent software application is used for visualizing the behavior in the observed data. This layer then generates an alarm message in case of any critical change that has such an effect on the environment that may result in the bolting of the crop.
3.2. System Model and Specifications of SFMS
In this section, we explain the system model and specification with the hardware components used to build the SFMS prototype.
3.2.1. Arduino Nano
It is a small-sized microcontroller that runs on the ATmega328 (Arduino Nano 3. X) platform, as shown in Figure 5 . It operates similar to Arduino Duemilanove (the Arduino Duemilanove (2009) is a microcontroller board) but has different packages. It uses a Mini B USB cable and has no standard USB port.
3.2.2. DHT11 Humidity Sensor
DHT11 is a basic, extremely low-cost digital temperature and air moisture sensor . It uses a capacitive humidity sensor and thermistor to measure the temperature.
3.2.3. Light-Dependent Resistor (LDR) Sensor and BMP180 Temperature Sensor
An LDR is a component that has a variable resistor that shows the presence and absence of the light Figure 6 . The BMP180 is a precision sensor that senses barometric pressure and temperature . It can also be used as an altimeter. BMP180 is easy to use, and it simply connects the VIN pin to the 5V voltage pin, GND to ground, SCL to I2C Clock (Analog 5), and SDA to I2C data pin (Analog 4).
Table 1 shows the technical specifications of the above sensors.
3.2.4. 8266 Wi-Fi Module
The ESP8266 Wi-Fi Module is a self-contained system on chip (SOC) with an integrated TCP/IP protocol stack that can give any microcontroller access to a Wi-Fi network as given in Figure 7 . These modules are mostly preprogrammed at the firmware level.
3.2.5. The Arduino IDE, the Sketches, and ThingSpeak IoT Analytics Platform
The Arduino Integrated Development Environment is specifically developed for programming Arduino applications. It was introduced by Arduino CC, primarily used to write, compile, and upload code into an Arduino device . It can be used to program almost all Arduino modules. It is an open-source tool and is readily available to install and upload the code on the go. This environment supports both C and C++ languages, and Arduino and Genuino hardware can be connected to upload programs. According to its developers, “ThingSpeak is an open-source IoT application and application programming interface (API) to store and retrieve data from things using the HTTP protocol over the Internet or via a Local Area Network. ThingSpeak enables the creation of sensor logging applications, location tracking applications, and a social network of things with status updates,” Figure 8.
3.2.6. Creation of a Channel in ThingSpeak
After the upload of the sketch, the last task in the implementation process is the creation of a channel in the ThingSpeak platform . Create an account in ThingSpeak. After that, log in to ThingSpeak using your account. After login by clicking on “My channel,” an interface opens. There is a green button named “New Channel.” Upon clicking the “Create channel” button another interface opens which helps in the whole process of the channel creation, as illustrated in Figure 9.
3.3. The Final SFMS Prototype
For the development of the final SFMS prototype, we have used the sensors as discussed above in Figure 10, and DHT11 sensor, BMP180 sensor, and the light-dependent resistor (LDR) sensor are connected with Arduino Nano Board. The ESP8266 Wi-Fi module is also connected with Arduino Nano, on a Printed Circuit Board. The sensors, Arduino Nano, and the ESP8266 are programmed through Arduino Integrated Development Environment (IDE). The Arduino IDE is installed on the computer. The computer is connected with the Arduino Nano board with the help of a USB (Universal Serial Bus) serial port. Through which, the sketch in the IDE is uploaded to the Arduino Nano. As the sketch uploads, the serial USB is removed. The sketch is developed using the Arduino IDE. The important things in the code are the SSID name of the access point, password of the access point, channel ID of ThingSpeak, and the IP address of ThingSpeak IoT web server. Through the access point, the sensors will communicate with the ThingSpeak platform.
4. Deployment of the SFMS in a Real Test-Bed Environment
For the evaluation, we tested the proposed SFMS prototype in a test-bed environment. An experimental setup has been employed in January 2019 by 1000 onion seedlings at the Herbarium and Botanical garden, University of Malakand. We used the Swat-1 seedling onion variety as it is the most common commercial variety grown in the Malakand region of KP. For a fair comparison, in these 1000 seedlings, we planted 500 onion plants inside the greenhouse area, while planted 500 plants in the open environment near the greenhouse. For each 500 onion plants, we deployed one SFMS prototype having the same setup and configuration, i.e., one in the greenhouse and the other in an open environment to track the environmental parameters such as temperature, humidity, and light intensity.
4.1. Greenhouse Environment
The design setup of choosing the greenhouse setting is justified because all over the world greenhouses are used for better crop growth and production. In the US, for example, the Nolen Greenhouses for Living Collections were opened in 2005 at the New York Botanical Garden. This 43,000 square foot (about 3,995 square meters) building has state-of-the-art climate-control capabilities such as open-roof ventilation, shade curtains, and radiant heat flooring . Similarly, the Komarov Botanical Institute’s Saint Petersburg Botanical Garden is Russia’s oldest botanical garden. The garden was designed during the years 1823–1824 with 28 greenhouses. Every greenhouse is made up of diverse plant species. Such greenhouses aim to increase the production of different species of plants. In fact, Kew Conservatory in England is one of the world’s most well-known greenhouses. Established in 1987 by Princess Diana and housing over 30,000 species of plants, the conservatory is planned to be energy efficient and employs some passive heating and cooling design techniques to balance each climate zone . Several other important benefits of the greenhouse environment are as follows:(i)Greenhouse conditions greatly improve the quality and crop yield; for example, it enables farmers to grow plants over a longer window of time.(ii)We have the ability to tweak the physical parameters (e.g., temperature and humidity) to the optimum degree in the greenhouse setting. A greenhouse environment allows greater conditions for crop growth.(iii)Greenhouse condition increases the average lifespan of crops. When a crop supports in an open field for three months, it can live longer in the greenhouse and eventually produce more production.
4.2. The Overall Operation of the SFMS
The greenhouse and open environment SFMS system is composed of three sensors, namely, DHT11, BMP180, and light-dependent resistor (LDR). The deployed system is schematically shown in Figure 11. The operations of the SFMS system are described step by step as follows:(i)Step 1: sensors forward data to ESP8266, which is a Wi-Fi module. The sensors and the Wi-Fi module are attached to the Arduino Nano microcontroller.(ii)Step 2: the Wi-Fi module interacts wirelessly with the high-speed 4 G-enabled Wi-Fi access point.(iii)Step 3: the Wi-Fi access point uses 4 G technology to wirelessly forward data to a remote cloud server.(iv)Step 4: the data from the remote cloud server is accessed through the local access point using local computer/tablet/mobile. Then, using the ThingSpeak app, the data obtained from the sensors are visualized in real-time.(v)Step 5: if the temperature is below the threshold value range, a tweet/message is sent to the farmer as an alert and warning that bolting is happening.
That is how SFMS provides a convenient system to monitor the greenhouse 24/7 regularly, and further data can be analyzed and visualized conveniently.
4.2.1. Flowchart for the Operations of SFMS
The flowchart in Figure 12 specifies the overall operations of SFMS. When the conditions for bolting occur, the server will send a tweet to the farmer as an alert. Furthermore, when the conditions are normal the server will store the environmental parameters, i.e., the temperature, humidity, and light intensity. Similarly, with the storage of data on ThingSpeak cloud server, the environmental parameters are shown in real-time for visualization purposes. The real-time data are visualized in the form of graphs. The graphs show the current as well as the previous readings taken by the sensors after every 15 minutes of the time interval. The stored data can be downloaded in CSV format for further analysis using machine learning.
Algorithms identify the favorable conditions for the occurrence of bolting and the favorable conditions for the better growth of the onion crop.
Mathematical representation of the sensor readings on ThingSpeak server (TServer) as presented in the following equation:
In (1), n is the nth reading of the sensors, and means that the sensors carry the reading up to nth reading after every 15 minutes, where T, H, and L are temperature, humidity, and light intensity, respectively. Likewise, dTi/dt is temperature reading, dHi/dt is humidity, reading and dLi/dt is light intensity calculation after 15 minutes.
5. Analysis and Discussion
This section includes a discussion about the impact and comparison of environmental parameters such as temperature, humidity, and the presence/absence of light on the planted onions inside and outside the greenhouse. Potential issues with the current system used are also examined. Once the SFMS is in place, it continuously tracks the environmental parameters and submits data to the remote cloud server at 15-minute intervals.
5.1. Monitoring Period
We commence by studying the effect of various environmental parameters over a period of six months continuously using the SFMS for both inside and outside the environment. This period is typically the onion’s crop growth time. The installed system keeps track of ambient parameters continuously 27/7. However, data are collected internally after every 15 minutes and send to the remote cloud server. This means four readings will be sent to the server in one hour. The time interval of 15 minutes was chosen on our observations that after each 10- to 20-minute time interval, a noticeable fluctuation in temperature and other parameters is detected. Technically, from the botanical standpoint, onion bolting occurs in the winter season when the temperature ranges from 4°C to 10°C, while onion bolting occurs in the summer season when the temperature increases above 30°C, respectively, as presented in Table 2.
5.2. Instances of Data in Open Environment vs. Closed Environment
The measurements were taken at regular intervals using SFMS as explained above. With respect to temperature, we obtained 2388 total instances of temperature from the temperature sensor in a period of six months. These temperature records are those instances that were in the open environment within the range of 4–10°C or above 30°C; however, other insignificant instances were discarded. This means that the bolting condition occurred 2388 times in the open environment and 83 plants: that is, 16.7 percent were found to be bolted out of 500 plants. This bolting happened owing to the uncontrollable open environment. Moreover, data were also received after every 15-minute interval in the closed environment. During our experiment, in the greenhouse scenario, we received 200 instances of temperature. These instances were in the range of 4 to 10°C or above 30°C. As a result, the percentage of the bolting was estimated as 3% in the closed environment (greenhouse) as given in Table 3 and Figure 13.
Similarly, in the early growth period of onion crops, a high percentage of humidity is causing onion to bolt. Furthermore, the low humidity also causes the onion to bolt in the last months of the onion production. The temperature and humidity are inversely proportional to each other, i.e. lower the temperature higher will be the humidity, and vice versa. In our experiment, the percentage of humidity in the early period of the onion growth was recorded higher whereas recorded lower in the last period in the open environment. Therefore, as a result, the onion bolting was recorded 16.7% in the open environment. In the greenhouse when the temperature falls below the threshold value, the stove/heater is turned on consequently, the humidity is reduced, and in the summer season, the sprinklers and exhaust fans are turned on; as a result, the humidity inside the greenhouse is increased. Thus, the percentage of the onion bolting is recorded as 3% in the greenhouse showing that in the controlled environment, the bolting phenomenon is prevented and avoided.
In addition, the third environmental parameter is the calculation of photoperiod from the data obtained from the LDR sensor in the SFMS prototype. The LDR sensor indicates the presence of light as 95 k and the absence of light as 94 k from the recorded data. Thus, when the light falls on the LDR sensor at the beginning of the day, it shows the value of 95 k, and likewise, when the light dims and disappears in the evening, it shows the value 94 k. The time elapsed between sunrise and sunset is defined as photoperiod and is calculated based on data received from the LDR sensor; that is, the elapsed time between 95 k and 94 k is calculated as photoperiod. Various research findings have shown that photoperiod is directly proportional to the bolting of onions as shown in Table 4. This implies that the greater the photoperiod, the greater will be the risk and chance of onion bolting. In our experiment, the percentage of onion bolting is recorded 16.7% in the open environment, which is because the average photoperiod is longer which causes the onion to bolt earlier. In the greenhouse closed environment, the photoperiod in the entire period of growth is kept moderate, i.e., 8–12 hours. As a result, less percentage of onion is bolted in the greenhouse, i.e., 3%. The overall scenario and outcomes are shown.
5.3. Rear-Time Visualization of Data
To achieve the above objectives, two sets of IoT-based SFMS prototypes were deployed, one in the open environment and the other in the greenhouse closed environment. The built-in sensors in the prototype are continuously transmitted (every 15 minutes) to the ThingSpeak remote cloud server. On the ThingSpeak cloud server, the environmental parameters such as temperature, humidity, and the presence/absence of light, received from the sensors, are displayed in the form of graphs for better analysis and interpretation as seen in Figure 14(a) which depicts the instances of temperature in the form of a graph received from the sensors in real-time. This graph shows the current and previous temperature values monitored in the greenhouse. Figure 14(b) displays humidity instances in the form of a diagram on the ThingSpeak cloud server in real-time. The graph shows the current as well as the previous greenhouse readings.
Figure 14(c) shows the presence of light as 95 k and the absence of light as 94 k.
As demonstrated graphically in the above figures, a farmer can monitor and track the temperature and humidity in real-time continuously. When the temperature drops in the range of 4–10°C, a farmer may immediately take proactive prevention measures to increase the internal temperature of the greenhouse (e.g., putting on the stove/heater) to keep it above the threshold values (10°C) so that the chances of onion bolting are avoided. Similarly, when the temperature reaches and rises above the threshold value, i.e., the exhaust fans and sprinklers are switched on to lower the temperature below 30°C. Likewise, humidity is reduced by increasing the inner temperature in winter. Previous research statistics have shown that the chances of onion bolting would be high when the humidity is high within the first two months of onion production. Similarly, low humidity in summer increases the chances of onion bolting. In the first example, for decreasing the percentage of humidity, the temperature is increased, thereby reducing the risk of onion bolting, while in the second case, the sprinklers and exhaust fans are turned on in summer to increase the humidity and consequently reduce the chances of onion bolting.
5.4. The SFMS Alarm System
The key idea in this paper is to use SFMS as a preventive measure to avoid onion bolting. For this purpose, a simple technique was employed. The proposed SFMS has an integrated alarm system to inform the farmer on time, in case he does not view the data in real-time. For example, if the temperature is within 4 to 10°C or above 30°C, our system will send a tweet to warn the farmer about the greenhouse conditions. Due to the regulation and security reasons of the Pakistan Telecommunication Authority (PTA), we were unable to use the GSM module to alarm the farmer via a text message; however, the alert message is sent in the form of a tweet as seen in Figure 15.
5.5. Data Analysis by Machine Learning Algorithm
Using the SFMS prototypes, valuable data obtained from onion crops are recorded and stored during monitoring. These data can be downloaded in CSV (Comma Separated Values-Excel Sheet) format and can be further analyzed with the support vector machine (SVM) algorithm of machine learning. The data set was visualized and analyzed in Weka3 for the data taken in a closed environment (greenhouse). From the values obtained, SVM divided the data set into two classes (i.e., the “normal data” and “chance of bolt-in”), and the regression techniques are applied to analyze the data set as illustrated in Figure 16. The graph between time and temperature is visualized, in which the red dots show the bolt and the blue dots show normal circumstances. It is therefore concluded that the temperature has a direct relationship with the occurrence of onion bolting, and if we can regulate and control the temperature, then we can avoid and prevent onion bolting using the proposed SFMS.
The major advantage of a machine learning algorithm in our experiments was to analyze the data set for monitored parameters, i.e., temperature, humidity, and light intensity. The analysis will help the farmers identify at which specific time of the season the temperature for onions remains normal and abnormal. For example, the instances of the temperature in blue color show normal conditions, i.e., the temperature lies in the range of 11–300C. Similarly, the instances of temperatures in red color show abnormal conditions; that is, the temperature is more favorable for the occurrence of onion bolting. The accuracy of the data set in our experiment over the six months is 95%. In addition, the graph has the advantage of identifying which time period is best suited for bolts to carry out preventive measures to prevent bolting conditions. From the machine learning analysis, it is concluded that at midnight, it is more likely to occur bolting in onion crops.
To simplify the scenario further, we took the fluctuation of the temperature for analysis within 24 hours starting from midnight. The graph in Figure 17 shows that the temperature below the red line (i.e., 10°C) is the favorable temperature for bolting occurrence, whereas the temperature above the red line is a normal condition and the chances of bolting are very low. The graph below shows that the favorable time for the occurrence of the bolting is midnight. This graph stipulates that the farmer should take preventive measures before midnight to avoid the possibility of bolting.
Similarly, the graph between time vs. humidity was drawn using the support vector machine (SVM), a machine learning algorithm as illustrated in Figure 18. In this figure, red dots show a percentage of humidity higher than 50 percent, which is a favorable level of humidity for the occurrence of bolting, while green dots show the percentage of humidity below 50 percent, which means that bolting rarely occurs. The use of the machine learning algorithm has the advantage of finding a correlation between time and humidity. The humidity is time-dependent, and the percentage of humidity at midday is high, which shows that in most cases, favorable humidity initiates the bolting phenomenon that occurs at midday. In addition, based on the study of the average humidity in the future, we can take preventive steps to minimize humidity and, as a result, reduce bolting graphically shown in Figure 18.
The phenomenon is further observed as illustrated in the graph in Figure 19 which shows the humidity level of the onion farm in 24 hours. The red line is at 50%, which means that this is the average percentage of humidity in the air.
Finally, the graph between temperatures with respect to time is shown in Figure 20. In the graph, the number of red points is less, which concludes that there is less chance of bolting occurrence in the greenhouse compared to the open environment. The benefit of using the machine learning algorithm is to compare the data of two environments and to analyze the instances of temperature in both environments. As the temperature instances are less than the open environment, it indicates that bolting in the closed environment should occur less. The analysis of the two environments supports our claim that bolting is reduced from 16.7% to 3% overall.
6. Conclusion and Future Work
The use of IoT technology in farming is commonly known as smart farming or smart agriculture. In smart farming automation, IoT collects data using sensors/RFIDs and processes the data using controllers, and completes the process of automation through actuators . Due to the conventional ways of farming and the lack of use of modern technology, Pakistan is not benefiting from the agriculture sector, the way it should be. Moreover, in recent years, due to the high demand and price hikes, essential food staples such as potatoes, onions, chilies, and tomatoes have gained economic importance. Due to these reasons, Pakistan imports agricultural products from other countries [19, 20]. In the Malakand Division area of Khyber Pakhtunkhwa Province of Pakistan, Swat and Dir districts are among the top ten onion-producing districts all over Pakistan .
However, due to fluctuations in environmental conditions in the onion field, farmers face a problem known as onion bolting or flowering. Low temperature and long photoperiod promote the initiation of flowers or bolting in onion crops. To address the above problem in onion farming, there is a need for technology-based smart farming and an efficient monitoring system to reduce onion bolting. The system should assist the farmer to early detect the bolting phenomenon and take preventive measures to avoid bolting, and consequently, onion production is increased. Therefore, the SFMS was developed to reduce the onion bolting and increase the production of the onion crop. This research work can be further extended to add a prediction module to the SFMS, the second module will be used for tweaking and adjusting the greenhouse, and lastly, the SFMS will be used in poultry farms.
The data collected during the data collection phase are available from the corresponding authors upon request.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
This study was supported by the National Key Research and Development Plan (no. 2016YFC0303700), National Natural Science Foundation of China (no. 61972414), Beijing Natural Science Foundation (no. 4202066), Beijing Nova Program (no. Z201100006820082), and Fundamental Research Funds for Central Universities (nos. 2462020YJRC001 and 2462018YJRC040).
D. Miorandi, S. Sicari, F. D. Pellegrini, and I. Chlamtac, “Internet of things: vision, applications and research challenges,” Ad hoc networks, vol. 10, no. 7, pp. 1497–1516, 2012.View at: Google Scholar
K. Ammit, “Collection of screw tag sensor data for the microsoft azure cloud service,” 2020, https://www.google.com/searchen-pk%26tbs=simg:caqspwijbkpfqx4slrgamwilelc.View at: Google Scholar
Z. Haq, M. Ishaq, A. Farooq, K. Saddozai, N. Yaqoob, and A. Shah, “Effect of farmers’characteristics on onion yield,” Sarhad Journal of Agriculture, vol. 25, no. 4, pp. 523–528, 2009.View at: Google Scholar
F. Plaza, “World's top 8 onion producing countries,” 2020, https://www.freshplaza.com/article/2002-828/worldstop8-onion-producingcountries.View at: Google Scholar
M. K. Khokhar, “Growing onion in paki- stan,” 2020, https://www.linkedin.com/pulse/-growinghttps://www.linkedin.com/pulse/growing-onion-pakistan-dr-khalid-mahmud-khokharonionpakistan-dr-khalid-mahmudkho-khar.View at: Google Scholar
K. M. Khokhar, “Flowering and seed development in onion—a review,” Open Access Library Journal, vol. 1, no. 07, 2014.View at: Google Scholar
T. Jeanie, “The onion patch,” 2019, http://archive.constantcontact.com/fs100/1101447499422/archiv-e/1114773113656.html.View at: Google Scholar
J. Muangprathub, N. Boonnam, K. Siriwan, L. Narongsak, W. Apirat, and P. Nillaor, “IoT and agriculture data analysis for smart farm,” Computers and Electronics in Agriculture, vol. 156, pp. 467–474, 2019.View at: Google Scholar
P. Ray, “A survey on Internet of Things architectures,” Journal of King Saud University-Computer and Informa-tion Sciences, vol. 30, no. 3, pp. 291–319, 2018.View at: Google Scholar
R. Digital, “DHT11 datasheet humidity & temperature sensor,” 2019, https://dataheet4u.com-/datashetpdf/dhttps://datasheet4u.com/datasheet-pdf/D-Robotics/DHT11/pdf.php?id=785590/Robotics/DHT11/pdf.php?id=785590/.View at: Google Scholar
H. Swagatam, “LDR circuits and working principle,” 2019, https://www.homemade-circuits.com/ldr-circuits-and-working-principle/circuits-and-working-principle/.View at: Google Scholar
E. Power, “BMP180 atmospheric pressure sensor,” 2019, https://components101.co-m/sensors/bmp180atmospheric-pressure-sensor/.View at: Google Scholar
I. Baker, “Ten amazing glass greenhouses from around the world,” 2018, https://desinstyle/-design/tenamazingglasshttps://concreteplayground.com/auckland/design-style/design/ten-amazing-glass-greenhouses-from-around-the-worldgreenhousesfroma-roundtheworld.View at: Google Scholar
B. Imogen, “Ten amazing glasshouses around- the world,” 2020, https://concreteplayground.-com/Auckland/designstyle/design/tenamaingglasshttps://concreteplayground.com/auckland/design-style/design/ten-amazing-glass-greenhouses-from-around-the-worldgreenhouses-from-around-the-world.View at: Google Scholar
S. Pakistan, “Agriculture statistics,” 2020, http://www.pbs.gov.pk/content/agriculture-statistics.View at: Google Scholar
L. Khurshid, M. Z. Khan, U. Pervaiz, A. Khan, and A. Nawaz, “Role of agricultural extension agents in the transfer of onion production technology in district Swa-t,” International Journal of Agricultural and Environmental Research, vol. 3, no. 1, pp. 158–164, 2017.View at: Google Scholar
H. Sher and M. E. Barkworth, “Economic development through medicinal and aromatic plants (MAPs) cultivation in Hindu Kush Himalaya mountains of District Swat, Pakistan,” Journal of Mountain Science, vol. 12, no. 5, pp. 1292–1301, 2015.View at: Google Scholar