Development and testing of a light dimming control using arduino uno

Increasing population and human needs have an impact on increasing the need for electrical energy. One of them is for lighting needs. Therefore, it is necessary to save the lighting system so that energy consumption is minimum and the need for lighting is optimal, by controlling light dimming. This paper presents an implementation and testing of a dimming light control using an Arduino Uno microcontroller. The circuit used a 12-volt power supply, as a voltage source, to increase to 42 volts, to meet a lamp voltage, through a dc-dc converter. After obtaining the maximum voltage, a MOSFET cut off the voltage according to the desired light or performance level. The duty cycle was directly proportional to the output voltage, using a PWM coding to get the necessary light intensity. Some testing was conducted, including the measurement point shifting to the side. The testing results show that PMW and LDR decreased as the duty cycle increased. Nevertheless, both decreasing are different, the PWM decreased linearly with a gradient of -2.55 and the LDR decreased hyperbolically. While, the illuminance, current, and power rose as the duty cycle increased. The illuminance increased, tent to be saturated, as the power increased. However, the illuminance was reduced as the PWM and LDR increased. The illuminance decreased slightly as the measurement points shifted to the side.


Introduction
The need for humans and the population that is always increasing will have an impact on increasing the need for electrical energy. One of them is the electricity need for lighting. On other hand, the availability of electrical energy is limited. Based on this, the lighting system should be saved, where the provision of lighting is as optimal as possible, but the energy consumed is minimal. Electrical energy conservation, including lighting systems, is indispensable. Therefore, it is necessary for an efficient lighting system, and vital in homes, offices, industries, urban and rural areas [1].
Based on the procedure for design in buildings regulated in SNI 63-6575-2001, the lighting system can be differentiated into uniform, local, and combined lighting system. In the uniform or even lighting system, this system functions to provide an even and fairly constant level of light throughout the room. The even lighting can be accomplished by installing the armature simultaneously on the ceiling bar either directly or not. For a safe local lighting system, it is necessary to require a high level of light to provide more light than the ambient one. While the combined lighting systems are used for IOP Publishing doi: 10.1088/1757-899X/1212/1/012043 2 those who need high levels of light. By this, it can show the shapes and textures that require the light to come from a certain direction [2].
It can be carried out by measuring it directly using a lux meter measurement tool so that it can be known what the magnitude of the exposure level is in a given work. What is meant by the worksheet is an imaginary horizontal plane located 0.75 meters above the floor in the entire room [2].
There are two main light sources, natural and man-made. The latter has conventionally only two modes, on and off switches. There is not any intermediate-range, whether manually or automatically according to the surrounding condition. This case leads to electrical energy wastage and not effective and not efficient anymore [3][4][5] and may potentially dangerous [6].
In commercial and office sectors, major electrical energy consumption is caused by lighting [7]. The lighting control can be implemented in homes, smart cities, airports, agriculture, parking, malls, universities, industries, and so on [4]. Besides light, color has attracted mankind, especially white color [8]. The lighting is necessary also in a vehicle, including an automobile, and plays an important role to avoid accidents [9][10]. Street lights consume large electrical energy [11]. Therefore, a smart street light reduces energy consumption and maintains costs [12]. The lighting has an important role in outdoor and indoor environments [13], and huge energy is wasted due to lighting in rural and urban areas [14]. It creates also a comfortable atmosphere, such as warm and bright [15].
Based on these various reasons, it is important to conduct an automation system in lighting, for saving, comfort as well as for safety. The light automation system is a cost-effective and safe way to reduce power consumption [16][17], reducing unused electricity and lengthening light lifetime [16]. A dimming light is reducing wasting energy, overcome manual switching, primary cost, and maintenance decrease [17]. There are intermediate levels [3,6,18]. The system can be implemented in workstations, park street lighting, lights, agriculture field monitoring, home automation, etc [3][4]16].
An Android-based spatial lighting arrangement system discussed efficient, practical, and appropriate lighting settings and it is complemented by lighting setting optimizations based on the standard SNI 03-6197-2000. It was also designed practically to be remotely controlled by using a smartphone [21].
For a recent lighting system, it is also necessary to light-emitting diode (LED) lamps. The LEDs consume low energy [6,17], due to cool conditions, long lifetime, and energy-saving due to high illuminance [16,18]. Some researches used LEDs, for smart light [3], touch dimming [6], brightness [5], and luminaire controlling [7], street, color, vehicle head, and rural lighting [1, 4, 8-9, 11-14, 22]. A High Power LED (HPL) is an LED that works several hundred mA to A. HPL is usually used for outdoor lighting or industrial lighting. The use of HPL aims to save costs, because HPL requires a relatively small current, but still has a larger lumen [23].
Pulse Width Modulation (PWM) is generally a means of reproducing the signal width expressed by a pulse in a period, to obtain a different average voltage. PWM can be applied to adjust the power or voltage to turn on the light. In the digital method, each PWM change is influenced by the resolution of the PWM itself. Suppose that the 8-bit digital PWM means that the PWM has a resolution of 2 8 = 256, that is, this PWM output has 256 variations, the variation ranging from 0 -255 which represents a duty cycle of 0-100% of the PWM output [24]. The addition of light dimming is usually a boost converter circuit. It increases DC voltage to a higher level. This circuit is required when the required voltage of electronic components is higher than the available power supply voltage [25].
There have been some researches regarding light dimming in various applications. Generally, they used Arduino Uno microcontroller, LDRs, and LEDs. Nevertheless, they are limited in testing. Based on the previous researches, it is necessary to conduct further research on light dimming design, implementation, and testing. This research involved an HPL, Arduino Uno microcontroller, MOSFET, DC-DC converter, and an LDR. Besides the design and implementation, the research also conducted testing on some parameters, such as PWM, duty cycle, LDR, illuminance, current, power, voltage, and side shifting.

Research Method
The light dimmer circuit uses a 12-volt power supply as a voltage source which then passes through the dc-dc converter to increase the voltage from 12 volts to 42 volts to meet the needs of the used lamps. After obtaining the maximum voltage at the maximum capacity at 100%, the IRF 540N MOSFET functions as a voltage cut off according to the desired light needs or performance level. In this process, the duty cycle will be directly proportional to the output voltage, in the process of setting this duty cycle, it is carried out in the basic software using coding to get the light intensity setting according to the need, as an example of a lamp can be turned on when it is a bright condition, a bit bright, dim, slightly dim and off. Figure 1 shows the block diagram of the research of the light dimming system. The main subsystems are DC supply, DC-DC converter, a lamp, a controller, and a MOSFET. Furthermore, the wiring circuit diagram is shown in Figure 2. In this case, the lamp is HPL 32 watts and an Arduino Uno microcontroller as the controller.

Figure 3. Lighting intensity measurement
A Light Dependent Resistor (LDR) and Lux meter or light meter were used to measure the lighting intensity or illuminance. The LDR value was measured by using a multimeter. Both LDR's and lux meter's values were noted while the lighting intensity was being reduced between 100% and 0% in a 10% step. Figure 4 shows the dimming system circuit. The system consists of a power supply, for DC supply of power, DC-DC converter for the DC voltage regulation, MOSFET and voltage divider circuits for the light dimming for lowering the voltage to insert the microcontroller, an Arduino Uno for the main controller, a computer/laptop for coding of the microcontroller, and a High-Performance Lamp (HPL) for the lighting source.   Figure 5 shows the dimming system circuit when the dimming lighting of 80% (a) and 40% (b), which show a bit bright and a bit dim respectively. The system gives the lighting intensity was enough for the lighting. Thus, based on this testing, the system dimming process ran smoothly.  Figure 9 shows the illuminance as the function of power. The illuminance increased linearly, and to be saturated, as the power increased. Thus, the illuminance will tend to be constant as the power of the lamp continuously.  Figure 10 shows the voltage and power as the current function. Both voltage and power increased linearly as the current increased. Nevertheless, both increasing parameters are different. For the voltage, it is necessary a threshold value of the current, for this case 0.25 ampere to get 21.7 volts of minimum voltage. This phenomenon, especially the voltage against the current, due to knee point existence, is similar to the chart that is revealed in [8]. Nevertheless, the direction of the knee pint is the opposite.  Figure 11 shows the illuminance as a function of the PWM coding. The illuminance decreases linearly as the PWM coding increases. The illuminance varies depending also on the distance to the perpendicular point of the board exposed to the light, as shown in Figure 13.  Figure 11. Illuminance function of coding Figure 12 shows the LDR as the illuminance function. The LDR reduced drastically as the illuminance increased, followed by hyperbolic patterns on various distances from the center. This curve or chart is an improvement and more real than the previous concept, because this chart is obtained from the test results with the resistance measurements on the LDR on the wall illuminated by an HPL lamp [9,26].  Figure 13 shows the illuminances as a function of the distances from the center on various coding. The illuminance reduced slightly as the distance from the center increased.

Conclusion
The microcontroller-based dimming circuit has been successfully implemented. The duty cycle increases, make the PWM coding and LDR decrease linearly and hyperbolically respectively. However, the duty cycle increases, so that the illuminance, current, and power increase too. The power and current increase linearly as the duty cycle increases. The illuminance increases as the power increase linearly. Nevertheless, increasing illuminance tends to be saturated. The voltage and power increase linearly as the current rises. Even though, the voltage chart has a knee point. The illuminance reduces fairly linearly, as then PWM coding increases. The LDR reduces drastically as illuminance increases. Finally, the illuminance decreases slightly as the distance of the measurement point from the center point to the side increases.