Optimization of Piezoelectric Sensor Based Lighting Power Management Using Fuzzy Logic Mamdani

−Information is a very important thing from time to time. Lighting is needed by humans to support their daily activities. The problem of the lighting sector today is energy efficiency which is still not resolved. Where the use of electricity for lighting is still using old technology that is not environmentally friendly and costs a lot of money per month. One of the concepts of IoT, namely smart lighting, emerged as a solution to overcome problems in the lighting sector. However, the current smart lighting still requires a direct power source from the government (PLN), In addition, sectors such as tourist attractions in rural areas still need to be considered because there are still many areas that do not have a power source that can be used for street lighting. the tourist attraction. So we need a smart lighting technology that can produce its own power source to reduce the electricity costs that must be incurred. This study aims to build a tool or device that can manage and optimize the energy expended by building an IoT device using a piezoelectric sensor as the main material to generate an electric field that will produce electrical energy for lighting or lighting in rural tourist destinations and using fuzzy algorithms. Mamdani logic is a determinant of the intensity of the light obtained from the light sensor on the IoT device. The overall results of the system that has been built can work properly and the Mamdani fuzzy algorithm can be used properly with an accuracy of 93% power saving at the time of testing. In addition, the monitoring system built is also following the data obtained from the system. The suitability between the fuzzy system and Matlab as a whole is in accordance with the value of 100%.


INTRODUCTION
Information is a very important thing from time to time. Lighting is needed by humans to support their daily activities. With the development of the times and the increasing number of infrastructure being built, of course, it will not be separated from lighting or lighting, one of which is the public area. Such as parks, mosques, tourist attractions, and others that require a lot of lighting to support the activities to be carried out in the area. One of the important issues is lighting in rural tourism objects, which still do not have access to adequate electricity and are still relatively new. In addition, access to these attractions does not yet have lighting because they still do not have a power source and have not been considered properly by the local government.
One of the concepts of IoT, namely smart lighting, emerged as a solution to overcome problems in the lighting sector. However, the current smart lighting still requires a direct power source from the government (PLN). So we need a smart lighting technology that can produce its own power source to reduce the electricity costs that must be incurred. In 2017, research was carried out on the Design and Construction of LDR Modified PJU Lamp Installations Based on Piezoelectric Materials on Speed bumps. This study utilizes a piezoelectric sensor as the main power source for lighting public street lights (PJU) and uses an LDR sensor as a light sensor to detect ambient conditions. The system built in this study utilizes motorized vehicles as the main source for suppressing sensors. The system built is a speed bump by placing a piezoelectric sensor under the speed bump, which will generate an electric field and will be stored in the batter [1] In 2015, research was conducted on energy saving by implementing an intelligent system for Public Street Lighting (PJU) using the Mamdani fuzzy optimization algorithm, which is applied to the determination of the optimization value of the light intensity on the PJU lamp and the determination of the flame of the lamp [2].
This study has differences from the two previous studies. Namely, this study utilizing the kinetic energy of the visitor's footsteps and utilizing the Mamdani fuzzy logic algorithm as a regulator of light intensity. The device to be built is in the form of an IoT device that will be integrated into rural tourism places that can produce electrical energy by using the number of tourists in the form of pressure from the weight of each tourist who presses the piezoelectric sensor, which will then generate an electric field and will be used for lighting lights in the area. The tourist destination. In addition to using a piezoelectric sensor, this study will use the Mamdani fuzzy logic algorithm, which functions to determine the intensity of the light emitted by the lamp.
This study aims to build a tool or device that can manage and optimize the energy expended by building an IoT device using a piezoelectric sensor as the main ingredient to generate an electric field that will generate electrical energy for lighting or lighting in a crowded area of visitors and using a fuzzy algorithm. Mamdani logic is a determinant of the intensity of the light obtained from the light sensor on the IoT device.
The final project research will apply Internet of Things (IoT) technology with the concept of smart lighting by implementing the Mamdani fuzzy logic algorithm into the device to be built as optimization of energy management. This chapter will focus on system flow diagrams, Mamdani fuzzy logic optimization, system architecture, and test scenarios.

Literature Study
a) In this study, a street lamp based on Smart Lighting and a website were designed for real-time monitoring of street lamp conditions. The way this system works begins with the Light Dependent Resistor (LDR) sensor detecting the light intensity to indicate when the light is on or not, and then the Microwave sensor will detect whether or not the object is moving. Furthermore, the data will be processed by Arduino, and the results of the data will be sent via LoRa. The data received is in the form of electrical energy consumption in the lamps that will be displayed on the Website. If the lamp does not send data, it is assumed that the lamp is damaged; at that time, a notification will be sent to the email to facilitate the process of monitoring the damaged street lamp.
With this system, the use of street lamps becomes more efficient because the lamps are bright 48% of the 12 working hours and the user can easily monitor the damaged street lamps directly using the internet network [3]. b) Smart lighting is a way to save energy by adapting light into various kinds using an on/off switch. Smart lighting technology uses a lighting device such as LED lights, sensors, and IP devices as a link. The LED itself has [4] advantages in addition to saving energy; LEDs also have various colors so that they can be used for various purposes. In this study, LEDs are used to emit light with a certain intensity depending on the brightness of the room. Smart lighting itself requires several supports, such as a wireless sensor network (WSN) as a wireless communication network and consists of several sensors placed in place to monitor the condition of a system. This sensor will inform real-time conditions so that it can be received by users who are supported by network technologies such as IoT with dynamic global network infrastructure and have automatic configuration capabilities on communication protocols that are easy to operate. Smart lighting can monitor the state of lights and sensors from the intensity of light in the room and outside the room. Therefore, smart lighting is very effectively used for the process of saving electrical power [5]. c) Understanding the Internet of Things or commonly referred to as IoT today, is marking a transitional phase in the evolution of the internet which is distinguished by great connectivity and interaction with the physical world. The Internet of Things penetrates more application domains as well as many IoT-based systems that are increasingly complex, versatile, and resource-rich. IoT also needs to serve one or more applications with various purposes and changes [6] d) In commercial buildings, lighting is a major part of energy consumption. Energy-saving lighting in commercial buildings has aroused great interest among researchers. Achieving energy savings and satisfactory lighting comfort are both major goals in designing a lighting system. In this research, the fuzzy logic controller is designed by considering daylight, movement information, and lighting comfort. Digital Protocol(DALI) is used to communicate controllers and LED luminaires. Simulation The results show that an uncontrolled lighting system can provide sufficient lighting. The lighting system provides greater controllability to make the lighting environment operate in the most energy-efficient state. The experimental results show that by using the controller design, significant lighting energy can be saved up to 57.06%. Offices where smart lighting is installed can automatically adjust lighting output based on user movement and allow users to choose their own lighting preferences[7] e) In some research in 2020, Mamdani fuzzy logic algorithm is one of the algorithms that can be applied in intelligent systems. Mamdani fuzzy algorithm is one part of the Fuzzy Inference System that is useful for making withdrawals the best conclusion or decision in an uncertain problem. This research focuses the calculations of fuzzy logic algorithms in providing answers to uncertainties found in smart home systems that are used to control the speed of computer fans and lights; the factors that become uncertain in controlling a fan is the temperature and humidity of the room, and for the lamp, it has a light intensity factor, and local time, for these factors the researchers used the standard reference of the Hygienic Huminity Guide. Through research, In this case, it can be seen that using the Mamdani fuzzy logic algorithm can give a result in the form of a decision to determine how fast a fan should rotate based on a factor the temperature and humidity in the room and the level of light intensity that must be light out [8] f) This research is a form of data collection and the characteristics of the piezoelectric sensor used to apply to the soles of the feet of a bipedal robot that runs at different walking speeds. The speed of the walking robot used is 5 cm/second or fast speed, 7 cm/second or speed medium, and 10 cm/sec or slow speed. Then the resulting voltage and current will be compared with the voltage and current data obtained using the same parameters different, namely the human body weight. Sensors arranged in parallel will be suppressed by weight humans weighing 57 Kg, 61 Kg, and 64 Kg. When a piezoelectric sensor is applied to a bipedal robot with three different running speeds, the sensor is capable of producing a voltage ranging from 3.92 Volt up to 4.17 Volts and a total current of 3.30 mA to 3.61 mA [9]. g) A 2012 study conducted research by utilizing vibrations from vehicle suspensions. When the vehicle is moving will cause vibrations caused by the wheels in contact with the road surface. Currently, there are many studies that discuss the use of vibration energy in suspensions and converted into electrical energy. Multi-layer piezoelectric vibration energy harvesting mechanism (M-L PZTVEH) is a mechanism that uses the piezoelectric method with multi-layer technology. M-L mechanism The PZT VEH used is mounted on a semitrailing type suspension system and arranged in series on the spring. This matter is intended so that the force that comes from the spring can be used directly to suppress the mechanism. Inside there is a piezoelectric multilayer (M-L PZT). By doing modeling and analysis, it will It is known how much influence the installation of the M-L PZT VEH mechanism has on the vibration response of the vehicle. The study in this study was conducted on the vibration response in vehicles, and the energy that can be used in the M-L PZT VEH mechanism is generated in the frequency domain and time domain by providing excitation harmonics and steps.
The results of the analysis stated that the addition and placement of the M-L PZT VEH mechanism did not show the difference in the vibration response of the vehicle, so the M-L PZT VEH mechanism does not interfere with vehicle comfort. At a vehicle speed of 45.8 km/h, the M-L PZT VEH mechanism will produce a voltage of 17.5 volts and power of 0.0175 watts [10] h) Setting the traffic light is one of the efforts used to be able to regulate the speed of traffic lights vehicles on the highway. In reality, the volume of vehicles is increasing, and congestion cannot be avoided inevitable. Traffic light settings based on time phases that are fixed/static, less able to function well in breaking down congestion, considering that every corner of the road has a changing density of vehicles. So it is necessary to optimize the setting of traffic lights at highway intersections so that can minimize the waiting time of road users. In this paper, we discuss the manufacture of control system simulations that can determine the duration of traffic lights adaptively at highway intersections using the Mamdani fuzzy algorithm. Determination of the traffic light is determined by the parameters of the number of cars, motor, and road width. From the test results with different parameters, conditions can be obtained the flame the red that changes adaptively to the conditions that occur on the highway [11].

Piezoelectric Sensor
Piezoelectric sensors are electric charges that accumulate in certain solid materials, such as crystals and ceramics, as a result of mechanical pressure. This sensor works with a pressure that will cause the spring to automatically hit the Piezoelectric crystal, which is made of electricity. So that when applying pressure to an electric material, it will produce an electric field [4]. In a 2018 study using a piezoelectric sensor as an electric generator designed on a floor. This sensor produces low power resulting from the pressure generated when stepping on the floor. The design of the sensors themselves is arranged in parallel to produce maximum power, which aims to utilize waste Footsteps in the form of electrical energy. Then it is used as power to charge the phone battery, from experiments conducted with human steps with masses of 100 kg, 80 kg, and 60 kg. The resulting voltage varies according to the mass of the human weight. At a load of 60 kg, it produces 4-6 mV; at a load of 80 kg, it produces a voltage ranging from 6-8 mV; and at a load of 100 kg, it produces a voltage ranging from 7-9 mV. From these tests, the heavier the load, the greater the voltage generated and the greater the energy stored in the capacitor [12]. In a 2020 study using a piezoelectric sensor as a power source to charge a power bank. By arranging sensors in parallel and series with a parallel circuit, the values are 1.3V, 1.7, and 3.5. From the voltage generated to be able to charge the power bank, it takes quite a long time due to the small power [13].

Fuzzy Logic Mamdani Algorithm
Fuzzy algorithm or fuzzy logic is one part of artificial intelligence (Artificial Intelligence) that emulates human ability to think into algorithms which are then run by machines. The fuzzy set is a range of values from 0 to 1. Fuzzy itself describes boolean values such as "true" or "false" and uses expressions such as "very dim", "dim" to "bright". Fuzzy is defined as a linguistic variable and has a maximum membership function of 1. The fuzzification process is a process to convert non-fuzzy (numeric) into fuzzy (linguistic) variables. In addition, there is a defuzzification process that changes the results of the fuzzification back to its original form, namely a numerical variable [14]. In this study fuzzy algorithm is used to determine the intensity of light or the flame of the lamp. In a 2020 study, the Mamdani fuzzy algorithm was used as fan automation that helps homeowners save electricity and achieve 100% accuracy [15]. In addition, the use of fuzzy Mamdani can also be used for the production sector, as in the 2020 study. In this study, the fuzzy Mamdani algorithm is used as an optimization to determine the amount of production according to consumer demand [16] In a 2017 study, the fuzzy Mamdani method fuzzy algorithm was used to build a traffic light optimization system at each phase point of a signaled road intersection. In this system, it can produce maximum seconds of green light at each intersection according to the officer's input. Where the input required by the system is the length of the queue that is set, the width of the road that is set, and the length of the queue on the next line. The purpose of this system is to optimize the seconds of lights according to the conditions of the intersection using the Mamdani fuzzy algorithm. In this system, the Mamdani fuzzy implementation is used to find the optimization value of the light intensity of the PJU lamps that must be produced so that it is in accordance with the needs of the surrounding environment and from the results of the implementation, it is very good to make energy savings efforts with the percentage savings reaching 80% [10]. In a 2019 study, the Mamdani fuzzy algorithm was used as a traffic light control system. Mamdani method compares based on the condition of each infrared sensor as variable heat input from the vehicle on each lane, the more congested the path, the hotter the path. Detection This congestion will help the system in controlling green light time, light-based on traffic conditions. Based on the experiment, the prototype responds to a different path filled with vehicles, and the prototype adds light time green corresponds to the conditions of 0 seconds, 5 seconds, 10 seconds, and 15 seconds. However, when the streets are not detected by traffic jams, the green light will return to normal in 15 seconds with no extra time. In this study, the fuzzy accuracy obtained is 94% [17].

System Design
This section describes the flowchart diagrams, system architecture, and tools representation Figure 1 is a flowchart diagram of the system. The system begins with a piezoelectric sensor to obtain electrical energy. Energy is obtained when visitors step on the floor below which there is a piezoelectric sensor. Then the LDR sensor will detect the surroundings. If the surroundings are bright, the switch is still OFF, and if the surroundings are dark, the switch will be in the ON state, but the lights will be off. When the ultrasonic sensor detects an object (visitor), then the light will light up accordingly. If there is no object (visitor), then the light will remain off. In the picture above is the system architecture of the design to be built. The way the system works is by taking advantage of pressure from visitors who come to these tourist attractions. The pressure received by the piezoelectric sensor will produce electrical energy, which is used as an energy source for lighting lamps. The LDR sensor is used to detect light conditions around tourist attractions, and functions as an ON / OFF switch, then the ultrasonic sensor functions to detect the presence of visitor objects coming to tourist attractions. The Arduino module functions as the program center and data processing of the system. If there are visitors who are present during the day, the lights will remain off, but the energy obtained will be stored. If conditions are dim or dark, the lights will turn on according to the surrounding conditions. Because the device to be built uses the Mamdani fuzzy algorithm as a regulator or determinant of light intensity, the power output will be efficient and effective according to needs.

Figure 3. Mamdani Fuzzy Rules
In Figure 3 above, it can be seen that the author has set fuzzy rules in the ESP32 device. This device itself functions to store programs that have been developed by the author and send signals to the database. The author sets the rules for lamps with three categories: dim, medium, and bright, where the value is obtained based on the light intensity from the LDR sensor. Furthermore, the other fuzzy rules have three categories: quiet, medium, and crowded, where the value is obtained from the ultrasonic sensor in detecting the number of visitors. If, when the fuzzy component is quiet, then one lamp will light up, and so on. Figure 4 is a tool representation that describes the installation flow of the device or tool used by the system. At this stage, the design is carried out before implementation.

RESULTS AND DISCUSSION
This section will explain the results of the implementation of the system, its functionality, and the analysis that has been carried out, then a discussion. Figure 5 is the implementation of the monitoring system that has been built.

Figure 5. Monitoring System
Monitoring serves to monitor the situation around the system and the number of people passing through the area. On the monitoring panel, there is some information such as fuzzy values, light intensity, and the number of visitors passing by. With the monitoring system, it will make it easier for managers to monitor the surrounding situation. Figure 6 is an example of an actual system. The system built is the result of a design that has been made previously.

Figure 6. System Functionality
The picture above is the result of the implementation of the entire work process. Where there are three lamps and the floor under which there is a piezoelectric sensor, the whole system built is a prototype.

LDR Test
The LDR test is a table of test results from the LDR sensor, and this test aims to determine the comparison of the existing sensors in the system with Lux Meter. From the results of the LDR sensor test, the value between the lux meter and the existing LDR sensor in the system has quite a difference because the sensitivity of the lux meter is quite high. However, functionally, the LDR sensor on the system is functioning properly.

Fuzzy Testing
The fuzzy test table shows the results of the tests that have been carried out previously. The table shows the results of several tests. One lamp test 1.
The testing process starts at 6.20 WIB 2.
The testing process runs until 12:57 WIB The testing process starts at 14.00 WIB 2.
The testing process runs until 19.13 WIB The testing process starts at 18.00 2.
The testing process runs until 22.44 WIB Based on the above data, the duration of battery life is one lamp for 6 hours, two lights for 5 hours 13 minutes, and three lights for 2 hours 55 minutes. In testing, using fuzzy can last for 4 hours 44 minutes. Therefore, the average duration is 5.01 hours, and the battery duration using fuzzy is 4.7 hours. Then 4.7/5.01 x 100% = 93%. Which results in an efficiency of 93%.

Piezoelectric Test
The piezoelectric test contains the test results from the piezoelectric sensor that have been carried out and gets the results according to the figure.