*2.3. Experimental Setup*

To evaluate the performance of the proposed lighting control approach in terms of plant growth, as well as electricity cost, two experiments were conducted inside of a research greenhouse for "Green Towers" lettuce in Athens, GA, USA. The experimental unit consisted of a group of 15 plants in 10 cm<sup>2</sup> pots on each bench. Those pots were filled with a soil-less substrate (80% peat: 20% perlite (*v*/*v*) (Fafard 1P; SunGro Horticulture, Agawam, MA, USA)). Plants were grown under two supplemental lighting treatments (the proposed method and a heuristic one) and were manually irrigated every two or three days with a nutrient solution containing 100 mg L−<sup>1</sup> N made with a water-soluble fertilizer (15N–2.2P–12.45K, Peters Excel 15–5–15 Cal-Mag Special; Everris NA Inc., Dublin, OH, USA).

We compared the lighting electricity cost of our proposed method to two supplemental lighting strategies: (1) baseline, which is also optimal and solves the optimization problem (2) assuming perfect prior knowledge of sunlight throughout the day; (2) heuristic, in which the goal was to supply enough supplemental light to reach a minimum PPFD, unless the PPFD from sunlight alone exceeded the threshold. Thus, by the end of photoperiod, the plants will have received enough supplemental light to reach a DPI greater than or equal to the suggested quantity. In this method, sunlight prediction and real-time electricity price are not taken into account. Since the assumption of perfect prior knowledge of sunlight is not realistic nor practical, only the heuristic method and the proposed method were implemented in the greenhouse to grow lettuce under those treatments and compare plant growth. However, the simulation results related to the electricity cost for the baseline method are provided and represent a theoretical optimal scenario.

Our control algorithms were implemented on the Raspberry Pi 3 Model B (a low-cost, small microprocessor) using the Python programming language. Raspberry Pi operates as a control hardware to decide on how much supplemental lighting the plants need based on the predicted sunlight. CVXPY, a domain-specific language (DSL) that enables solving convex optimization problems with the high-level features of Python [29,30], was used to calculate the optimal lighting (CVXPY is available at http://www.cvxpy.org, accessed on 1 January 2020).

To develop the Markov model for sunlight prediction, sunlight data collected from the NREL database [31] were taken as representative of the sunlight intensity outside our greenhouse. Often, 40–70% of the sunlight PPFD represents the PPFD measured at a leaf surface in a greenhouse because of the building materials of the greenhouse ceiling and the sunlight radiation angle [32]. For the development of the Markov model, we considered 40% as the light transmission rate since the greenhouse had an internal shade cloth, which was used to achieve low sunlight levels and facilitate lighting research. This model was used in both experiments to predict sunlight based on real-time PPFD measurements by a light sensor inside the greenhouse, underneath the shade cloth. These measurements represent the amount of sunlight that reached the plants. The parameters used in our optimization problem were similar to those considered in our prior study [25] and for the type of LEDs used in the experiments (given in Table 1).


**Table 1.** Model and optimization parameters used in this work.

To measure the sunlight PPFD over the plant canopy in the greenhouse, an analog full-spectrum quantum sensor (SQ-500-SS, Apogee instruments, Logan, UT, USA) with an improved spectral range of 389–692 nm ± 5 nm was used. SQ-500-SS is a self-powered PAR light sensor with a 0–40 mV output and calibration factor of 100 µmol m−<sup>2</sup> s <sup>−</sup><sup>1</sup> mV. Sunlight intensity was measured by the light sensor using a Python script every three minutes, then averaged to be representative of sunlight at each time step (15 min). Since the Raspberry Pi only reads digital inputs, the analog output of the sensor was converted to digital using ADS1115, which is a high-precision 16 bit ADC. ADS1115 uses the I2C communication protocol to read analog values; therefore, I2C should be enabled on the Raspberry Pi before interfacing.

The supplemental lighting source used in our setup was the GE ArizeTM element L1000 LED grow light bars with a 3:1 red-to-blue light ratio (HPPB4) and a power of 627 W. Several methods of controlling the output signal of LED drivers are available; the 0–10 V dimming approach was used for our purposes. In this method, there is a near-linear relationship between the dimming voltage of the LED driver and the output light of the LED. To control the output light of the LEDs, two GPIO pins of the Raspberry Pi (GPIO 13 and GPIO 18) were used to generate two pulse-width modulation (PWM) signals. One PWM signal controls the LEDs under the heuristic treatment, and the other one controls the LEDs under the prediction-based treatment. These PWM signals of the Raspberry Pi need to be amplified and filtered to become compatible with the dimming voltage of the LED driver; thus, a signal-conditioning circuit (using the TL081 operational amplifier (op-amp)) was designed to supply the proper signal to the LED drivers. Based on the calculated supplemental lighting strategy, the duty cycle of the PWM signals was determined by the Raspberry Pi and converted to the compatible dimming voltage (control signal) for LED drivers by the signal-conditioning circuit. At each time step (15 min), the control signals for the two treatments were adjusted, thereby changing the output light of the LEDs.

Every morning, the Raspberry Pi automatically runs the Python code, which reads real-time light sensor data, predicts future sunlight, solves the optimization problem, and calculates the supplemental lighting for both treatments at each time step (every 15 min) for a 16 h photoperiod. Once the photoperiod is over and plants receive sufficient light, the LEDs are turned off.

To monitor the plant growth and PCS for the two treatments, Arducam day–night vision cameras were installed above the benches. The camera was mounted facing downward above the crop. These cameras have an IR cut filter that switches automatically. The filter is on for daylight color accuracy and off for IR night vision. Therefore, the camera can take pictures at night in complete darkness using its small IR LEDs. Moreover, this camera is an inexpensive choice (less than USD 30) for monitoring plant growth. Each camera was connected to a Raspberry Pi, which was set to automatically take pictures every night when the LEDs were off, so that there would be no sunlight or LED light interfering with the plant images. Figure 1 shows the imaging setup.

**Figure 1.** Imaging setup built in the greenhouse.

We accessed the data related to supplemental lighting, sunlight, cost, and plant images through real-time remote monitoring of the Raspberry Pi using WPA2 and RealVNC software. Plant images were processed using PlantCV, which is an image analysis package for plant phenotyping [33] (PlantCV is available at https://plantcv.readthedocs.io/en/ stable/, accessed on 20 November 2020). The PCS was measured by using a reference with a known area and counting the number of detected leaf pixels.

Shown in Figure 2 is the experimental setup in the greenhouse. The light sensor was installed above the LED fixtures so that it was not affected by the LED light and was connected to the ADC. The ADC converts the analog measurements to digital, and hence, the Raspberry Pi can read them. After predicting sunlight and solving the optimization problem, the duty cycle of the PWM signals was determined and amplified. These control signals were connected to the dimming wires of the LED driver, thereby changing the output light of the LED. The camera was installed above the crops and connected to the Raspberry Pi through a ribbon cable. The materials used in the proposed setup are presented in Table 2.

**Figure 2.** Experimental setup in the greenhouse.

### **Table 2.** Main materials used in our experimental setup.


The first experiment ran from 11 December 2020 through 28 January 2021, when sunlight levels were low. The daily minimum temperature, max temperature, minimum vapor pressure deficit (VPD), and maximum VPD inside the greenhouse were 12.4 ± 3.4 °C, 22.4 ± 2.8 °C, 0.46 ± 0.15 kPa, and 1.81 ± 0.63 kPa (mean ± SD), respectively. The CO<sup>2</sup> level was at the ambient level; the average DLI from sunlight under the shade cloth was 2.22 ± 0.6 mol/m2d, and the daily amounts are provided in Figure 3. The setup in Figure 2 was installed, and three lettuce replicates for the heuristic method and three for the proposed optimal method with six LEDs were considered. Figure 4 depicts the greenhouse section in the first experiment. On each bench, 15 plants were grown as 1 experimental unit. This section of the greenhouse was surrounded by windows except for the west wall, where the cooling pad was. Therefore, the benches on the west side may received less sunlight late in the day. It is also possible that the temperatures may have been slightly lower on the west side due to the cooling pad. However, very little cooling was required in winter. Ambient light and temperature can affect plant growth, and the treatments were blocked to account for such effects. Further details are provided in the Results and Discussion Section. Plants were harvested 49 d after seeding, and the proposed method was evaluated in terms of both the electricity cost and plant growth.

**Figure 3.** DLI from sunlight under the shade cloth during the first experiment.

For the imaging part, only two cameras were installed above the two benches, one controlled by the heuristic method (Bench Number 8 in Figure 4) and the other one by the prediction-based method (Bench Number 7 in Figure 4). Thus, we used two Raspberry Pis in this experiment, one connected to a camera for taking pictures of one replicate of the heuristic method and another to take pictures of the plant under the predictionbased treatment and to control the output light of all six LED fixtures. During the first experiment, the photoperiod started at 4:30 a.m. and ended at 8:30 p.m. At 8:30 p.m., the LEDs turned off, and the camera automatically took images at 11:30 pm when there was no supplemental light in the greenhouse. We obtained a variable hourly electricity price profile from a website (https://www.ieso.ca/power-data, accessed 1 December 2019) and scaled the numbers to account for the U.S. electricity prices based on government rates. The electricity price profile considered in this experiment is given in Figure 5 and was the same throughout the study.

**Figure 4.** Experimental units in the greenhouse under two different lighting treatments in the first experiment. Plants on the pink benches were grown using the prediction-based lighting method, and those on the blue benches were grown using the heuristic method.

**Figure 5.** Variable electricity price in cents/kWh used in the first experiment.

**Remark 1.** *The units of f in* (1) *are cents*(*kWh*) <sup>−</sup><sup>1</sup> *µmol m*−<sup>2</sup> *s* −1 *; therefore, a conversion factor is needed to convert these units to cents*/*m*<sup>2</sup> *. Converting the PPFD of GE LEDs to kW m*−<sup>2</sup> *,* 2.9 *µmol J*−<sup>1</sup> *(or equivalently* 2.9 <sup>×</sup> <sup>10</sup><sup>3</sup> *<sup>µ</sup>mol* (*kW*) −1 *s* −1 *) was performed [34]. Assuming the length of each time step (*15 *min or* 0.25 *h), the conversion factor q is defined as:*

$$q = \frac{1}{2.9 \times 10^3} \times 0.25. \tag{3}$$

*Therefore, <sup>q</sup>* <sup>×</sup> *<sup>f</sup> represents the electricity cost of supplemental lighting with units of cents*/*m*<sup>2</sup> *.*

Other than the PCS, the leaf chlorophyll content index (CCI), anthocyanin content index (ACI), specific leaf area (SLA), and shoot dry weight were measured to compare plant growth for the two lighting approaches. The CCI and ACI were measured using chlorophyll and anthocyanin meters (CCM-200 plus and ACM-200 plus; Apogee Instruments, Logan, UT, USA) on the uppermost fully expanded leaves at two different times, once partway through the study and again near the end. Each time, 10 measurements on each experimental unit (group of 15 plants) were collected. The average value of these measurements was considered for each unit. A higher CCI can increase the light absorptance [35], and the anthocyanins in leaves have a protective role against intense light [35].

The SLA was calculated by dividing the leaf area of a plant by the shoot dry weight. For each experimental unit (15 plants), 3 plants were selected, and the total leaf area was measured using a leaf area meter (LI-3100 leaf area meter; LI-COR Biosciences, Lincoln, NE, USA). When drying the plants in the oven, these three plants were placed separately from the other plants. After drying them at 70 °C for 7 d, the shoot dry weight of each group of plants was also measured, thereby achieving the SLA per plant. Furthermore, dividing the total dry weight over the number of pots for each unit (15), we obtained the shoot dry weight per plant.

A paired t-test (two-tailed form) was performed for each growth parameter to determine if the two lighting methods had different results. In this test, each replicate was considered to be a pair, and the mean values for the two treatments were compared. If the *p*-value was less than the significance level (here, 0.05), the null hypothesis was rejected, which means there was a significant difference between the two methods.

The second experiment was conducted using the same crop species in the same place, from 2 April 2021 through 18 May 2021, when sunlight levels were higher than in the first experiment. The minimum temperature, max temperature, minimum vapor pressure deficit (VPD), and maximum VPD inside the greenhouse were 18.7 ± 1.5 °C, 25.8 ± 1.5 °C, 0.52 ± 0.21 kPa, and 1.86 ± 0.75 kPa (mean ± SD), respectively. The CO<sup>2</sup> level was at the ambient level; the average DLI from sunlight under the shade cloth was 7.45 <sup>±</sup> 3.11 mol/m2d, and the daily amounts are given in Figure 6. Not only were the sunlight levels much higher than in the first experiment, they were also more variable, thus increasing the potential benefits of an optimized lighting control approach.

**Figure 6.** DLI from sunlight under the shade cloth during the second experiment.

This time, we experimented on more replicates, i.e., five replicates for each treatment, which is represented in Figure 7. Plants were harvested 47 d after seeding. The same hardware setup was utilized for this experiment; however, the PCS was monitored for three replicates of each treatment using six Arducam cameras. The cameras were installed above Bench Numbers 1 and 2, 7 and 8, and 14 and 15 (see Figure 7). Moreover, the lighting control started at 5 am every day and ended at 9 pm. This change was made to ensure that the photoperiod fully encompassed the natural photoperiod. Another different factor compared to the first experiment was the use of a fixed electricity price (13.19 cents/kWh), rather than real-time pricing. Considering real-time pricing is advantageous to reduce the electricity cost of lighting. However, for the second experiment, we intended to use the electricity price available to our research greenhouse, which is fixed. Measurements of the growth parameters were repeated for the second experiment, and paired t-tests (two-tailed form) were performed to accept or reject the null hypothesis.

**Figure 7.** Experimental units in the greenhouse under two different lighting treatments in the second experiment. Pink color is an indicator of the prediction-based lighting method, while blue is for the heuristic method.
