1. Introduction
Proper lighting of the workplace is important for work comfort and efficiency. Therefore, the relevant lighting requirements for such a stand are formulated in legal acts and standards [
1]. However, the cited documents do not contain the details of technical solutions to ensure that the desired values or parameters characterizing the lighting of the workplace are obtained.
For several years now, LED light sources have been increasingly used in lighting [
2,
3,
4,
5]. They are characterized by high efficiency of converting electrical energy into light, and at the same time, very easy regulation of the emitted luminous flux by regulating the LED forward current [
2,
6].
When illuminating the workplace, the value of the illuminance coming from external sources, e.g., the main room lighting or sunlight, is of great importance. In such a situation, it is possible to provide the desired illuminance value on the work surface with a lower illuminance value from a local illumination source. Limiting the value of this parameter allows reducing the value of the LED supply current and saving electrical energy.
The paper [
7] presents the results of preliminary investigations on the lighting control system of the office stand. This system allows studying illumination intensity distribution, but does not allow full control of the average current value of the used point light sources. In the first phase of development, the system does not allow communicating with a PC (Personal Computer).
There are also available technologies that allow smooth lighting control, such as the system described in this paper. However, lighting devices that adapt to external lighting are currently most often available only in professional, expensive solutions prepared for the client’s needs. We may also come across devices based on machine learning and artificial intelligence. Algorithms are used in such devices to calculate the value that has been configured as appropriate, or even to learn the customer’s habits on the basis of samples from manual settings [
8,
9,
10,
11,
12,
13]. Unfortunately, such technologies are expensive.
The papers [
6,
14,
15,
16,
17] present classic lighting systems using solid state light sources that do not use feedback signals obtained by means of illuminance sensors made in analog or digital technology to regulate the emitted luminous flux. Static control methods in the form of circuits built with the use of thyristors or MOSFETs (Metal Oxide Semiconductor Field Effect Transistors) can also be used.
The papers [
8,
18,
19] present the results of measurements of static and dynamic parameters of selected illuminance sensors, taking into account the spectral width of the measured radiation. On the other hand, the papers [
9,
18,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29] describe in detail the test stands for the regulation of illuminance with the use of illuminance sensors made in analog or digital technology.
The papers [
8,
9,
30,
31] present test stands that use feedback signals to regulate the emitted luminous flux. For this purpose, not only are illuminance sensors used, but also temperature sensors and sensors to measure the spectrum of the emitted radiation. Unfortunately, such a large number of feedback signals lead to great complexity of test stands, which often extends the control time of the emitted luminous flux even to several dozen seconds. It should also be remembered that the presented systems sometimes use very complex adaptive algorithms to control the emitted luminous flux. This extends the reaction time of the systems designed in this way. The use of adaptive algorithms and artificial intelligence algorithms, in addition to extending the reaction time of the system to changes in the intensity of external illuminance, also requires the use of the DSP (Digital Signal Processor), which significantly increases the cost of the entire device.
An important problem presented in the papers [
32,
33,
34,
35,
36] is an influence of select factors on the value of illuminance emitted by solid state light sources. Widely described in the literature [
3,
37,
38], it is also an influence of ambient temperature and self-heating on thermal and optical parameters of solid state light sources. It should be remembered that having too high a value of forward current when illuminating workplaces with a single power LED may cause an increase in its internal temperature, and significant worsening of optical parameters. The solution to this problem is the use of dedicated passive or active cooling systems described in the papers [
39,
40].
This paper presents a built-in system that enables automatic adjustment of the illuminance of an office workplace equipped with an LED light source. In order to simplify the topology of the device and obtain quick settings of the control system used, an iterative algorithm has been implemented in this system.
The
Section 2 presents in detail the legal regulations concerning the illuminance of workplaces. The
Section 3 describes the proposed system of automatic control of the illuminance of the light emitted by a point light source, taking into account the intensity of external illuminance, and presents the iterative algorithm used to adjust optical parameters. The
Section 4 presents and discusses the results of static and dynamic measurements of the proposed lighting system.
2. Legal Regulations Regarding Workplace Illuminance
Not only is providing proper working conditions necessary from the legal point of view [
1], it also increases the efficiency of employees and contributes to their well-being. Automatic control is used to make sure that the lighting adapts to environmental conditions, and avoid the need to manually adjust it. Such a procedure not only takes into account the employee’s comfort level but also brings about ecological benefits that are now of great importance [
41]. The system ensures proper lighting, which prevents the space from being underexposed, while also preventing excessive lighting [
42].
We use an LED source in the considered lighting system. Such a source is characterized by the high efficiency of converting electricity into light [
43]. It also adds value to the design by allowing control of the luminous flux through easy adjustment of the power LED’s mean forward current. This allows for high accuracy and easy control with the PWM (Pulse Width Modulation) signal generated by the microcontroller. During the analysis, documents specifying the parameters and criteria for proper lighting of the workplace and measurements were taken into account [
1,
41,
42,
44,
45,
46,
47,
48,
49].
Based on the standards, a working area of A3 size (297 × 420 mm) is defined. The standards define this area—the field of the task as the space in which the visual task is performed. The surroundings of this space are called the field of the immediate surroundings. That is, the space within the field of view in the shape of a belt around the task field adjacent to it, and at least 0.5 m wide. And then the background—the area within the field of view that is located adjacent to the immediate surrounding field. The background must not contain any task field or any field of immediate vicinity, and its width is defined as at least 3 m.
Figure 1 shows the dimensions of the working area and the location of the used illuminance sensors.
The controlled parameter characterizing the quality of lighting at the workplace is the illuminance [
48]. Assuming that the light source is punctual, a simplified formula can be used for illuminance at point P of the plane under consideration [
48] of the form
where I is the luminous intensity in the P direction, r is the distance of the light source to the point P, α is the angle of incidence of the light, and h is the distance of the light source from the plane under consideration.
In order to measure the value of the illuminance on the surface, the average illuminance
should be determined. In practice, it is used to calculate the average value of illuminance from the average illuminance for a representative number of measurement points n in a given area [
48].
The analyzed norms indicate only the limit values that cannot be exceeded. Therefore, in our work we use not only average values, but also extreme values, e.g., minimum illuminance, which is the lowest value of illuminance in one of selected points in a working area. The standard [
1] requires that minimum values of the average illuminance should be maintained, depending on the type of visual work performed and the type of room. The normative minimum permissible average illuminance values range from 10 lx for general orientation in an illuminated room to 1 klx for prolonged and strenuous visual work.
The standard defines also the operational illuminance
, from which the value of the average illuminance
in the working area cannot be lower. The permissible value of the operational illuminance depends on the activity performed. For example, for activities related to the precise assembly of measuring instruments, the value of operational illuminance is 1 klx, while for the assembly of mobile devices, this value is only 750 lx [
1].
In the considerations presented in this paper, the value of the uniformity of illumination δ was also used, determined by the ratio of minimum illuminance E
min to the average illuminance on surface
. The standards define the lowest allowable value of δ on a given surface, according to the type of performed activities and for the immediate surroundings containing the working area. For the working area in which continuous workshop work is performed, the value of the minimum permissible value of δ is 0.65, while for occasional work, this value is only 0.4. The permissible value of δ for the working area cannot be lower than 0.7, while the value of this parameter for the area of the immediate surroundings cannot be lower than 0.5 [
1].
Measurements of illuminance should be made on the rectangular working area of the dimensions equal to p and q. When interpreting the results of general lighting measurements, one should take into account the recommendation that in the place of permanent residence, the operational illuminance should not be lower than 200 lx [
1].
An important parameter characterizing the illumination of the area under consideration is the smallest permissible number of measurement points on an evenly lit working area. It depends on the parameter w given by the formula:
If the value of the parameter w < 1, then it is required to measure the illuminance at 4 points, for 1 < w < 2—at 9 points, for 2 < w < 3—at 16 points, and for w > 3—at 25 points [
44].
In order to determine the uniformity of the illuminance distribution δ for the working area, the quotient of the minimum illuminance Emin and the average illuminance Eav in the selected working area should be determined. The lowest value of δ cannot be lower than 0.65 for the working area in which continuous work is performed, or 0.4 for the working area in which casual work is performed.
Apart from the number of measuring points, the distances between these points are also determined. The requirements vary depending on whether the measurement is for the working area, the field of the immediate surroundings, or the background. The standard [
50] recommends the use of a measurement grid with meshes in the form of rectanglers, preferably squares. The ratio of the length to the width of such a rectangle should be in the range of 0.5 to 2. The maximum distance between the measurement points x is determined using the formula [
48]:
According to the standard [
50], the value of x should not exceed 10 m for outdoor applications. Knowing the maximum distance between measurement points x and the length of the longer side q, it is possible to determine the minimum number of measurement points N on this side. It is an integer that is closest to the result of dividing the length of the longer side q by the distance between the measurement points x.
Based on the dependence (3), the standard [
42] shows the relationship between the value of the uniformity of the illuminance of the working area, the maximum distance between the measurement points x, and the minimum number of these points N, which are presented in
Table 1.
Following the above-mentioned principles, the design adopted the working area as an area of A3 size (297 × 420 mm), and thus, 4 was a sufficient number of measurement points. However, during the research, 63 regularly placed measurement points were used to plot the lighting intensity distribution. The arrangement of the illuminance sensors is shown in
Figure 1.
3. Investigated Lighting Control System
Figure 2 shows the block diagram of an embedded system for controlling the lighting of an office station, the main component of which is a control system built using the STM32L475VGT6 processor (ST Microelectronics, Budapest, Hungary) [
49]. This processor is a component of the Discovery B-L475E-IOT01A2 evaluation board adapted to work with IoT (Internet of Things) via the Wi-Fi module. This system uses an analog-to-digital converter to record the voltages generated by the TEMT6000 (Vishay, Malvern, PA, USA) analog illuminance sensors. In order to generate a PWM signal with a frequency equal to 5 kHz, a timer implemented in the processor is used [
51]. The use of such frequency of a PWM signal allows eliminating the phenomenon of LED flickering, which can be observed at low frequency values (below 100 Hz) of this signal.
In order to galvanically separate the ground circuit of the evaluation board and the LED power supply, an optocoupler CNY17-4 (Vishay, Malvern, PA, USA) is used [
52]. If the optoisolator is not used, very high RMS (Root Mean Square) values of noise at the output of the TEMT6000 illumination sensor, exceeding 50 mV, are observed, making the operation of the control algorithm impossible. In order to increase the current efficiency of the PWM signal output, the MCP1405 (Microchip, Chandler, AZ, USA) controller [
53] is used. A MOSFET of the IRF540 (Vishay, Malvern, PA, USA) type is used as a device switching the LED current [
42].
Another important task is to ensure appropriate measurement conditions. To achieve this, a test set-up is prepared to ensure stable conditions of external lighting that would enable tests to be carried out on the control system. One such condition is to ensure the possibility of changing the intensity of external lighting, which would allow the control system response to be tested. An additional advantage of the test set-up is an easy and precise change in the position of the light intensity sensors in order to investigate the distribution of the illuminance generated by the point light sources used.
The prototype test set-up presented in
Figure 3 met all the established goals. Placing the set-up in a darkroom helped provide a stable environment that allowed for precise measurements of the control system.
A plate is placed at the bottom of the test set-up with 63 regularly distributed points for the placement of sensors, which allows for an easy change in the position of the sensors. The position of the sensors could be changed within the accepted working area of the dimensions of 297 × 420 mm, in 7 rows and 9 columns. The measuring surface prepared in such a way ensures that the sensors are precisely positioned each time, which allows obtaining reliable results and measurement of illumination intensity distribution. As mentioned earlier, 4 positions are selected in which sensors E
1, E
2, E
3 and E
4 are placed, as shown in
Figure 1. During the investigations, the height at which the point light source controlled by the system is fixed is 50 cm.
In the presented set-up, an analog sensor is used to measure the light intensity, which is sensitive to the visible light, with the half sensitivity angle ϕ = ±60°. The photosensitive element of the optical sensor is a phototransistor. Its operating parameters are presented in
Table 2.
This sensor is mounted on a PCB (Printed Circuit Board) of the dimensions of 11 × 11 mm using the SMD (Surface Mounted Devices) technology. As a result, its pins are soldered to pads (2.54 mm raster), allowing for connection to the breadboard or the main module in the form of the STM32Disco development board used in the presented system, or the Arduino development kit. The TEMT6000 optical sensor system has three GND pins—system ground, VCC—5 V supply voltage and VOUT—analog output.
The sensor TEMT6000 [
54] is characterized by a narrow range of the measured illuminance values, which typically do not exceed several klx. It is caused by the properties of the phototransistor acting as a photosensitive element. Such sensors are characterized by quick saturation of the phototransistor’s output characteristic. The TEMT6000 sensor contains, apart from the phototransistor, a 10 kΩ resistor limiting the collector current. The voltage drop across this resistor is fed to the input of the analog-to-digital converter of the measuring system, which is presented in [
7].
The applied illuminance sensors E1–E4 of the TEMT 6000 type are the main components of the feedback loop of the control system used to adjust the illuminance of the point light source. These sensors also respond to a change in the intensity of external lighting. The use of this type of sensors was determined by the low values of the measured illuminance, which—in the system under consideration—did not exceed 1 klx.
During the tests, the LED of the type XMLBWT-00-0000-000LT40E4 (Cree LED, Durham, NC, USA) served as a point light source, which is a part of the system during the calibration of sensors and the measurement of its static and dynamic parameters. The applied LED can work when the maximum forward current I
Fmax = 3 A, the total power P
tot is up to 10 W, the emitted luminous flux reaches 341 lm at forward current I
F = 0.35 A, while the emission angle is 125°. While the lighting system operates, the LED is mounted on a RAD-A5723/100 heat sink. The Ring XRE module is also tested as a point source of light, which contains six diodes of the XRE-L1-0000-006F8 (Cree LED, Durham, NC, USA) type [
55] connected in series with the maximum forward current I
Fmax = 0.7 A, which is used for investigations of the dynamics of the system.
Figure 4a shows a view of LED light sources in the form of an XML2 diode [
43], while
Figure 4b shows the Ring XRE module.
In order to control the lighting of the office station, an algorithm implemented in the STM32L4 microcontroller is prepared. The analog-to-digital converter ADC takes the data from four analog sensors of illuminance. The next step is to average the measurement results of these sensors. The transmitter takes 2000 samples from each optical sensor and averages the measurement results. The averaging operation for four sensors takes no longer than 5 s. The next step is to compare the measured value of illuminance with the value adopted as the reference value. If these values are equal, the next 2000 samples are read, while the reading is overstated or lowered in relation to the adopted standard, the average value of the LED current is adjusted using the duty cycle of the signal controlling the gate of the MOSFET.
Figure 5 shows the algorithm of the main part of the firmware. It does not contain the work of the DMA (Direct Memory Access) system, which, without using the processor’s time, copies the readings from the analog sensors on an ongoing basis and places them in the buffer. From it, they are taken every 1 ms and averaged to get rid of the noise related to the quality of the sensors. The algorithm below does not include communication with the PC application. At any time, the user, after connecting a computer with the STM32Disco evaluation kit (ST Microelectronics, Budapest, Hungary) via the USB (Universal Serial Bus) port, can download the current data from the system and send new set values. This does not stop the program; the new data are updated, and the next time the loop is run.
The control algorithm plays a key role in the operation of the system, therefore its selection was not unambiguous. Finally, a very simple iterative algorithm presented in
Figure 6 is selected.
The algorithm also uses the calculated value of illuminance in the working area and compares it with the set value. It takes into account a possible error of 20 lx. If the calculated value, taking into account the error value, is different than the set value of illuminance, a correction is made, i.e., a change in the PWM signal fill value, in order to change the value of illuminance. In the case where the calculated value is lower than the set value, the algorithm increases the duty cycle of the PWM signal by the correction value, and in the case where the calculated value is higher than the set value, the correction consists of reducing the duty cycle of the PWM signal by the correction value. During the tests, the correction value was set at 2%, which is sufficient for the control system to be considered accurate, and at the same time, the control can be considered fast enough.
Although the characteristics of the algorithm used do not ensure a constant system response time (it increases with an increase in the difference between the value obtained from the sensors and the set value), the algorithm can be considered sufficient, as proved by the tests presented later in the paper. The value mentioned earlier as the error value is entered into the algorithm to ensure the stability of the circuit. It is not desirable that the illuminance should constantly change in the pursuit of perfection. The sensors are not accurate enough to ensure a constant reading of the values, and the ambient lighting conditions may change slightly. If the system fails to maintain the ideal settings in this situation, it could cause flickering of light, which leads to eye fatigue for the user staying in such conditions. This value introduces a permitted error that is not corrected, but ensures the stability of the control system and at the same time ensures its sufficient quality.
To ensure higher accuracy and a more stable system response time, it was possible to use an algorithm of higher complexity, which would not merely compare the actual value to the set value on a larger/smaller basis. The algorithm could calculate the difference between these values and, depending on its magnitude, change the duty cycle of the PWM signal by a higher or lower value.
The advantage of this solution would be to increase the speed of the system reaction time and a more stable operation of the system. The system would have to calculate by what fill value it should change the settings to obtain the set point. It was possible to use artificial intelligence algorithms for this purpose, which would have meant following the trends in the technology industry. Such a solution would have been faster, but the advantage of the solution used was that the change in settings was very smooth, thereby having a positive impact on the user’s eyesight. Additionally, during the tests, the iterative algorithm presented above turned out to be sufficient, fulfilling all the requirements. The introduction of a more elaborate algorithm could mean greater complexity of the program, which could make it more unreliable, and also, if the project is to be transferred to a device to be sold on the market, it could make it impossible to optimize the hardware, mainly the processor. More complex algorithms require processors with more computing power and memory. The used algorithm makes it possible to optimize costs and reduce electricity consumption.
The use of artificial intelligence or machine-learning algorithms would also increase the required microcontroller cache memory, which would lead to greater complexity of the control system, the need to use a more complex microcontroller architecture, and disprove the assumption, thereby increasing the cost of the entire system. Such a solution would also lead to the consumption of more electricity, which would disprove the assumption of saving energy consumed by the proposed lighting control system in the workplace.
In the papers [
8,
9,
10,
11,
12,
13], systems using artificial intelligence and machine-learning algorithms are proposed. However, the authors of these systems mention considerable computational effort required for the stable control of the solid-state light source, and the complexity of systems for continuous measurement of the illuminance. It leads to a need for microcontroller systems that additionally requires digital signal processing algorithms. These systems also show long operating times, exceeding even several seconds. The discussed papers also present the solutions that make use of programmable circuits, which enable the implementation of a control system, additional amounts of cache memory, and digital signal processing circuits in one integrated circuit, which significantly limits the profitability of such a project.
The advantage of the control system proposed in this paper lies in the optimization of the costs incurred, because the control system uses a very popular and cheap microcontroller from the STM32L4 family, ensuring low power consumption, which leads to savings in electricity consumption. This system, in comparison with the literature systems, is also characterized by the simplicity of the control algorithm because it uses only one feedback loop for four measurement sensors, while the literature systems use separate feedback loops for each used illuminance sensor.