An IoT-Based Model for Monitoring Plant Growth in Greenhouses

The unstable climatic conditions are promoting the adoption of smart agriculture. The introduction of IoT technology in the cultivation process allows for the monitoring and control of plant growth through automation. While the traditional greenhouse system is already an upgrade to the traditional cultivation system, it still has room for improvement with the integration of technology. The traditional greenhouse system requires close monitoring of growth rates through manual intervention and can be prone to various hazards. Incorrect interpretations of plant requirements can result in wrong interventions that may severely affect plant growth. It is imperative to have accurate data to maintain the health of plants throughout the cultivation process. IoT plays a predominant role in providing accurate data for constant monitoring of plant growth. The aim of this paper is to present a fully functional greenhouse automation model using microcontrollers, sensors, fans, pumps, and appropriate networking routing technology capable of providing instant data for proper monitoring of plant growth. The presented model includes safety features and can issue alerts in case security measures are breached. The system may even allow users to perform remote monitoring using a web application. Therefore, the proposed model will contribute to enhancing the horticultural industry by increasing output and reducing the need for human intervention.


INTRODUCTION
Plant growth is affected by atmospheric and environmental conditions. Farmers working in greenhouses are unable to properly monitor the humidity level inside the greenhouse [1]. They cannot determine what is happening inside the greenhouse simply by touch or feel. Their day-to-day operations are primarily based on their experiences. If the weather is too dry, they will water the plants, but if it is too wet, they will open the roof of the greenhouse, especially during the day [2]. It is crucial to improve the accuracy of greenhouse crop production in order to achieve optimal growth, higher plant yield at lower costs, good quality, and minimal environmental impact [3]. The use of IoT to control the greenhouse provides great assistance in managing cooling, heating, soil moisture, and other features. Additionally, an IoT-based greenhouse can be controlled from anywhere, while also monitoring environmental elements such as temperature and humidity [4]. These greenhouse environmental conditions can be manually managed by an individual.
Automation is useful for streamlining tasks and reducing the need for manual chores, such as turning switches on/off. However, human errors cannot be completely eliminated or reduced by automation, although they can be minimized to some extent [5]. In a modern environment, everything must be realistically or remotely managed. Furthermore, assuming that greenhouse owners can track and manage their greenhouse from any location, they are not required to physically inspect the conditions regularly. Users should be able to conveniently regulate and manage multiple greenhouses from a single location. The WiFi module and NodeMCU are crucial for transmitting data to the smart system as they eliminate the need for cables or wired connections, thus reducing costs [6].
The incorporation of smart machines, actuators, sensors, unmanned aerial systems, radio frequency identification (RFID) devices, big data analytics, artificial intelligence, and satellites has facilitated the widespread use of IoT in various agricultural applications, including smart agriculture, frost prevention, and intelligent emergency planning in greenhouses [7]. The introduction of highly effective communication systems has contributed to the widespread adoption of IoT in smart greenhouses and precision agriculture [8].
Traditional agriculture is characterized by the limited integration of database decision support systems, resulting in unnecessary human involvement, higher labor costs, and vulnerability to catastrophic weather events. IoT provides relief in addressing crop monitoring issues through artificial intelligence, energy and water conservation strategies based on machine learning, and automated agricultural operations. The farmers' inability to engage with IoT technology may be attributed to the lack of established parameters for energy and water allocation, energy consumption, and uncertainty regarding agricultural product selling prices due to fluctuating market prices [9]. Smallholder farmers have little incentive to invest in new technologies such as IoT due to narrow production margins, while large commercial producers can easily afford IoT equipment [10]. Despite the widespread use of IoT systems in smart greenhouses, there is a lack of understanding regarding how this technology could improve greenhouse settings, particularly in tropical climates with extreme temperature fluctuations.
The goal is, therefore, to develop a greenhouse system for plants using IoT, which will allow the monitoring and controlling of the temperature level, soil moisture, and other factors inside the greenhouse. The objective is to have an autonomous model capable of functioning with a minimum need for human intervention. The system will be able to regulate temperature and soil moisture through the use of sensors, microprocessors, and fans, enabling users to grow suitable plants at the appropriate time, while also minimizing the risk of incidents such as fire through the use of flame and smoke sensors.

LITERATURE REVIEW
Greenhouses provide control over the environment in which plants grow. They not only protect against bugs and birds but also allow for greater control over parameters such as temperature, humidity, watering, and light [11]. With a greenhouse, one can create the ideal conditions for plants to thrive without the need for harmful pesticides, ensuring the healthy quality of vegetables. If someone plans to become a commercial farmer using a greenhouse, they can accurately predict crop expectations and analyze crop growth variables with the help of technology [12].
The costs of setting up a greenhouse can quickly be converted into profits by implementing an appropriate growth plan that aligns with the production process. Like any commercial activity, investments must be made to create the right conditions for profitability. Investing in a nursery is the logical next step for those with a deep passion for planting and who want to earn extra money [13,14]. Traditional farming remains the primary source of food and agriculture for more than half of the world's population [15]. However, traditional farming practices present significant environmental challenges despite their role in cultural preservation. The world's current problems, including climate change, deforestation, water scarcity, and food insecurity, are partly attributed to traditional farming practices [16].
Most of the agricultural equipment used in traditional farming is outdated. In contrast, contemporary farming relies on machinery [17]. Modern farming practices incorporate the use of technology. While modern farming is characterized by high productivity, traditional farming is better suited to withstand an unpredictable environment. Traditional farming, although less productive, still yields sufficient quality for certain crops [18]. On the other hand, the excessive use of technology and its accompanying procedures and processes in modern agriculture may result in lower yields. Therefore, traditional farming continues to be recognized and utilized [19].
Another important difference between traditional agriculture and modern agriculture is the amount of labor required. Traditional agriculture provides Abdool Qaiyum Mohabuth, Devashish Nem | 539 numerous job opportunities as it involves significant manual work. In contrast, modern agriculture relies heavily on machines, reducing the need for human labor [20]. Consequently, the job opportunities available in modern agriculture are relatively limited. Modern agriculture incorporates various methods such as pesticides, plant breeding, agronomy, and the use of antibiotics and hormones in animal husbandry, which are not commonly used in traditional agriculture [21]. On the other hand, traditional agriculture heavily relies on domestic measures to protect against pests and insects [22]. This is a significant distinction between traditional agriculture and modern agriculture.
In modern agriculture, proper monitoring of temperature, humidity, and safety parameters is essential to ensure consistent plant growth. Different frameworks can be employed for this purpose. Temperature monitoring systems utilize various sensors to gather temperature data. As temperature sensors serve wideranging purposes, whether wired or wireless, farmers must carefully select the appropriate type of sensors to use. Wireless temperature sensors employ thermistors to precisely assess temperatures within a range of -20°C to +55°C with a 0.5°C resistance. Customization of remote nursery temperature monitoring allows farmers to set the frequency of readings and program alerts through email or SMS text messages. Humidity monitoring systems enhance productivity and prevent plant loss by detecting contamination caused by improper humidity levels in the greenhouse. Humidity sensors help farmers identify issues at an early stage and provide real-time monitoring thereafter. These sensors measure humidity within a range of 0% to 100%, with a ±3.5%RH resistance. Additionally, moisture-resistant and waterproof humidity sensors can be utilized both indoors and outdoors. Furthermore, automated monitoring systems and ventilation control gases to create a warm climate in the greenhouse. Early detection of fire incidents is crucial, and automatic alarms assist in detecting smoke in the greenhouse. In large greenhouses, where roof detectors are often positioned at high points, confined smoke spread poses difficulties. Some fire safety systems are placed both above and below shadow curtains, which is not feasible with traditional point detection systems. These systems are designed to prevent moisture and dust from affecting detection accuracy, ensuring high sensitivity and early detection under consistent and challenging conditions.

| An IoT-Based Model for Monitoring Plant Growth in Greenhouses
1) Data collection captures data from five different sensors, namely temperature, soil moisture, flame (for fire detection), Light Dependent Resistor (LDR) (for illumination control), Passive Infra-Red (PIR) (for movement detection), and smoke sensors. This data is then sent to a database via the Ethernet shield. 2) Data retrieval and display involves fetching the data collected by the sensors from the database and displaying it in real-time using Ajax, jQuery, and PHP. The aim is to achieve an accuracy of two to three times per second. Tables are generated to display the latest records of temperature, humidity, and moisture, which are constantly updated.

3) The plant information section categorizes plants and provides users with
guidance on which plants to grow during different times of the year, along with the preferred temperature and humidity levels. 4) Automation control of devices involves automating fans, water pumps, and LED light control devices. The water pumps are triggered on if the moisture level is lower than the set value, and they are triggered off if the moisture level is higher than the set value. For the fans, two conditions are set to trigger them: firstly, there should be no fire, and secondly, the fans are triggered off when the temperature is low. In case of a fire, fan control will be overridden, and the fans will be turned off.
The user can set all the threshold values. The LED light is triggered on and off based on a user-defined time range. It will be turned on only during the specified time range and turned off outside that range. Users need to log in to access the automation section. 5) Manual control of devices allows users to manually control all the devices using on-screen switches. All manual controls can override the automation of the system. The automation can only be activated if the manual control is switched off. Users need to log in to access the manual control section and interact with the system through a webbased application.
The proposed system follows a three-tier architecture, as shown in Figure 1, which includes the client tier, application tier, and database tier. The client tier is the front-end of the application, collecting user input through forms and displaying output. For web applications, browsers act as the front tier. The application tier lies between the client tier and the data tier, processing the information collected in the client tier. The database tier stores all the information processed by the application tier. Information is also retrieved from the database tier for display or for further processing in the client tier.
The user interacts with the system through a web application. Upon launching the dashboard (homepage), users can freely navigate to different sections. To access the automation and manual control sections, users will need to log in. The application utilizes AJAX HTTP GET or POST requests to interact with and Abdool Qaiyum Mohabuth, Devashish Nem | 541 manipulate the database through PHP services. The Arduino board consists of subcomponents that interact with the database in different ways. The sensors send real-time data to the database. For automation, the web application will modify the values in the control tables of the database, and then send a relay signal to turn the actuators on or off. The relay is necessary because devices such as fans and pumps require 12V of power, which cannot be supplied by Arduino. This functionality is illustrated in the following deployment diagram.

Figure. 1. Architecture of the proposed system
The user interacts with the system through a web application. Upon launching dashboard (homepage) is displayed, where user can navigate to different sections freely. User will have to login to access the automate and manual control section. The application uses AJAX http GET or POST request to interact and manipulate database by using php services. The Arduino board has subcomponents which interact with the database differently. Sensors send real time data to database. For automation, web application will change database values for control tables which web application will send a relay signal to turn actuators on or off. Relay is necessary as devices such as fans and pumps require 12v of power which cannot be supplied by Arduino This is illustrated by the following deployment diagram. Generic information is provided regarding humidity to assist users who may not have knowledge about humidity and how to properly control it. Additionally, the system offers information about the ideal conditions for optimal plant growth. This includes details such as the best time of the year to cultivate specific plants, as well as the recommended temperature and humidity levels for achieving optimal growth. A sample of this information is shown in Figure 5. Plants are categorized into cool, warm, ornamental, and tropical seasons.

Figure. 5.
Information about growth based on seasonal period Furthermore, the system ensures automated control of the devices during user operation. The fan control allows the user to input the lowest and highest temperature values, which serve as thresholds. When the current temperature reaches the set threshold, the corresponding fan will turn on, and it will turn off when the current temperature falls below the user-defined value. This ensures that the temperature remains within a certain range. As a safety measure, the system checks for the absence of fire before executing the code to activate the fans.
For water pump control, the user selects from four categories (dry, normal, wet, and very wet), each with its lowest and highest threshold values. The corresponding water pump turns on when the current moisture level is below the lowest threshold and turns off when it exceeds the highest threshold. Similar to temperature control, the system ensures that soil moisture remains within the user-defined range. Light control is based on time, where the user sets a specific time range. The lights turn on when the current time falls within that range.
Regarding security features, the system includes motion detection during specified time ranges, triggering an alert if motion is detected. When the system is under manual control, the security system is deactivated, assuming the user is Abdool Qaiyum Mohabuth, Devashish Nem | 545 physically present near the greenhouse. However, the fire and smoke systems remain active in both manual and auto control modes, as they are essential safety features. In the event of a fire, all fans are turned off to prevent oxygen supply, and an alert is sent to the user. Similarly, when smoke is detected, an alert is sent.
Thorough testing of the system has been conducted to verify responses to changes in temperature and humidity. The system promptly responds by activating fans and pumps as required. Testing has also been carried out on light, motion, flame, and smoke sensors, with actual outputs matching the expected results. A sample test involved igniting a fire near the system, which caused the fans to turn off, and an immediate alert was sent to the user, as shown in Figure  6.

Figure. 6. Flame Detection Output
The system's automated control is exemplified through the fan control mechanism. Users can input temperature thresholds, and when the current temperature reaches the set threshold, the corresponding fan turns on or off accordingly. This allows for precise temperature regulation within the greenhouse. The safety measure of checking for fire absence before activating the fans demonstrates the system's consideration for potential hazards. Water pump control is another significant aspect, where users select moisture categories and corresponding threshold values. The system monitors soil moisture levels and activates or deactivates the water pump accordingly. This feature ensures that the soil moisture remains within the desired range, contributing to optimal plant growth. Light control operates based on user-defined time ranges. The system turns on the lights when the current time falls within the specified range. This functionality enables users to provide appropriate illumination to the greenhouse during specific periods, aligning with the needs of the plants. Security features include motion detection during specified time ranges, triggering alerts if motion is detected. This enhances the system's ability to identify potential intrusions or suspicious activities. While the security system is deactivated during manual control, the fire and smoke systems remain active to Thorough testing has been conducted to validate the system's performance in responding to changes in temperature and humidity. The system demonstrates prompt activation of fans and pumps as required, aligning with the expected outcomes. Additionally, tests have been performed on various sensors, such as light, motion, flame, and smoke, with actual outputs matching the expected results. A specific test involving igniting a fire near the system validates the system's ability to detect and respond to critical situations promptly. Overall, the article showcases a comprehensive system that provides automated control and security measures for effective greenhouse management. The discussed features contribute to maintaining optimal environmental conditions, ensuring safety, and offering real-time alerts to address potential risks. The emphasis on thorough testing demonstrates the system's reliability and performance under various scenarios, providing users with confidence in its functionality.

CONCLUSIONS
The model has been designed to be deployed in a real greenhouse automation system. The system is fully operational, utilizing the Arduino Mega microcontroller, which is capable of handling multiple sensors and devices with its analog and digital pins. All the sensors and devices used in the model can be replicated in a real-life environment by supplying 240V AC power to the components. It is important to note that although 240V AC was used in the model, adapters have been used to convert it to 5V DC and 12V DC. Care has been taken to ensure that the devices and sensors are not directly exposed to 240V power. Additionally, longer and stronger wires may be required in the actual greenhouse environment, depending on the location of the sensors and devices. The model aims to assist the horticulture industry in improving crop quality and optimizing cultivation throughout the year. The benefits of using this model for monitoring plant growth in greenhouses are numerous. Firstly, it allows for precise and accurate monitoring of the greenhouse environment, leading to better plant growth and higher yields. Secondly, it helps identify potential issues with the greenhouse environment before they escalate, enabling faster and more effective remediation. Finally, it enables greenhouse managers to make data-driven decisions by utilizing real-time environmental data, such as adjusting watering timing and frequency.
In the near future, a mobile application version of the system would be an interesting tool. Additionally, the system may be migrated to an online server to facilitate remote monitoring. Furthermore, more components and advanced devices can be integrated into the system to cater to additional facilities, such as