https://research. e-greenation. org/GIJES. Vol. No. June 2023 E-ISSN: 2986-0326. P-ISSN: 2986-089X DOI: https://doi. org/10. 38035/gijes. Received: 29 July 2023. Revised: 15 August 2023. Publish: 4 September 2023 https://creativecommons. org/licenses/by/4. Design and Realization of Smart Plug Based On QR Code and WIFI Access Annenta Gistya Sudiartama1. Denny Darlis2. Aris Hartaman3 Telkom University. Indonesia, annentasudihartama@gmail. Telkom University. Indonesia, dennydarlis@telkomuniversity. Telkom University. Indonesia, arishartaman@telkomuniversity. *Corresponding Author: Annenta Gistya Sudiartama Abstract: The traditional electrical outlet has evolved with the emergence of "smart plugs," which are WiFi-based devices controlled through communication networks. Many innovations and studies have explored the use of smart plugs for remote load control via the internet and some even utilize renewable energy sources like solar power. In this research, we present a smart plug equipped with a QR code control feature, allowing users to manage connected loads efficiently. Additionally, the smart plug includes sensors to measure power consumption, displaying real- time data on the connected devices. Our smart plug system incorporates an ESP32 microcontroller as the core unit and ACS712 and ZMPT101B sensors for electric current and voltage measurements, respectively. The parameters calculated are electric current and voltage, enabling users to monitor energy consumption accurately. Through rigorous testing, we evaluate the accuracy of the ACS712 and ZMPT101B sensors. The results indicate a 11,39% error for electric current measurements using the ACS712 sensor and a 0,022% error for voltage measurements with the ZMPT101B sensor. This research introduces an innovative smart plug that allows control via a QR code and provides real-time power and load information. Keyword: Smart Plug. Qr Code. Esp32. Acs712. Zmpt101b. INTRODUCTION In this modern age, electricity has become one of the most crucial elements of human Nearly all communities around the world, from the upper to the lower segments, rely on electricity for various purposes. According to data from the Ministry of Energy and Mineral Resources (ESDM) presented in a databox on household resources in Indonesia, electricity is the primary energy source supporting most household activities. Ahmad Wahid et al. research suggests that the electricity demand will continue to rise due to population growth, technological advancements, and developments in education . In 2020, there was a 92 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 significant increase of 50. 80% in electricity usage, and it continued to rise to 48. 81% in subsequent years. One of the factors influencing electricity consumption is income and electric prices . As electricity usage increases, common problems related to power supply, such as ambients, start to emerge. Consequently, the government has introduced regulations, as stated in the Ministry of Energy and Mineral Resources (ESDM) No. 14 of 2021. Chapter i. Article 3, paragraph 1, aimed at achieving a 20% reduction in electricity usage. Researchers have been focusing on innovative solutions to minimize electricity wastage, including the development of smart plugs. Various studies have been conducted on smart plugs. Aris Sudaryato et al. created smart plugs using a relay and ESP32, where ESP32 functions as the main control system and the relay acts as an electrical link and flow breaker, enabling remote control capabilities. Similarly. Fakhrudin et al. conducted research with a similar goal, using a short-circuit security mechanism in conjunction with three power sockets and ESP32, along with supporting sensors like TA12-100 and TA12-100 . Vidy Masinambow et al. power switch controller using Android smartphones with microcontrollers, relays, electric switches, and Wifishield, providing an alternative solution to manage excessive electrical energy . The Research aims to create a "smart plug based on QR Code and access WIFI" to control high electricity consumption. The smart plug is designed to display real-time information about current, voltage, and power consumption. By using a QR code shown on an OLED display, users can scan it with a smartphone app to activate the smart plug and control electricity usage. ESP32 serves as the microcontroller, connected to the ACS712 current sensor capable of detecting both AC and DC currents . Additionally, the ZMPT101B sensor is used as a voltage sensor and phase detector to measure phase differences between current and voltage waves . In conclusion, this research focuses on developing an innovative smart plug that can efficiently manage electricity consumption by utilizing QR Code and WiFi access. integrating ESP32 and advanced sensors, the smart plug offers real-time data on current, voltage, and power usage, providing users with a user-friendly and effective solution for optimizing energy consumption. Differences between previous studies with current studies will be shown in Table 1. Table 1. The difference in this research with previous research Reference Component Method Parameter Aris ESP32 & Preparation, design of Smart plug Sudaryanto. Relay realization devices, and systemstatus conditions Fakhrudin. , 2018 ESP32, TA12- Literature and preparation Current 100 DS18B20 Indra Pzem-0047 Analysis programCurrent Voltage Dwisaputra. DS3231 Real-time clock Vidy Relay WiFi Research facility, material Capability Masinabow. Shield research signal, security Time Adiguna NodeMCU ESP The K-nearest neighbor The K value of Ramdhana. , 2021 8266, KK-NN Relay JQC- 3FFclassification S-Z. Current Voltage Pzem-004T Fajar Shidiq P. NodeMCU 8266. Blynk Relay 93 | P a g e https://research. e-greenation. org/GIJES. Harun Sujadi. Wemos D1 R2 Mutia Rosadi. , - Vol. No. June 2023 Field method library The amount of Descriptive&associative Factors that affect the electricity Testing and analysis Voltage, current Triyas Prima S. ACS712 & Arduino Uno Trio Adiono. ACS712, Hardware of Proposed Smart Voltage current Reset and mode Plug. Android Apps. Software Socket of Proposed Smart Plug Terminal . nput/output micro USB Ronan Cadmiel Intelliplugs Conceptual Framework. Application ,2020 Arduino Electrical Design. Control testing System. Physical Design This Research ESP32 ACS712 Literature. Hardware Design. Voltage Current Calibration. Power and Software design The following is a reason for researchers use ESP32 as a microcontroller is as follows: ESP32 has advantages compared to other microcontrollers, ranging from having more pin out and analog pins, having larger memory, and low-Bluetooth energy 4. This microcontroller has a WiFi module in the chip . ESP32 provides separate chips and an easyto-use development board on a prototype. has an affordable price. Meanwhile, there is a weakness of ESP32 that only supports Wi-Fi networks with FREQUNIC 2. 4 GHz range they will not connect to a modern 5 GHz network. METHOD Literature Study in this method, the author collects references, readings, and notes. Researchers also studied data from journals and also research before it. Researchers will compare their research with research that has been made into a journal, report, and articles. In this method, the researchers can also find new things about whatever can be developed from their research Even Researchers can also create innovations and make new things that will later use but can be implemented in the community. Hardware Design in this process The researcher makes the device using components according to the procedure that has been described through the flowchart in Fig. To simplify the process of making the device, researchers made a circuit diagram that aims to minimize failures in Fig. Fig 1 The Hardware Design Process Flowchart 94 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 Fig. Circuit Diagram Of Smart Plug Calibration The calibration itself is a series of activities that establish a relationship between the values indicated by a measuring instrument or measurement system, or the values represented by a measuring object, and the known values related to the measured quantity under specific conditions . Table 2. Calibration measurements data Electrical Devices To Be Tested ADC Current (A) HAIR STRAIGHTENER HAIR DRYER LIGHT BULB . LIGHT BULB . LIGHT BULB . SMARTPHONE CHARGER 3558 Fig 3. Calibration Diagram Software Design At this stage, the author will describe the design and realization of the project that the author made. The tool that the author made is a smart socket that can measure power, voltage, and also current in the load. To make a tool that can measure like that, the author uses Arduino as software to program the tool. The language used is C language. 95 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 Fig 4. The Software Design Process The diagram depicted in Fig. illustrates a flowchart for software design. The forthcoming device must undergo programming as a primary step to gauge current, voltage, and power. Furthermore, it possesses the capability to exhibit a QR code produced from a ThingSpeak web address. In the event of the device being connected to the internet, the QR code will become visible. Subsequently, upon the QR code becoming visible, a researcher will employ a smartphone, specifically utilizing Google Lens, to scan it. Following a triumphant scan, a web link leading to ThingSpeak will materialize. Upon the successful activation of a relay, if achieved, the device will facilitate the passage of electricity, thereby displaying readings for current, power, and voltage. RESULTS AND DISCUSSION Implementation Software Section Based on the concept developed for this smart plug, it is designed with features that not only display the measurement values of the device but also allow control through QR codes. Therefore, the researcher utilizes a web interface using ThingSpeak, which will activate the relay upon successful scanning of the QR code. Fig. Control Relay Graphic 96 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 The graph depicted in Fig. explains the timing of QR code scanning that can activate the relay. The number 1 indicates when the relay is turned on, while the number 0 indicates when the relay is turned off. Hardware Section It would take two layers of PCB to connect the electronic components with the conductor's channel. Before manufacturing PCB we get a schematic in Fig. while the PCB view is depicted in Fig. the configuration of a power supply system with various devices such as ESP32. OLED. ZMPT101B. ACS712, and relays. The process starts with converting the 220V AC input into a 5V DC output, which is then distributed to the connected devices. The ESP32 serves as the microcontroller and facilitates data communication between the devices. The ZMPT101B voltage sensor and ACS712 current sensor read data, which is displayed on the OLED screen. The connections between the devices are detailed, specifying the pins used for communication and power Additionally, the relay is connected to GPIO 13, and the load supply is connected to ACN. ACL, and N. to preserve the safety of this device it needs to make a casing for the device in Fig. Fig. Schematic For The Device Fig. PCB Design For The Device 97 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 Fig. 3D Print Design for The Device Casing Functional Test and Measurement In this section, the results of the device creation and the conducted measurements will be displayed. Firstly, the comparison of voltage measurements on electrical loads will be shown in Table 5. While the comparison of current measurements will be shown in Table 6. The table presents the results of electrical device testing with readings from the ACS712 current sensor and the multimeter for current measurements . n Ampere. and from the ZMPT101B voltage sensor and the multimeter for voltage measurements . n Volt. The "Error (%)" column indicates the percentage difference between the sensor readings and the multimeter readings for each device. The average error for the ACS712 current sensor measurements was found to be 11,39% and The average error for the ZMPT101B voltage sensor measurements was found to be 0,022%. To activate the relay, a QR code is required, which will be scanned using a smartphone. Fig. shows the successful display of the QR code on the OLED screen, and is ready to be scanned. After successfully scanning the QR code that figured in fig. the device will display the measurement results, such as current, voltage, and power. Table 5. The difference in current measurement between multimeter and acs712 Electrical Devices To Be ACS712 Multimeter Reading Error (%) Tested Reading (A) (A) HAIR STRAIGHTENER 0,22 0,20 HAIRDRYER 0,97 0,94 3,19 LIGHT BULB . 0,70 0,59 18,64 LIGHT BULB . 0,40 0,36 11,11 LIGHT BULB . 0,24 0,21 14,29 SMARTPHONE 0,20 0,18 11,11 CHARGER THE AVERAGE OF ERROR (%) 11,39% 98 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 Table 6. The difference in voltage measurement between multimeter and zmpt101b Electrical Devices To ZMPT101B Multimeter Error (%) Be Tested READING (V) Reading (V) HAIR 0,02 STRAIGHTENER HAIRDRYER 0,018 LIGHT BULB ( 7W) 218 0,013 LIGHT BULB . W) 230 0,023 LIGHT BULB 0,032 SMARTPHONE 0,03 CHARGER THE AVERAGE OF ERROR (%) 0,022% During the testing of the current and voltage sensors ACS712 and ZMPT101B as presented in Table 6, it is evident that these sensors exhibit inaccuracies when compared to the readings from the multimeter. The error percentage is calculated when the ACS712 sensor reads a value of 0. 22 A while the Multimeter displays a reading of 0. 20 A. Fig. Show the QR Code and the measurements on Oled Fig. Scanning Process With Google Lens 99 | P a g e https://research. e-greenation. org/GIJES. Vol. No. June 2023 CONCLUSION The research explores the concept of a smart plug, which is a wifi-based device that can be controlled using a Scan QR Code . Unlike traditional electrical outlets, a smart plug offers advanced functionalities, allowing users to manage and monitor connected electrical loads focused on measuring electric current and voltage parameters. However, the tests revealed some deviations in accuracy. The ACS712 sensor had a 11,39% error in the current measurements, while the ZMPT101B sensor exhibited a 0,022 % error in the voltage REFERENCE