MEV Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 Journal of Mechatronics, Electrical Power, and Vehicular Technology e-ISSN: 2088-6985 p-ISSN: 2087-3379 www.mevjournal.com doi: https://dx.doi.org/10.14203/j.mev.2020.v11.11-21 2088-6985 / 2087-3379 ©2020 Research Centre for Electrical Power and Mechatronics - Indonesian Institute of Sciences (RCEPM LIPI). This is an open access article under the CC BY-NC-SA license (https://creativecommons.org/licenses/by-nc-sa/4.0/). Accreditation Number: (RISTEKDIKTI) 1/E/KPT/2015. Lux and current analysis on lab-scale smart grid system using Mamdani fuzzy logic controller Bayu Prasetyo a, *, Faiz Syaikhoni Aziz a, Anik Nur Handayani a, Ari Priharta a, Adi Izhar Bin Che Ani b a Electrical Engineering Department, Universitas Negeri Malang Jalan Semarang No 05, Malang, 65145, Indonesia b Faculty of Electrical Engineering, Universiti Teknologi Mara (UiTM) Kolej Amira Uitm Puncak Alam Road, Selangor, 42300, Malaysia Received 28 November 2019; accepted 30 April 2020; Published online 30 July 2020 Abstract The increasing need for electrical energy requires suppliers to innovate in developing electric distribution systems that are better in terms of quality and affordability. In its development, it is necessary to have a control that can combine the electricity network from renewable energy and the main network through voltage back-up or synchronization automatically. The purpose of this research is to create an innovative lux and current analysis on a lab-scale smart grid system using a fuzzy logic controller to control the main network, solar panel network and generator network to supply each other with lab-scale electrical energy. In the control, Mamdani fuzzy logic controller method is used as the basis for determining the smart grid system control problem solving by adjusting the current conditions on the main network and the light intensity conditions on the LDR sensor. Current conditions are classified in three conditions namely safe, warning, and trip. Meanwhile, the light intensity conditions are classified into three conditions namely dark, cloudy and bright. From the test results, the utility grid (PLN) is at active conditions when the load current is 0.4 A (safe) and light intensity is 1,167 Lux (dark). Then the PLN + PV condition is active when the load current is 1.37 (warning) and the light intensity is 8,680 lux (bright). Finally, the generator condition is active when the load current is 1.6 (trip) and the light intensity is 8,680 (bright). Based on the test results, it is known that the system can work to determine which source is more efficient based on the parameters obtained. ©2020 Research Centre for Electrical Power and Mechatronics - Indonesian Institute of Sciences. This is an open access article under the CC BY-NC-SA license (https://creativecommons.org/licenses/by-nc-sa/4.0/). Keywords: fuzzy logic; smart grid; lux and current; lab-scale. I. Introduction The increase in electricity used by consumers makes electricity suppliers begin to innovate in managing electricity supply so that it remains distributed to consumers with good quality. At the consumer level, many systems have been developed to save or maintain electric power stability, such as back-up voltage systems, the utilization of kWh Exim, Smart Home, building energy management system (BEMS), etc. Then at the distributor level, they have also begun to develop many systems to maintain the stability and the availability of electric power for consumers, for example installing bank capacitors and smart grid systems. The smart grid system is a modern electricity network infrastructure to increase reliability, security, and efficiency also to integrate with renewable energy sources through automatic control [1][2][3]. It is able to integrate the actions of all users, from power generation to consumers with the aim of being more efficient, sustainable, economical and safer electricity supply [4]. It is also considered as the future of electricity grid that can manage the production, transmission and distribution of electricity with modern technology [5][6][7] to solve many problems of the current electricity grid system. Many smart grid designs have been developed to keep the supply quality maintained and some designs have also been designed to be environmentally friendly by scheduling the use of energy supplies from steam power plants and renewable energy sources such as solar panels, water generators, wind generators and so forth. This has begun to be adopted by several countries * Corresponding Author. Tel: +62-838-3393-3230 E-mail address: bayoe.30015@gmail.com https://dx.doi.org/10.14203/j.mev.2020.v11.11-21 http://u.lipi.go.id/1436264155 http://u.lipi.go.id/1434164106 http://mevjournal.com/index.php/mev/index https://dx.doi.org/10.14203/j.mev.2020.v11.11-21 https://creativecommons.org/licenses/by-nc-sa/4.0/ https://crossmark.crossref.org/dialog/?doi=10.14203/j.mev.2020.v11.11-21&domain=pdf https://creativecommons.org/licenses/by-nc-sa/4.0/ B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 12 including countries that have large renewable energy potential. In some developing countries, the smart grid system is classified as new technology and is still being developed. The system starts with the idea of an advanced measurement infrastructure to improve demand management and energy efficiency, building reliable network protection, and assuring the network can improve itself in the event of a disruption or natural disaster [2]. In its development, the smart grid system is often integrated with fuzzy logic as a method of decision making. Fuzzy logic was introduced as a model for handling inaccurate, inconsistent, and inexact information [8][9]. A fuzzy set is an object class with a continuum of membership values. Fuzzy logic uses the rule base to change the value of input crips to the corresponding output crips [10]. By using fuzzy logic controller, we can effectively model complex non-linear systems [10] Broadly speaking, there are three steps to model the system using a fuzzy logic controller, namely Fuzzification, Inference Engine, and Defuzzification. Fuzzification is used to change from crisp input to fuzzy variables so that it can be processed. The next step is the Inference Engine which is fuzzy input reasoning and giving rules. Then, the final step is defuzzification which converts the fuzzy output from the inference engine results to crips value based on membership function [10]. In this study, Mamdani fuzzy logic controller [11] is combined in the lab-scale smart grid system with lux and current as input parameters. Some studies use Mamdani fuzzy as a system method developer, for example, Mamdani fuzzy inference approach to assess ecological security [12] and rule-based fuzzy control methods for resetting the static pressure [13], and in this study Mamdani fuzzy logic controller is used to control smart grid. Previously, several research projects that are related to the smart grid system had been carried out. The project such as smart grid system on a smart home by controlling the load based on the SOC battery condition where the battery input was obtained from a hybrid solar panel system with a wind generator [14]. The purpose of this project was to manage the burden so that it can reduce the use of conventional energy that is not needed. The research resulted in battery discharge off and load off when there is no grid energy if SOC ≤ 30 %. Then the engine load will be off when 30 % < SOC < 70 %. Finally, all loads will light up if the value of SOC ≥ 70 %. In other similar studies, there have been several system design developments by giving some switching to the renewable energy system output so that it can be controlled. The study was conducted by combining distributed power supply, wind generators, and solar panels in an AC bus with the parameters used in the control system is the SOC battery [15]. From the research results, it was known that the system besides being able to produce high- quality electricity, it could also transfer electrical energy quickly to steady-state with a smooth system flow change mechanism [15]. Referring to the researches, it can be concluded that the mechanism of changing energy sources is the key to produce good electricity by utilizing conventional energy and renewable energy. This source change mechanism is adopted in the development of lux and current analysis on a lab- scale smart grid system using the Mamdani fuzzy logic controller. The difference between this research and the previous research is in the control parameters used. Previous studies referred to SOC batteries, while this research focuses more on environmental and load current conditions. Control of energy sources is regulated to maximize the potential for renewable energy and increase the efficiency of using conventional sources. The purpose of this research is to create an intelligent control system that can determine the most efficient energy source to be used based on the parameters of the intensity of light and current at the lab-scale. This system should be able to monitor the value of light intensity in the environment around the system and the current conditions of the utility grid. II. Materials and Methods In general, the smart lab-scale smart grid system has a system whose working principle determines the source for the load based on current conditions and the intensity of the light on the prototype. There are three sources with utility grid (PLN) or sources from main suppliers as the main sources. Then, the second source is a 100 Wp solar panel with an AC current limit after the inverter of 2 A and the third source is a genset with a current capacity of 6 A. Figure 1 illustrates the lab-scale smart grid system flowchart to get a better understanding of how this system works. The development of a lab-scale smart grid system is divided into two constructions namely hardware construction and fuzzy construction. The hardware construction focuses on the hardware used in the development while the fuzzy construction focuses on the formation of fuzzy rules as a basis for solving control problems based on light and current intensity parameters. A. Hardware construction The hardware construction lab-scale smart grid system is the development of magnetic coordination props using contactors. These visual aids are then developed by using a microcontroller and several control components to connect the energy source. In general, hardware construction can be seen in Figure 2 then the workmanship system of the lab-scale smart grid system can be seen in Figure 3, and the components used in developing the lab-scale smart grid system are available in Table 1. The lab grid-scale design of the smart grid system has two main blocks namely the control block and the data computing block. The control block consists of a magnetic control display device in the form of a case that is developed by adding Arduino Mega and a four Channels relay as a conversion from DC control to AC control. Then, the data computation block B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 13 consists of computers that have Arduino IDE and PLQ-DAX installed as a parameter reader. The design of the lab-scale smart grid system and the control block design can be seen in Figure 4 and Figure 5. B. Fuzzy construction This lab-scale smart grid system is controlled by a microcontroller in the form of Arduino Mega with decision making determined by the Mamdani fuzzy logic method. Problem-solving with the fuzzy logic controller has three steps namely Fuzzification, Inference, and Defuzzification with the following explanations. 1) Fuzzification Fuzzification is a process of changing the input from explicit forms into more linguistic forms. In fuzzification, all data is presented in the form of fuzzy sets using the membership function. In the development of the lab-scale smart grid system, there are two input parameters namely current and light intensity. Each input data will be grouped or clustered by K-Means technique. During the clustering process, turns out that in the light intensity data group, the three conditions have a wide range so system normalization is needed for analysis. The results of light intensity data groups division can be seen in Table 2 and the results of the current data groups distribution are in Table 3. Based on the results of clustering, the membership function is generated. It is used to map input data points into membership values. Mapping the lab-scale smart grid system membership Table 1. Components in the lab-scale smart grid system No. Component Total Specification 1. Magnetic contactor 3 pieces 14 pin model: S-N25/coil380 VAC 2. 1-phase MCB 1 piece 6 Amperes 3. 1-phase MCB 2 pieces 2 Amperes 4. Arduino Mega 1 piece 5. Thermal overload relay 3 pieces TH-N12KP 6. Relay 4 channels 1 piece 7. Push button NO 4 pieces 8. Push button NC 2 pieces 9. Indicator lamp 4 pieces 5 W/220 VAC 10. Emergency button 1 piece 11. LDR sensor 1 piece LDR 12. Current sensor 1 piece ACS712 13. Terminal block 14 pieces TB2503 3 pole 25 A Table 2. Division of light intensity data groups before and after normalization Condition Division of data groups (lux) Preliminary data Data after normalization Dark 0 – 107 0 – 3,931 Cloudy 10.8 – 5,752 3,543 – 6,997 Bright 1,075 – 10,527 6,708 – 10,527 Start Input Parameters: Current and Lux Current Parameter: Secure Current Parameter: Warning Current Parameter: Trip Lux Parameter: Cloudy Lux Parameter Dark? Lux Parameter: Dark? Lux Parameter: Dark? Lux Parameter: Cloudy Lux Parameter: Cloudy Output: PLN Output: PLN Output: Genset Output: PLN+PV Output: PLN+PV Output: PLN+PV Output: PLN+PV Output: Genset Output: PLN Finish Y Y Y NN Y NN Y Y N N Figure 1. Lab-scale smart grid system flowchart B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 14 function is done by displaying the clustering result using LabVIEW software which can be seen in Figure 6 and Figure 7. After the membership function is known, the next step is to determine the degree of membership or 𝜇[𝑥]. The two inputs use three types of membership functions, namely linear up, trapezoidal and linear down so that in finding the value 𝜇[𝑥] there are three different ways according Figure 2. Smart grid lab-scale construction Figure 3. Smart grid lab-scale maintenance B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 15 to the location of the input. The linear up membership function has the characteristics of a straight line starting from the lowest domain value (𝜇[𝑥] = 0) on the left side, then moving right towards the domain with a greater degree of membership value. The membership function used in the next input is the trapezoid. Mapping inputs into degrees of membership are represented by an isosceles trapezoidal form which can be interpreted as having several main points of input having a degree of membership equal to one. Finally, the membership function used is linear down. The linear descending membership function has the characteristic of a straight line starting from the highest domain value (𝜇[𝑥] = 1) on the left side, then moving right towards the domain with a smaller degree of membership. The form of the three membership functions can be seen in Figure 8. In linear rise, determining the value of 𝜇[𝑥] is by using Equation (1). In linear down, determining the value of 𝜇[𝑥] is by using Equation (2). In membership of the trapezoid function, determining the value of 𝜇[𝑥] is by using Equation (3). After the grouping process or clustering is completed, the fuzzification stages or the stage of changing from input data to fuzzy input forms, the next stage is inference. 𝑓(𝑥) = � 0, 𝑥 ≤ 𝑎 (𝑥 − 𝑎) (𝑏 − 𝑎)⁄ , 𝑎 < 𝑥 < 𝑏 1, 𝑥 ≥ 𝑏 (1) 𝑓(𝑥) = � 0, 𝑥 ≥ 𝑏 (𝑏 − 𝑥) (𝑏 − 𝑎)⁄ , 𝑎 < 𝑥 < 𝑏 1, 𝑥 ≤ 𝑎 (2) 𝑓(𝑥) = � 0, 𝑥 ≤ 𝑎 ∥ 𝑥 ≥ 𝑑 (𝑥 − 𝑎) (𝑏 − 𝑎)⁄ , 𝑎 < 𝑥 < 𝑏 (𝑑 − 𝑥) (𝑑 − 𝑐)⁄ , 𝑐 < 𝑥 < 𝑑 1, 𝑏 ≤ 𝑥 ≤ 𝑐 (3) 2) Inference engine using Mamdani model The inference engine stage is the reasoning stage for the fuzzy input obtained from the fuzzification process and sent into the knowledge base that contains fuzzy rules to produce fuzzy output. The inference engine process is carried out using the Mamdani model. The model is often referred to as the Min-Max model [11]. The Mamdani fuzzy rules are stated in the form Equation (4), IF (x is A) AND (y is B) THEN (z is C) (4) where the values of A, B, and C are fuzzy shapes, while x, y, z are crips values. The application of the functional implication in the Mamdani model uses the MIN function, while the composition between rules uses the MAX function to produce a new fuzzy set. In this stage, there is a process that must be carried out by beginning to create a knowledge base/truth table containing rules. The knowledge base of smart grid using LaC system can be seen in Table 4. Based on Table 4, IF-THEN rules can be determined a number of 9 conditions which can be seen in Table 5. Seeing that the inference stage is a stage that combines two degrees of membership, it is necessary to have fuzzy set operations that will produce fire strength or α -predicate values in each rule. In the inference process using the Mamdani Model, the value of the degree of membership in each rule is applied with the minimum implication function (MIN) of the linguistic value using the conjunction rule (∩). The formula used to determine α -predicates with minimum implied functions can be seen in Equation (5). Table 3. Division of flow data groups Tim Condition Division of data groups (A) 1 Secure 0 – 1.3 2 Warning 1 – 1.7 3 Trip 1.4 – 2 AC Control DC Control CT Power Source Sensor Control Block data computing block PLN PV Genset LDR ACS712 Load Figure 4. Design of lab-scale smart grid system Table 4. Smart grid system knowledge base Lux parameter Current parameter Secure Warning Trip Dark PLN GENSET GENSET Cloudy PLN PLN + PV GENSET Bright PLN PLN + PV PLN + PV Table 5. Fuzzy rules for the inference process No. Rule 1. IF ‘ light intensity’ IS ‘ dark’ AND ‘ current’ IS ‘ secure’ THEN ‘ CONTACT’ IS ‘ PLN’ 2. IF ‘ light intensity’ IS ‘ dark’ AND ‘ current’ IS ‘ warning’ THEN ‘ CONTACT’ IS ‘ GENSET’ 3. IF ‘ light intensity’ IS ‘ dark’ AND ‘ current’ IS ‘ trip’ THEN ‘ CONTACT’ IS ‘ GENSET’ 4. IF ‘ light intensity’ IS ‘ cloudy’ AND ‘ current’ IS ‘ secure’ THEN ‘ CONTACT’ IS ‘ PLN’ 5. IF ‘ light intensity’ IS ‘ cloudy’ AND ‘ current’ IS ‘ warning’ THEN ‘ CONTACT’ IS ‘ PLN+ PANEL’ 6. IF ‘ light intensity’ IS ‘ cloudy’ AND ‘ current’ IS ‘ trip’ THEN ‘ CONTACT’ IS ‘ GENSET’ 7. IF ‘ light intensity’ IS ‘ bright’ AND ‘ current’ IS ‘ secure’ THEN ‘ CONTACT’ IS ‘ PLN’ 8. IF ‘ light intensity’ IS ‘ bright’ AND ‘ current’ IS ‘ warning’ THEN ‘ CONTACT’ IS ‘ PLN+PANEL’ 9. IF ‘ light intensity’ IS ‘ bright’ AND ‘ current’ IS ‘ trip’ THEN ‘ CONTACT’ IS ‘ PLN+PANEL’ B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 16 𝛼 − 𝑝𝑟𝑒𝑑𝑖𝑐𝑎𝑡𝑒 = 𝜇(𝑥1) ∩ 𝜇(𝑥2) = min{𝜇(𝑥1), 𝜇(𝑥2)} (5) where 𝑥1 is the degree of membership of set 1 and 𝑥2 is the degree of membership of set 2. Then after applying the MIN function, an output linguistic value is obtained which is then composed by the MAX function with the disjunction (∪) rule. The formula used to determine the new μ value from the rule composition can be seen in Equation (6). 𝜇𝑡ℎ𝑒𝑛 = {𝛼 − 𝑝𝑟𝑒𝑑𝑖𝑐𝑎𝑡𝑒 𝜇(𝑥1)} ∪ {𝛼 − 𝑝𝑟𝑒𝑑𝑖𝑐𝑎𝑡𝑒 𝜇(𝑥2)} = max{𝛼 − 𝑝𝑟𝑒𝑑𝑖𝑐𝑎𝑡𝑒 𝜇(𝑥1), 𝛼 − 𝑝𝑟𝑒𝑑𝑖𝑐𝑎𝑡𝑒 𝜇(𝑥2)} (6) where α-predicate 𝜇(𝑥1) is output linguistic value 1 and α-predicate 𝜇(𝑥2) is output linguistic value 2. In the lab-scale smart grid system research, there are several rules that are analysed with the Mamdani model Inference Engine with the results are presented in Table 6. After the α-predicate value is known, it will produce a degree of fuzzy output membership. From this degree of fuzzy membership, a single fuzzy set will be produced which will be Table 6. Fuzzy inference results using the Mamdani model Rule Inference MIN MAX OUTPUT For L1 1252 dan C 0.78 obtained 2 fuzzy input data, G(1), A(1) 1 IF LI IS DARK (1) AND C IS SECURE (1) THEN OUTPUT CONTACT IS PLN 1 1 PLN For L1 1928 dan C 1.11 obtained 3 fuzzy input data, G(1), A(0.633), MT (0.367) 1 IF LI IS DARK (1) AND C IS SECURE (0,633) THEN OUTPUT CONTACT IS PLN 0.633 0.633 PLN 2 IF LI IS DARK (1) AND C IS WARNING (0,367) THEN OUTPUT CONTACT IS GENSET 0.633 0.367 GENSET 4 IF LI IS CLOUDY (0,915) AND C IS SECURE(0,233) THEN OUTPUT CONTACT IS PLN 0.233 0.085 GENSET For L1 4049 dan C 1.23 obtained 3 fuzzy input data, G(1), A(0.233), MT (0.767) 4 IF LI IS CLOUDY (1) AND C IS SECURE (0,233) THEN OUTPUT CONTACT IS PLN 0.233 0.233 PLN 5 IF LI IS CLOUDY (1) AND C IS WARNING (0,767) THEN OUTPUT CONTACT IS PLN+PV 0.767 0.767 PLN+PV For L1 8725 dan C 1.85 obtained 2 fuzzy input data, C (1), T (1) 9 IF LI IS BRIGHT(1) AND C IS TRIP (1) THEN OUTPUT CONTACT IS PLN+PV 1 1 PLN+PV For L1 9476 dan C 0.82 obtained 2 fuzzy input data, C (1), A (1) 7 IF LI IS BRIGHT(1) AND C IS SECURE (1) THEN OUTPUT CONTACT IS PLN+PV 1 1 PLN PC and Arduino communication 4 channel Relay digital pin to contactor A1 Control Block Arduino digital pin to 4 channel Relay IN pin AC Control DC Control Figure 5. Lab-scale smart grid system full block design Figure 6. Membership function of lux B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 17 used at the defuzzification stage. The degree of fuzzy output membership in the lab-scale smart grid system can be seen in Figure 9. 3) Defuzzification In the inference engine stage, the fuzzy output is data with linguistic value types. Meanwhile, data is needed in numerical form in the control system, therefore, it is necessary to change the value of the data from fuzzy output to numeric form or called the defuzzification stage. The defuzzification process in the Mamdani Model uses the formula according to Equation (7) as follow. 𝑍∗ = ∑𝑧.𝜇(𝑧) ∑𝜇(𝑧) (7) where 𝑍∗ is defuzzification value, ∑𝑧. 𝜇(𝑧) is moment for all region of the rule composition, and ∑𝜇(𝑧) is membership value. Based on MIN and MAX values in the inference process using the Mamdani model, it can be seen the value of 𝑍∗ with the results shown in Table 7. Figure 7. Membership function of current Figure 8. Membership function: (a) Linear up; (b) Linear down; and (c) Trapezoid Table 7. Deffuzification results Inference Min Max Defuzzification if li is dark (1) and c is secure (1) then output contact is PLN 1 1 0.75 if li is dark (1) and c is secure (0.633) then output contact is PLN 0.633 0.633 0.97 if li is dark (1) and c is warning (0.367) then output contact is GENSET 0.633 0.367 if li is dark (1) and c is secure (0.2) then output contact is PLN 0.2 0.2 1.38 if li is dark (1) and c is warning (0.8) then output contact is GENSET 0.8 0.8 if li is dark (1) and c is secure (0.233) then output contact is PLN 0.233 0.233 1.34 if li is dark (1) and c is warning (0.767) then output contact is GENSET 0.767 0.767 if li is dark (1) and c is secure (0.233) then output contact is PLN 0.233 0.233 1.34 if li is dark (1) and c is warning (0.767) then output contact is GENSET 0.767 0.767 if li is dark (0.085) and c is secure (0.915) then output contact is PLN 0.085 0.233 1.12 if li is dark (0.085) and c is warning (0.767) then output contact is GENSET 0.085 0.767 if li is cloudy (0.915) and c is secure(0.233) then output contact is PLN 0.233 0.085 if li is cloudy (0.915) and c is warning (0.767) then output contact is PLN+PV 0.767 if li is cloudy (1) and c is secure (0.233) then output contact is PLN 0.233 0.233 1.15 if li is cloudy (1) and c is warning (0.767) then output contact is PLN+PV 0.7676 0.767 if li is bright(1) and c is trip (1) then output contact is PLN+PV 1 1 1.35 if li is bright(1) and c is secure (1) then output contact is PLN+PV 1 1 0.75 B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 18 III. Results and Discussions The lab-scale smart grid system is particularly a load source control system that will be used based on the LaC or lux and current parameters by utilizing the LDR as a light intensity information finder and the ACS712 sensor as a current data finder for further processing on Arduino Nano with the Fuzzy Logic Controller method. In the development process, there are two stages of testing to know the results or performance of the developed system, namely sensor testing and overall system testing. A. Sensor test result Sensor testing is performed to determine the performance of the sensors used to produce accurate data. This test is carried out to ensure the accuracy of the input data which will later be processed on Arduino Nano. This test does not use the Fuzzy Logic method as a controller and only uses ordinary programming to bring up input parameter values. 1) Current sensor test The first test is the ACS 712 sensor to measure AC current. This test is done by comparing the reading of the ACS 712 current sensor with the amperemeter. The results of the reading show the current values that have approached the measurement results of the amperemeter. The results of reading the current sensor and measuring instrument can be seen in Figure 10. It can be concluded that the ACS712 sensor can be used as a current parameter actuator because the reading value is close to the actual current. Based on the measurement, the error value of the current sensor is 3.57 %. 2) Light intensity sensor test Light intensity was detected by LDR for 4 hours 33 minutes by taking data every 30 seconds using readings with PLQ-DAX software. The experiment started at 10:22 am until 2:55 pm. The LDR trial results can be seen in Figure 11. From the test results, it is known that the lux value that is read by the LDR is unstable or too volatile with a relatively short interval of time. Then, the repair is done at 12.00 pm. After that, it is retested and the reading of the light intensity improves even though it tends to fall due to cloudy. It can be concluded that the two sensors can be used to obtain data from the parameters of current and light intensity. B. System test In system testing, a program containing lab-scale smart grid system control with the Mamdani fuzzy logic controller method is uploaded to the Arduino board that has been connected to sensors and Figure 10. Comparison of ACS712 and amperemeter measurements Figure 9. Membership degree in fuzzy output B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 19 control components. Then, the system is tested by changing the values of the current parameters and light intensity. Replacement of the current parameter value is done by adding or reducing the load while changing the light intensity parameter by replacing the light source with several other light sources that have different light intensities. The preparation in testing can be seen in Figure 12. The test was carried out with three conditions representing the three outputs namely PLN (utility grid), PLN + PV, and GENSET. In the experiment, the voltage source is not entered into the system and only the control of the smart grid system is tested with the result presented in Figure 13. The first test is to make the control conditions using PLN so that the input conditions are low light intensity and low load. Then, the system is run and the results of monitoring on the acquisition of Microsoft Excel with the help of PLQ-DAX. Test results with conditions of low light intensity and low load indicate that the red indicator light and contactor 1 are on. This indicates that the source used is PLN in accordance with the desired output conditions. Then, the second experiment is carried out by changing the parameter values so that the output becomes PLN + PV by increasing current and light intensity. The test results note that contactors 1 and 2 are active than red lights and yellow lights are also on. This indicates that the sources used are PLN and Photovoltaic synchronization. Finally, the third test is done by modifying the input thus the output that will appear is the GENSET by raising the current to near the upper limit and lowering the value of the light intensity. The results of the test turn out to be appropriate, namely contactor 3 is active and the green indicator light is on. The first, second, and third test results can be seen in Figure 14. Figure 11. LDR test result data Figure 12. Smart grid system testing using LaC B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 20 IV. Conclusion Lux and current analysis on a lab-scale smart grid system using the Mamdani fuzzy logic controller can determine the most efficient energy source by considering the conditions of light and current intensity parameters. This system utilizes renewable energy when the energy source from the sun is detected by an LDR sensor, especially when there is an increase in current demand from the installed load. This working principle increases the potential for utilizing renewable energy sources by prioritizing the supply of electrical energy from RE rather than increasing the demand for electrical energy from the utility grid. This smart grid system development can also reduce the use of electrical energy from the utility grid because there is a control system that regulates the power flow scheme when the load on the utility system approaches the highest capacity of the utility grid. LaC-based smart grid can be developed by adding several supporting components in accordance with voltage back-up and synchronization rules so synchronization can be better. With a few adjustments, this system can be implemented on a large scale electricity network system. Declarations Author contribution All authors contributed equally as the main contributor of this paper. All authors read and approved the final paper. Funding statement This research did not receive any specific grant from funding agencies in the public, commercial, or not-for- profit sectors. Conflict of interest The authors declare no conflict of interest. Additional information No additional information is available for this paper. Figure 13. Testing of smart grid system using LaC Figure 14. First testing (left), second testing (middle), third testing (right) results B. Prasetyo et al. / Journal of Mechatronics, Electrical Power, and Vehicular Technology 11 (2020) 11-21 21 References [1] V.C. Gungor, B. Lu, and G.P. Hancke, “Opportunities and challenges of wireless sensor networks in smart grid,” IEEE Trans. Ind. Electron., 2010. [2] F. Rahimi and A. Ipakchi, “Demand response as a market resource under the smart grid paradigm,” IEEE Transactions on Smart Grid., 2010. [3] C. Cecati et al., “Smart operation of wind turbines and diesel generators according to economic criteria,” IEEE Trans. Ind. Electron., 2011. [4] M.L. Tuballa and M.L. Abundo, “A review of the development of Smart Grid technologies,” Renewable and Sustainable Energy Reviews., 2016. [5] N. Anku, J. Abayatcye, and S. Oguah, “Smart grid: An assessment of opportunities and challenges in its deployment in the ghana power system,” in 2013 IEEE PES Innovative Smart Grid Technologies Conference, ISGT 2013, 2013. [6] H. Hou et al., “A brief analysis on differences of risk assessment between smart grid and traditional power grid,” in Proceedings - 2011 4th International Symposium on Knowledge Acquisition and Modeling, KAM 2011, 2011. [7] L. Peng and G.S. Yan, “Clean energy grid-connected technology based on smart grid,” in Energy Procedia, 2011. [8] L.A. Zadeh, “Fuzzy logic,” in Computational Complexity: Theory, Techniques, and Applications, 2013. [9] P.V.S. Reddy, “Generalized fuzzy logic for incomplete information,” in IEEE International Conference on Fuzzy Systems, 2013. [10] L. Mahardika et al., “Optimization of light tracker movement using fuzzy logic control,” in 2018 International Conference on Information and Communications Technology, ICOIACT 2018, 2018. [11] I. Iancu, “A Mamdani type fuzzy logic controller,” in Fuzzy Logic - Controls, Concepts, Theories and Applications, 2012. [12] J. Sun et al., “A Mamdani fuzzy inference approach for assessing ecological security in the Pearl River Delta urban agglomeration, China,” Ecol. Indic., 2018. [13] X. Li et al., “Rule-based fuzzy control method for static pressure reset using improved Mamdani model in VAV systems,” J. Build. Eng., 2019. [14] A. Tascikaraoglu et al., “Smart grid-ready concept of a smart home prototype: A demonstration project in YTU,” in International Conference on Power Engineering, Energy and Electrical Drives, 2013. [15] W. Liu et al., “Smart Micro-grid System with Wind/PV/Battery,” in Energy Procedia, 2018. https://doi.org/10.1109/TIE.2009.2039455 https://doi.org/10.1109/TIE.2009.2039455 https://doi.org/10.1109/TIE.2009.2039455 https://doi.org/10.1109/TSG.2010.2045906 https://doi.org/10.1109/TSG.2010.2045906 https://doi.org/10.1109/TSG.2010.2045906 https://doi.org/10.1109/TIE.2011.2106100 https://doi.org/10.1109/TIE.2011.2106100 https://doi.org/10.1109/TIE.2011.2106100 https://doi.org/10.1016/j.rser.2016.01.011 https://doi.org/10.1016/j.rser.2016.01.011 https://doi.org/10.1016/j.rser.2016.01.011 https://doi.org/10.1109/ISGT.2013.6497800 https://doi.org/10.1109/ISGT.2013.6497800 https://doi.org/10.1109/ISGT.2013.6497800 https://doi.org/10.1109/ISGT.2013.6497800 https://doi.org/10.1109/KAM.2011.57 https://doi.org/10.1109/KAM.2011.57 https://doi.org/10.1109/KAM.2011.57 https://doi.org/10.1109/KAM.2011.57 https://doi.org/10.1016/j.egypro.2011.10.030 https://doi.org/10.1016/j.egypro.2011.10.030 http://doi.org/10.1007/978-1-4614-1800-9_73 http://doi.org/10.1007/978-1-4614-1800-9_73 https://doi.org/10.1109/FUZZ-IEEE.2013.6622305 https://doi.org/10.1109/FUZZ-IEEE.2013.6622305 https://doi.org/10.1109/FUZZ-IEEE.2013.6622305 https://doi.org/10.1109/ICOIACT.2018.8350695 https://doi.org/10.1109/ICOIACT.2018.8350695 https://doi.org/10.1109/ICOIACT.2018.8350695 https://doi.org/10.1109/ICOIACT.2018.8350695 https://doi.org/10.5772/36321 https://doi.org/10.5772/36321 https://doi.org/10.1016/j.ecolind.2018.07.011 https://doi.org/10.1016/j.ecolind.2018.07.011 https://doi.org/10.1016/j.ecolind.2018.07.011 https://doi.org/10.1016/j.jobe.2018.12.005 https://doi.org/10.1016/j.jobe.2018.12.005 https://doi.org/10.1016/j.jobe.2018.12.005 https://doi.org/10.1109/PowerEng.2013.6635850 https://doi.org/10.1109/PowerEng.2013.6635850 https://doi.org/10.1109/PowerEng.2013.6635850 https://doi.org/10.1109/PowerEng.2013.6635850 https://doi.org/10.1016/j.egypro.2018.09.171 https://doi.org/10.1016/j.egypro.2018.09.171 Introduction II. Materials and Methods A. Hardware construction B. Fuzzy construction 1) Fuzzification 2) Inference engine using Mamdani model 3) Defuzzification III. Results and Discussions A. Sensor test result 1) Current sensor test 2) Light intensity sensor test B. System test IV. Conclusion Declarations Author contribution Funding statement Conflict of interest Additional information References