*Article* **Prototyping a Lighting Control System Using LabVIEW with Real-Time High Dynamic Range Images (HDRis) as the Luminance Sensor**

**Aris Budhiyanto \* and Yun-Shang Chiou**

Department of Architecture, National Taiwan University of Science and Technology, Taipei 106, Taiwan; ychiou@mail.ntust.edu.tw

**\*** Correspondence: aris.budhiyanto@gmail.com; Tel.: +866-986341427

**Abstract:** Lighting control systems (LCSs) play important roles in maintaining visual comfort and energy savings in buildings. This paper presents a prototype LCS using LabVIEW with real-time high dynamic range images and a digital multiplex controller to brighten lamps sequentially to provide visual comfort. The prototype is applied to a scaled classroom model with three schemes involving different activities and needs: writing and reading, requiring a uniform luminance of approximately 100 cd/m2, teaching using a whiteboard, requiring an illuminance of approximately 120 cd/m2 for the whiteboard and 60 cd/m<sup>2</sup> for the desks, and drawing and art activities focused on the center of the room, requiring an illuminance of approximately 100 cd/m<sup>2</sup> for the center area and 50 cd/m<sup>2</sup> for the background area. For each scheme, two conditions are presented: one in which the room is treated as a closed room without windows, and the one in which the room has a large window on one wall that enables daylight to penetrate the room. The prototype works well with both schemes and provides different combinations of lamp brightness levels, starting from 10% to 60%, based on the activities and required luminance, and can save around 73–82% of electricity. The presence of daylight does not always result in more energy savings, as the brightness contrast for visual comfort needs to be considered.

**Keywords:** lighting design; lighting control system; visual comfort; HDRi luminance analysis; LabVIEW; energy saving

#### **1. Introduction**

Lighting is an essential factor for indoor environmental quality since it is related to occupants' visual comfort. In terms of building energy consumption, approximately 30% is dedicated to lighting. Therefore, it is important to find a way to reduce energy consumption without sacrificing occupants' visual comfort [1]. To achieve that purpose, lighting control systems (LCSs) are implemented in buildings. Implementing an LCS not only provides visual comfort for the occupants, but also reduces energy consumption by 60% [2].

The LCS receives information from the sensors, which is then processed by control rules and algorithms to determine the actions of the lighting fixtures. Based on the sensors, there are three lighting control schemes commonly used in buildings: occupancy-based sensors, daylight-linked systems, and scheduling schemes. Occupancy-based sensors depend on movement detection using passive infrared (PIR) sensors, ultrasonic sensors, or radio frequency identification (RFID), while daylight availability (illuminance) measured by a photosensor is used in the daylight-linked system, and a fixed schedule is used to control the lights in the scheduling system [3]. LCSs may use several types of sensors to achieve optimal results. An intelligent LCS research has developed a combination of lux sensors to monitor light intensity and motion sensors to sense human presence connected with LabVIEW (Laboratory Virtual Instrument Engineering Workbench) programming to control light intensity [4]. Based on the actions of the lights, there are two light-control methods:

**Citation:** Budhiyanto, A.; Chiou, Y.-S. Prototyping a Lighting Control System Using LabVIEW with Real-Time High Dynamic Range Images (HDRis) as the Luminance Sensor. *Buildings* **2022**, *12*, 650. https://doi.org/10.3390/ buildings12050650

Academic Editor: Alessandro Cannavale

Received: 25 April 2022 Accepted: 9 May 2022 Published: 13 May 2022

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

**Copyright:** © 2022 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/).

129

switching and dimming methods. In the switching method, lights can be controlled to switch on or off, while in dimming, the system reduces or increases the light level and dims the lights.

There have been many studies on LCSs. Table 1 presents selected related research and techniques.


**Table 1.** Selected research and their techniques of LCSs.

Illuminance sensors are common sensors used in LCSs [5–9,11,12], and working plane illuminance is mostly used to indicate lighting quantity because it is easily measured. However, as placing the illuminance sensor on the working plane is not practical, most illuminance sensors are mounted on walls or ceilings instead of the working plane, which can affect their performance [3]. In addition to illuminance, luminance also needs to be taken into consideration for providing visual comfort [13], as it is related to the light received by the human eye and human visual perception of brightness [14]. Luminance distribution can be measured by a spot luminance meter, but it is not effective to measure individual spots continuously. Current technology uses digital cameras to measure the luminance of a scene, called the high dynamic range (HDR), which captures luminance ranges within a scene and calculates the luminance based on pixel values [10,14]. The digital camera offers advantages over the light sensor in that the digital camera can be mounted on walls or ceilings without affecting the quality and performance of the HDRi. The method of using a digital camera as a luminance meter using high-dynamic-range images (HDRis) has been used for shop window LCSs to maintain a constant contrast between the shop window interior and its surroundings. The control system varies the brightness level of the lamps based on the level of exterior light to maintain this contrast [10].

Common LCSs are programmed to brighten or dim lamps simultaneously based on illuminance or occupancy detection [9,11,12]. However, this method mostly provides a uniform brightness, and for some activities that require brightness contrast, brightening or dimming lamps simultaneously is not able to achieve the desired brightness contrast, resulting in visual discomfort. In comparison, the occupancy detection sensor usually

responds by turning on the lamps in a certain area where the occupants are detected and keeping the lamps in other areas turned off. This will lead to substantial brightness contrast in the room and cause visual discomfort [15,16]. In addition, the presence of daylight in the room should be considered in LCSs. Several LCSs are integrated with a blind/shade control system to block daylight. To fill this research gap, this study proposes an LCS based on HDRi for view sensing that uses dimmable LED lamps with various brightness levels as a solution. The lamps can be controlled to brighten in sequence in response to brightness contrast or daylight, so their brightness levels are varied.

The objective of this study is to develop a prototype of an LCS consisting of several dimmable LED lamps and a 360◦ internet protocol (IP) camera that serves as a viewing sensor for maintaining the visual comfort of the task area for various activities by brightening the lamps in sequence based on the activities and lighting needs. The 360◦ IP camera is used as a luminance sensor to produce HDRis and measure luminance. The LCS is developed based on HDRis for a room used for three activities, each requiring a different luminance. Different from the research conducted by [10], which focused only on the given contrast values of indoor and exterior environments without considering the various activities occurring there, this LCS is designed to provide visual comfort by maintaining the indoor luminance level at a given value and saving energy for both activities and needs.

Instead of using common programming languages, such as C++, Python, or MATLAB, which require advanced programming skills [5–12], the LabVIEW environment is used since it employs G programming, which can analyze several layers of data and execute according to the rules of data flow instead of a more traditional procedural approach. In addition, it enables parallel processing and performing multiple tasks at once, different from traditional and sequential languages such as C and C++ [17]. LabVIEW's biggest advantage is the rapid and simple construction of the graphical user interface (GUI), which makes it easier to create the algorithm and does not require advanced programming skills to operate [18]. Based on HDRi luminance values, LabVIEW sets the brightness levels of the LED lamp and communicates with a digital multiplex (DMX) controller to control and brighten the LED lamps. Each lamp is brightened in sequence to respond to the indoor luminance levels.

#### **2. Materials and Methods**

#### *2.1. Model Prototype*

The prototype of lighting control is composed of:


The prototype is assumed to be a classroom environment that is used for three different types of activities: the first includes writing and reading (self-studying room), the second is teaching using a whiteboard (conventional classroom), and the last one is drawing and art activities focused on the center of the room (art activity classroom).

The prototype is set on a 1.5 × 1.5 m<sup>2</sup> measurement area divided into 25 squares (X1,Y1 to X5,Y5) as the working plane, and a piece of paper is placed in each square. Nine LED lamps arranged in three rows (A, B, C) and three columns (1, 2, 3) are hung 70 cm above the floor, so the proportion of room depth:height is approximately 2.15:1. Compared to a real classroom, the prototype is scaled down by four times. The LED lamps are covered with papers to reduce the brightness to levels in line with the scale of the prototype. To ensure the brightness scales as intended, an LED lamp is adjusted to various brightness levels, and an illuminance meter is used to measure the illuminance of the working plane in the prototype and in the real classroom for comparison. The illuminance measurements of the working plane in both the prototype and the real classroom are approximately 160 lux, 260 lux, and 500 lux as the lamp is brightened to 30%, 50%, and 100%, respectively. On one side of the wall, three papers are placed at a height of 45 cm (two-thirds of room height) as the whiteboard (X2,Y6 to X4,Y6). A 360◦ IP camera and a luminance meter are installed at the center of the experimental area, and two LED Fresnel lamps are placed outside of the measurement area, but their light is directed toward the measurement area to provide additional light to be assumed as daylight when the measurement scheme with daylight is presented (Figure 1). The IP camera captures images of the scene, and an algorithm is used to create an HDRi. The luminance value of each piece of paper placed inside the 28 squares is obtained from the HDRi and calibrated using the luminance meter. Based on these luminance values, LabVIEW is programmed to determine the brightness level of each LED lamp, and an Arduino Uno, used as a DMX controller, controls the brightness levels of the lamps [19,20] (Figure 2).

**Figure 1.** (**a**) The prototype is set on a 1.5 <sup>×</sup> 1.5 m2 area; (**b**) The model for the closed room without daylight scheme; (**c**) The model for the room with a window on one side and daylight is presented; (**d**) The layout of the prototype; (**e**) The arrangement of lamps.

**Figure 2.** Control system framework.

#### *2.2. HDRi Processing*

The HDR technique has been widely accepted and applied for various purposes, such as digital photography, image editing, virtual reality, digital cinema and video, rendering, lighting simulation, and remote sensing [21]. In this study, an IP camera is used to measure the luminance of a scene using the HDR photography technique. The camera acquires images at multiple exposures to capture a wide luminance variation within a scene within one minute (Figure 3). The images are merged to create an HDRi based on the Debevec algorithm [10,22]. The luminance value is calculated based on the Radiance-based program using the following equation:

$$\mathbf{L} = \left( 0.265 \times \mathbf{R} + 0.670 \times \mathbf{G} + 0.065 \times \mathbf{B} \right) \tag{1}$$

where L is the luminance value of the pixel (cd/m2); R, G, and B are the spectrally weighted radiance values of the pixel (W/m2 sr), and 0.265, 0.670, and 0.065 are calculated from CIE chromaticity used by Radiance [23,24]. A luminance meter is used to calibrate the 360◦ IP camera luminance value to obtain the correct luminance results [25].

#### *2.3. Calibration and Verification*

#### 2.3.1. Vignetting Effect and Correction of HDRi Luminance Results

The HDRi luminance measurement needs to be corrected because the light attenuation at the periphery of the lens results in luminance values for points away from the center of an HDRi image being systematically less than the actual luminance values in the scene. This is referred to as the vignetting effect, which is a nonlinear radial effect along the image radius of the lens and is often approximated by a polynomial function. To determine the vignetting effect, an HDRi of a uniform surface is captured, and the derived luminance values are compared to multiple spot measurements taken across the same surface [26,27]. Based on the vignetting effect, the vignetting correction factor with R2 = 0.98 for each individual pixel is defined (Figure 4).

**Figure 4.** Measured luminance values and the vignetting function derived to fit the measured values.

To verify the HDRi luminance value results, multiple spot measurements using a luminance meter are acquired at various LED lamp brightness levels for comparison. Figure 5 shows the luminance values obtained from the HDRi and measurement. The lamp brightness levels for HDRi 1 and measurement 1, HDRi 2 and measurement 2, HDRi 3 and measurement 3, HDRi 4 and measurement 4, and HDRi 5 and measurement 5 are 10%, 20%, 40%, 60%, and 80%, respectively. The average difference between the HDRi result and the measurement is within the range of 5–15%, which is deemed acceptable for practical measurements [26].

**Figure 5.** The luminance values obtained from the HDRis and measurements.

#### 2.3.2. Luminance Requirement for Each Activity

Three activities are presented in this study: the first is writing and reading, which requires an illuminance level of approximately 500 lux for the entire room; the second is teaching using a whiteboard, which requires an illuminance level of approximately 600 lux on the whiteboard and approximately 300 lux on the desk area, with a brightness contrast level between the whiteboard and the desk area of approximately 1.5, and the last is drawing and art activities that focus on the center of the room, which require an illuminance level of approximately 500 lux on the center of the room and approximately 250 lux on the background area, with a contrast level between the center and the background area of approximately 1.5 [28]. Since the HDRi produces luminance, the illuminance must be transformed to luminance. To obtain the required luminance value for each activity, measurements using an illuminance meter, luminance meter, and the sample paper used in the prototype and measurement area were conducted in different spaces of the classroom according to the activities. Table 2 shows the luminance values required for each activity.


**Table 2.** The luminance values required for each activity.

2.3.3. Brightness Level and Energy Consumption of Dimmable LED Lamp

Since nine dimmable LED lamps are used in this prototype, the brightness level and energy consumption of each LED lamp needs to be calibrated and verified so that all the lamps have the same performance. During that process, each lamp is turned on with various brightness levels, from 10% to 100%, and an energy meter is used to measure the energy consumption of the lamp at various brightness levels. Table 3 shows the energy consumption of an LED lamp in various brightness levels. The difference between the measured energy consumption and the product information is around 0.33–11.67%.


**Table 3.** The energy consumption of an LED lamp in various brightness levels.

#### *2.4. Measurement Schemes*

Based on the three different activities mentioned in Section 2.1, three measurement schemes with different LCSs are presented. Each scheme is applied for two conditions: the first is the room assumed as a closed room without windows, and the second is the room assumed to have a large window. The LED Fresnel lamps placed outside the measurement area are turned on, and it is assumed that daylight penetrates the room. The control system algorithm is built in the LabVIEW environment. LabVIEW is a visual programming language developed by National Instruments and used for measuring, monitoring, controlling, and recording operating conditions [18,29–31]. LabVIEW supports thousands of hardware devices, including Arduino, and has been implemented in smart building control to control lighting electricity, shading devices, and home safety [32–34]. In LabVIEW, the brightness levels of each lamp are set by responding to the luminance values.

#### 2.4.1. Measurement Scheme 1

In Measurement Scheme 1, the room functions as a self-studying room for writing and reading activities, which requires a uniform luminance value of approximately 100 cd/m2 for the entire room. The whiteboard is not considered in this scheme. In Measurement Scheme 1A, the room is assumed to be a closed room without windows, and in Measurement Scheme 1B, the room is assumed to have a large window on one side such that daylight penetrates through the window. In Measurement Scheme 1B, the LED Fresnel lamps outside the measurement area are dimmed to 50% so that the luminance values in the measurement area do not exceed the requirement and shading devices do not need to be used. Figure 6 shows the LCS for Measurement Scheme 1. First, the room is divided into two areas, and the average luminance values of each area are compared to detect whether daylight is present. If the average luminance values of one area are much higher than those of the other, the lamps in the other area are brightened by 10% in sequence until the average luminance values of both areas are close to equal. Then, if the luminance values of the entire room are less than 100 cd/m2, the lamps in columns 1 and 3 are simultaneously brightened by 10%, followed by the lamps in column 2 (L1, L3–L2). This order is used instead of the order from column 1 to column 3 (L1–L2–L3) because the latter order leads to all the lamps brightening to the same brightness level to meet the required luminance values, which has an effect no different from brightening all the lamps simultaneously (Appendix A). In addition, when the lamps placed on the rear sides brighten, they also illuminate the area in the center of the room. The measurement is repeated every three minutes per iteration because over one minute, the IP camera creates a series of images, and the lamp brightness levels should not change; otherwise, the created HDRis will not be accurate. Therefore, at least one additional minute after a change in lamp brightness levels is needed to create the next series of images.

**Figure 6.** (**a**) The LCS flow diagram for scheme 1; (**b**) The layout of the room; (**c**) The sequence of the lamps brightened.

#### 2.4.2. Measurement Scheme 2

Measurement Scheme 2 considers the room to function as a conventional classroom for teaching using a whiteboard, which requires a luminance value of approximately 120 cd/m<sup>2</sup> on the whiteboard (area A) and 60 cd/m<sup>2</sup> on the working plane/desks (area B); the brightness contrast between the whiteboard and the working plane should not be less than 1.5. This contrast value means that the average luminance values of whiteboards should be 50% higher than the average luminance value of the working plane/desks. Regarding the measurement accuracy of 5–15%, this value is more than three times higher than the error; thus, it can guarantee that the result of this measurement is correct. In Measurement Scheme 2A, the room is assumed to be a closed room without windows, and in Measurement Scheme 2B, the room is assumed to have a large window on one side so that daylight penetrates through the window. The LCS for Measurement Scheme 2 is presented in Figure 7. The first step of the LCS is similar to the LCS for Measurement Scheme 1, which is detecting whether there is daylight and making the luminance almost equal for both sides. If the luminance values of area A are less than 120 cd/m2, the brightness levels of the lamps in row A (LA) will increase by 10%. After the luminance values of area A meet the requirement, the luminance values of area B are examined. If the luminance values are less than 60 cd/m2, the lamps in row C are brightened by 10%, followed by the lamps in row B (LC–LB). The LC lamps are brightened first because the areas of rows Y3 to Y5 are already bright, resulting in the LA brightness meeting the requirement for area A. The last step is calculating the contrast between area A and area B' (area B without row Y5). If the ratio of the average luminance values of area A to those of area B' is less than 1.5, the LA is brightened by 10%. To calculate the contrast, row Y5 is not considered because in the classroom, the area in front of the whiteboard is not used as a working plane, and the desks are placed at a certain distance from the whiteboard.

### 2.4.3. Measurement Scheme 3

The art activity classroom is presented in Measurement Scheme 3. In this scheme, the drawing and art activities are focused on the center of the room (area A), which requires a luminance value of approximately 100 cd/m2; the required luminance value on the background area (area B) is approximately 50 cd/m2; the brightness contrast between the center of the room, where the art pieces are placed (area A'/X3,Y3), and area B should not be less than 1.5. The whiteboard is not considered in this scheme. A closed room without windows is used in Measurement Scheme 3A, and a room with a large window on one side and daylight penetrating through the window is used in Measurement Scheme 3B. Figure 8 shows the LCS for Measurement Scheme 3. Similar to Measurement Schemes 1 and 2, the first step of the LCS is similar to the LCS for Measurement Scheme 1, the presence of daylight is detected, and the luminance value is made almost equal for both sides. Then, if the luminance values of area A are less than 100 cd/m2, the lamps are brightened by 10%, with the lamp in the center of the room (L2B) brightened first, followed by the four lamps L2C, L2A, L1B, and L3B simultaneously in the next iteration. Once the luminance values of area A meet the requirement, the luminance values of area B are examined. If the luminance values are less than 50 cd/m2, the remaining lamps L1A, L1C, L3A, and L3C are brightened by 10% simultaneously. After all the required luminance values are met, the contrast between area A' and area B is calculated. If the ratio of the average luminance values of area A' to those of area B is less than 1.5, the lamp L2B is brightened by 10%.

**Figure 7.** (**a**) The LCS flow diagram for scheme 2; (**b**) The layout of the room; (**c**) The sequence of the lamps brightened.


**Figure 8.** (**a**) The LCS flow diagram for scheme 3; (**b**) The layout of the room; (**c**) The sequence of the lamps brightened.

#### **3. Results and Discussion**

#### *3.1. Luminance Values and Lamp Brightness Levels*

In this section, the luminance values of the squares and the brightness levels of the LED lamps are presented and analyzed according to the results of the measurements.

#### 3.1.1. Measurement Scheme 1A

In Measurement Scheme 1A, the room is assumed to be a closed self-studying room without windows. The initial condition shows that there is no difference between the luminance values of area 1 and area 2; thus, the lamps brightened by 10% in sequence 3. This sequence brightens the lamps in columns 1 and 3 (L1 and L3) simultaneously, followed by the lamps in column 2 (L2) during the ensuing iterations. The required luminance values of all squares greater than 100 cd/m2 are met after five iterations, with lamps in L1 and L3 at 30% brightness and L2 at 20% brightness (Figure 9). After iteration 5, the brightness

levels of the lamps remain steady and no longer change. This result shows that it is not necessary to brighten all lamps to the same level to provide uniform luminance values: some lamps can be brightened at a lower level depending on their positions. In this case, the lamps in L2, in the middle column of the room, need to be brightened to only 20% because the lamps in L1 and L3 provide enough additional brightness to the middle area (columns X2 to X4).

**Figure 9.** The luminance values and lamp brightness levels for Measurement Scheme 1A.

### 3.1.2. Measurement Scheme 1B

The room in Measurement Scheme 1B is assumed to be a self-studying room with a large window on one side of the wall and daylight penetrating the room. The initial conditions show that the luminance values of column X1 are higher than those of the other areas. This condition makes the luminance values of area 1 higher than those of area 2 and triggers the lamps to brighten by 10% in sequence 2: the lamps in column 3 (L3) brighten first, followed by the lamps in column 2 (L2), until the average luminance values of both areas are almost the same. To balance the luminance values of areas 1 and 2, the lamps in L3 adjust to 10% brightness (iteration 1). After the luminance value of the measurement area is balanced, the lamps brighten in sequence 3 to satisfy the required luminance values. In this case, after five iterations, lamps in L1 and L2 brighten to 20%, and those in L3 brighten to 30% to provide luminance values of more than 100 cd/m2. Figure 10 shows the luminance values and brightness levels of the lamps at each iteration. Compared to those in Measurement Scheme 1A, the L1 lamps in Measurement Scheme 1B brighten to a level 10% lower since they are positioned near the window such that the luminance values of column X1 are higher than those of other areas in the initial condition. However, since the brightness levels of the L1 lamps are lower in Measurement Scheme 1B

than in Measurement Scheme 1A, most of the luminance values of X1 to X4 are lower in Measurement Scheme 1B than in Measurement Scheme 1A, but they remain higher than the required luminance because of the daylight (the light from the LED Fresnel lamps).

**Figure 10.** The luminance values and lamp brightness levels for Measurement Scheme 1B.

#### 3.1.3. Measurement Scheme 2A

Measurement Scheme 2A considers that the room has functioned as a conventional classroom without windows, with the luminance required for area A being approximately 120 cd/m<sup>2</sup> and for area B being approximately 60 cd/m2, with a brightness contrast of approximately 1.5 or more. As the initial condition shows that the luminance values of all areas are the same, the lamps brighten in sequence 3, and the lamps in row A (LA) brighten by 10% until the luminance values of area A are 120 cd/m<sup>2</sup> or more, shown in iterations 1 to 5. That condition is achieved at iteration 5, with the brightness level of the lamps in LA being 50%. After that condition is met, the other lamps brighten in sequence 4, which starts with the lamps in row C (LC), followed by the lamps in row B (LB). The required luminance levels and the brightness contrast between areas A and B' are met after eight iterations, when the lamps in row A, row B, and row C brighten at 50%, 10%, and 20%, respectively, and the brightness contrast between areas A and B' is approximately 1.7. The lamps in LA are illuminated to a much greater extent than other lamps since they are placed near the whiteboard and need to provide luminance for the whiteboard, which is higher than the working plane/desks. This condition also provides higher luminance in the front area of the classroom (row Y5), the area where the teacher stands (Figure 11).

**Figure 11.** The luminance values and lamp brightness levels for Measurement Scheme 2A.

#### 3.1.4. Measurement Scheme 2B

In Measurement Scheme 2B, the room is assumed to be a conventional classroom with a large window on one side of the wall, where daylight penetrates the room. Since the luminance values of column X1 are higher than those of other areas in the initial condition, the lamps brighten in sequence 2 at iteration 1. At that iteration, the lamps in L3 brighten to 10%, resulting in the luminance values of area 1 and area 2 being almost the same. This condition leads the lamps to brighten in sequence 3, in which the lamps in LA brighten by 10% until the luminance values of area A are approximately 120 cd/m2 or more; this condition is met at iteration 6, when the lamps L1A and L2A brighten to 50% and the lamp L3A brightens to 60%. Lamp L3A brightens 10% higher than the other lamps in the same row because it already brightened 10% in iteration 1 to balance the luminance values of areas 1 and 2. After the luminance values of area A met the requirement, the lamps in LB and LC brightened in sequence 4. To meet the required luminance values and achieve the contrast between areas A and B', a lamp brightens at 60%, two lamps

brighten at 50%, two lamps brighten at 20%, and the other lamps brighten at 10% after eight iterations (Figure 12). The brightness contrast between areas A and B' is approximately 1.61. Compared to the same lamps in Measurement Scheme 2A, lamps L3A and L3B brighten 10% higher, and L1C and L2C brighten 10% lower. This brightness level difference and the light from the LED Fresnel lamps are assumed to be due to daylight, resulting in the difference in luminance values of the same squares between Measurement Scheme 2A and Measurement Scheme 2B. The squares in row Y5 mostly have higher luminance values in Measurement Scheme 2B than in Measurement Scheme 2A, while the squares in row Y4 mostly have higher luminance values in scheme 2B than in scheme 2A. Some squares in rows Y1 and Y2 have luminance values of approximately 51–76 cd/m2, and some have luminance values of approximately 76–100 cd/m2 in Measurement Scheme 2A. However, in Measurement Scheme 2B, all squares in the same rows have luminance values of approximately 51–76 cd/m2.

**Figure 12.** The luminance values and lamp brightness levels for Measurement Scheme 2B.

#### 3.1.5. Measurement Scheme 3A

Measurement Scheme 3A presents the room as an art activity classroom without windows. The luminance required for area A and area B is approximately 100 cd/m2 and 50 cd/m2, respectively, and the brightness contrast should not be less than 1.5. As the initial condition shows that the luminance values of areas 1 and 2 are almost the same, the lamps brighten in sequence 3: L2B in the center of the room, followed by lamps L1B, L2C, L3B, and L2A in the next iteration (by 10%) until the luminance values of area A are 100 cd/m<sup>2</sup> or more. In this scheme, the required luminance values are achieved after seven iterations, when lamp L2B, in the center of the room, brightens to 40% and the four lamps L1B, L2C, L3B, and L2A brighten to 30%. At that iteration, the luminance values of area B are more than 50 cd/m2, which is more than the required luminance, and the contrast between areas A' and B is approximately 1.6. Since the luminance values and the brightness contrast requirements are met, the lamps in sequence 4 do not need to brighten, and the rest of the lamps remain turned off. The process of increasing the brightness levels of the lamps and the luminance values at each iteration are shown in Figure 13. The luminance values and lamp brightness levels indicate that, for the room with activities focused on the center, the rear lamps do not need to be turned on because that area needs to remain darker than the center area of the room to create the desired brightness contrast.

**Figure 13.** The luminance values and lamp brightness levels for Measurement Scheme 3A.

#### 3.1.6. Measurement Scheme 3B

Measurement Scheme 3B considers the room as an art activity classroom with a large window on one side of the wall and daylight penetrating the room. As the initial condition shows that the average luminance values of area 1 are higher than those of area 2, the lamps brighten in sequence 2 to make the average luminance values of both areas almost the same, which happens at iteration 1, where the lamps in L3 brighten by 10%. After the average luminance values of areas 1 and 2 are almost the same, the lamps brighten in sequence 3 to ensure that the luminance values of area A are approximately 100 cd/m2 or higher. In this measurement scheme, the required luminance values are achieved at iteration 7, in which lamp L3B is brightened to 40%, the four lamps L1B, L2B, L2A, and L2C are brightened to 30%, the two lamps L3A and L3C are brightened to 10%, and the two other lamps are off. However, the brightness contrast between areas A' and B is only 1.4, which is still lower than the requirement. Therefore, at iteration 8, the brightness level of lamp L2B increases to 40%, leading two lamps to brighten to 40%, three lamps to brighten to 30%, and two lamps to brighten to 20%. At this iteration, the brightness contrast between areas A' and B is approximately 1.6; thus, all requirements are met. This condition shows that in the presence of daylight, even the luminance values meet the requirement, but the lamp brightness levels still increase because the brightness contrast needs to be maintained at a given value. In this scheme, lamps L3A and L3B brighten 10% more than the same lamps in Measurement Scheme 3A because of the presence of daylight. Figure 14 shows the process of brightening the lamps and the luminance values at each iteration.

**Figure 14.** The luminance values and lamp brightness levels for Measurement Scheme 3B.

Table 4 summarizes the brightness levels of the lamps in each measurement scheme. The LCS resulted in different combinations of lamp brightness levels for different activities. In Measurement Schemes 1A and 1B, the presence of daylight resulted in a lower brightness level in Measurement Scheme 1B; in Measurement Schemes 2A and 2B, the daylight resulted in the brightness levels of some lamps being lower and those of other lamps being higher than the corresponding levels in the room without daylight, and in Measurement Schemes 3A and 3B, the presence of daylight increased rather than decreased the brightness levels of some lamps. These results show that daylight presence does not always have a great reducing impact on lamp brightness levels. Despite the presence of daylight in Measurement Scheme 3B, the brightness levels of some lamps are higher in Measurement Scheme 3B than in Measurement Scheme 3A because the activity is focused on the center of the room and the brightness contrast between the center of the room and the background area needs to be maintained at the given value.


**Table 4.** The brightness levels of each lamp in each measurement scheme.

The prototype successfully demonstrates the utilization of an IP cam as a luminance meter for simultaneously measuring several spots in a whole room and reveals that an IP cam can replace several traditional spot lighting sensors. In all measurement schemes, the HDRis produced by the IP cam prove successful in measuring the luminance values under various settings and functions of the room without changing the sensor or requiring additional sensors. In summary, the HDRi method supports IP cam utilization as a set of "field of view" sensors for a flexible space.

#### *3.2. Energy Consumption*

In this section, the energy consumption of the lamps in each scheme, wherein the equilibrium condition is met and the lamp brightness levels no longer change, is monitored by using an energy meter, and compared to the baseline condition of nine lamps, at 100% brightness. The energy consumption of the baseline, with nine LED lamps at 100% brightness, is approximately 558 W. Table 5 summarizes the energy consumption of each measurement scheme and the energy savings compared to the baseline. For Measurement Scheme 1, Measurement Scheme 1A consumes 14.58% more energy than Measurement Scheme 1B; however, for Measurement Scheme 2, Measurement Scheme 2A and Measurement Scheme 2B consume almost the same amount of energy, and for Measurement Scheme 3, Measurement Scheme 3B consumes 19% more energy than Measurement Scheme 3A. Compared to the measurement schemes without daylight, Measurement Schemes 2 and 3 with daylight do not save energy. This finding indicates that daylight does not always result in more energy savings because, for certain activities, the lamps still need to be turned on to maintain the brightness contrast and provide visual comfort. The applied LCS can save approximately 73.39%, 76.77%, 73.71%, 73.49%, 82.38%, and 79.03% of the energy consumed under baseline for Measurement Schemes 1A, 1B, 2A, 2B, 3A, and 3B, respectively, since most of the lamps are only brightened to between 10% and 60%.


**Table 5.** The comparison of the energy consumption.

#### **4. Conclusions**

This study presents an LCS prototype based on HDRi using a LabVIEW platform that consists of a 360◦ IP camera, a DMX controller, and several LED lamps to provide visual comfort and energy savings. The brightness levels of the LED lamps are changed in sequence to meet the luminance value requirement. The prototype is applied to the room assumed as a classroom with three different measurement schemes: the first is a self-studying room that requires a uniform luminance value of approximately 100 cd/m2, the second is a conventional classroom with a whiteboard that requires luminance values of approximately 120 cd/m2 for the whiteboard and 60 cd/m2 for the working plane/desks, with a brightness contrast between the whiteboard and the working plane/desks of approximately 1.5, and the latter is an art activity classroom that requires different luminance values for the center area and background area, which are 100 cd/m<sup>2</sup> and 50 cd/m2, respectively, with a brightness contrast between the center area and the background area of approximately 1.5. The findings of this study are summarized as follows:

	- a. Measurement Scheme 1A: 6 lamps at 30% brightness and 3 lamps at 20% brightness
	- b. Measurement Scheme 1B: 3 lamps at 30% brightness and 6 lamps at 30% brightness
	- c. Measurement Scheme 2A: 3 lamps at 50% brightness, 3 lamps at 20% brightness, and 3 lamps at 10% brightness
	- d. Measurement Scheme 2B: 1 lamp at 60% brightness, 2 lamps at 50% brightness, 2 lamps at 20% brightness, and 4 lamps at 10% brightness
	- e. Measurement Scheme 3A: 1 lamp at 40% brightness, 4 lamps at 30% brightness, and 4 lamps turned off
	- f. Measurement Scheme 3B: 2 lamps at 40% brightness, 3 lamps at 30% brightness, 2 lamps at 10% brightness, and 2 lamps turned off

**Author Contributions:** Conceptualization, A.B.; methodology, Y.-S.C.; software, A.B.; validation, A.B.; formal analysis, A.B. and Y.-S.C.; investigation, A.B.; resources, Y.-S.C.; data curation, A.B. and Y.-S.C.; writing—original draft preparation, A.B.; writing—review and editing, A.B.; visualization, A.B.; supervision, Y.-S.C.; project administration, A.B. and Y.-S.C.; funding acquisition, Y.-S.C. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Taiwan Ministry of Science (Project No.: MOST 109-2221- E-011-033-) and by the Taiwan Ministry of Education.

**Acknowledgments:** The authors would like to thank Ben-Cheng Guo for assisting the HDRi processing using a 360◦ IP camera, Ronaldo Gabe Manik for assisting Arduino Uno utilization as DMX controller, and the ISAAC (Integrating Simulation and Analysis for Architectural Complexity) Lab at the National Taiwan University of Science and Technology (NTUST) of Taiwan (R.O.C.). for supporting this research.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A**

**Figure A1.** The luminance values and lamp brightness levels of Measurement Scheme 1A in each iteration. The lamps brighten in the sequence of L1, L2, and L3.
