**1. Introduction**

The global population is predicted to grow to around 9.15 billion by 2050, which will increase the amount of food that needs to be produced [1]. Furthermore, the limitations of natural resources and productive land, as well as climate constraints raise concerns about food security. The rising demand for food has attracted researchers' attention towards the application of Internet of Things (IoT) technology in agriculture. The IoT is a network of physical objects that transfer data to other devices over the Internet [2]. Applying the IoT in controlled environment agriculture (CEA) has reduced human effort, time, and cost and resulted in yield improvements [3]. The IoT integrates several technologies such as wireless sensor networks (WSNs), radio-frequency identification (RFID), cloud and edge computing, and human–computer interaction (HCI) [4].

The application of the IoT in agriculture includes monitoring, control of agriculture machinery, tracking and tracing, precision agriculture, and greenhouse production [3]. Monitoring and acquiring data about some environmental factors in crop farming such as temperature, humidity, solar radiation, pest movement, and rainfall help to understand the patterns and maximize farm production [5]. Other than crop farming, monitoring the water quality, water level, and temperature levels in aquaponics is another application of the IoT [6]. Furthermore, factors to be monitored in forestry [7] and livestock [8] are other

**Citation:** Afzali, S.; Mosharafian, S.; van Iersel, M.W.; Mohammadpour Velni, J. Development and Implementation of an IoT-Enabled Optimal and Predictive Lighting Control Strategy in Greenhouses. *Plants* **2021**, *10*, 2652. https:// doi.org/10.3390/plants10122652

Academic Editors: Valeria Cavallaro and Rosario Muleo

Received: 1 November 2021 Accepted: 27 November 2021 Published: 2 December 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

applications of the IoT in agriculture. Although some strategies have been developed in the area of monitoring, developing cost-effective methods is still an open area [3]. Both manned and autonomous vehicles (such as unmanned aerial vehicles (UAVs)) can collect useful data for farmers; they can also be remotely controlled through the IoT system [9]. Applying the IoT in tracking and tracing can improve agricultural companies' supply chain. Tracking is related to capturing, collecting, and storing data along the supply chain from upstream to downstream, while tracing enables distinguishing the product from downstream to upstream [10].

Another application of the IoT is in precision agriculture, that is a management strategy that collects real-time data such as crop maturity, weather, air quality, etc., and then analyzing the data to improve crop yields and reduce cost [11]. IoT technology could be employed in greenhouses to maximize profit, reduce cost and labor, and save energy. Several studies have considered applying WSNs in greenhouses for monitoring [12–14]. In this study, we focus on the application of IoT technology in greenhouse production.

Supplemental lighting improves plant growth and contributes to higher yields in CEA, in particular greenhouses. During rainy days or winter months, the overall amount of sunlight that plants receive might not be sufficient for plant growth and development. Therefore, supplemental lighting is often necessary for greenhouse fruit and vegetable production. However, the electricity needed for greenhouse supplemental lighting amounts to about 30% of the operating costs [15]. As a result, enhancing the cost effectiveness of lighting with modern technologies plays an important role in the CEA industry.

Among various lighting types, light-emitting diodes (LEDs) have proven to be more effective, due to their dimming capability, which enables changing the intensity of the output light to any continuous level [16]. On the other hand, the output light of highintensity discharge (HID) lamps only takes some quantized levels, thereby not considered as the primary choice for optimal lighting strategies. Researchers have proposed rulebased supplemental lighting control methods since 1994; the authors in [17] developed a rule-based approach for HID lamps to reach a predefined light target within a specified photoperiod. Light and shade system implementation (LASSI) is another control method with an on/off control for HID lamps in combination with a sunlight prediction and movable shades to achieve a constant DLI [18]. Another version of LASSI improved the sunlight prediction, resulting in increasing the accuracy of lighting control [19].

In [20], the DynaLight system, an on/off control method for HID lamps, was developed. This system considers a leaf photosynthesis model, variable electricity pricing, and weather forecast to reduce electricity cost while reaching a minimum daily sum of photosynthesis. Nevertheless, the weather forecasts were provided twice daily at an hourly resolution [20], which is not precise enough for proper optimization. Another version of DynaLight for controlling HID lamps is called DynaLight IND, which is a multi-objective optimization platform for optimizing artificial lighting in greenhouses [21]. For DynaLight IND, an evolution strategy was proposed and compared with the original genetic algorithm (GA) in DynaLight. The simulation results showed that the new version improved the GA's evolution efficiency and increased the computation speed compared to the original DynaLight. However, other than simulations, there is a need to conduct practical experiments to validate the properties of DynaLight IND [21].

The adaptive lighting method [22] is another rule-based control approach that reduces cost by adjusting the duty cycle of LEDs to reach a specified threshold based on photosynthetic photon flux density (PPFD) levels. Two general approaches were taken in previous studies on supplemental lighting control with LEDs: either using real-time sunlight intensity measurements to supply fixed PPFD levels [23,24] or assuming prior information about sunlight intensity throughout the day [23]. Both of these perspectives are faulty since sunlight intensity throughout the day is unknown and using the current PPFD alone does not ensure reaching the daily light integral (DLI) or daily photosynthesis.

In our prior studies [25,26], we developed optimal supplemental lighting strategies for both LEDs and HID lamps in greenhouses, which significantly reduced the electricity cost. We formulated the supplemental lighting control problem as a constrained convex optimization problem, and we aimed at minimizing the electricity cost of supplemental lighting, while considering sunlight prediction, plant light needs, and variable electricity pricing in our model. This strategy used a Markov model to predict future sunlight intensities. The simulation studies showed that the proposed method could reduce electricity cost significantly [25]. To control the light intensity of HID lamps, we formulated a discrete constrained optimization problem, which was solved using the method of multipliers and a reinforcement learning (RL) algorithm, considering the Markov-based sunlight prediction [26]. Although we made sure to provide sufficient light for good crop growth as the constraint of the optimization problem, it is necessary to implement the method in the greenhouse and monitor plant growth through experimental studies.

In the present paper, we implemented our proposed lighting strategy for LEDs in a research greenhouse equipped with IoT technology. Lettuce was grown under two treatments with different lighting control strategies over two seasons with low and high natural light (winter and spring). To evaluate the proposed lighting control approach in terms of plant growth, we collected data related to growth during both experiments. The main contributions of this work are as follows: (1) We implemented an optimal supplemental lighting control strategy in a greenhouse equipped with IoT technology. (2) We evaluated the advantages of our proposed optimal lighting method based on not only the electricity cost, but also the plant growth through experimental studies.
