Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 ELECTRICAL ANALYSIS USING ESP-32 MODULE IN REALTIME ERIK WAHYU PRATAMA, 2*AGUS KISWANTONO Electrical Engineering Study Program. Faculty of Engineering. Universitas Bhayangkara Surabaya Jl. Ahmad Yani No. Ketintang. Kec Gayungan. Surabaya. Jawa Timur, 60231 e-mail: 1erikwahyupratama29@gmail. com, 2kiswantono@ubhara. Corresponding author ABSTRACT Microcontroller is a core part of the control GUI project. The choice of microcontroller is very influential on the results of data processing on the system. On the basis of these thoughts, a study was conducted which aims to find a microcontroller with good data processing capabilities. In this study using the ESP32 microcontroller microcontroller. Where the microcontroller has different specifications. the ESP32 microcontroller produces an average voltage error value of 0. 312182825 percent and a current of 0. 194657573 percent. Keywords: Mikrokontroler. ESP32, voltage,current INTRODUCTION Along with the development of science and technology, now many ideas appear in the field of digital Developing digital systems are applied to microcontroller technology . In the development and research process, the microcontroller that is often used by researchers is Arduino Uno. Arduino Uno is a circuit developed from a microcontroller . Arduino UNO can be supplied via a USB connection or with an external power supply. The resource is selected automatically. External supply . on-USB) can be obtained from an AC to DC adapter or battery . ESP32 also has advantages compared to other microcontrollers, starting from more pin outs, more analog pins, larger memory, and low energy Bluetooth 4. This microcontroller has an in-chip WiFI module available. RESEARCH METHODS 1 System Configuration The history of the ESP3 microcontroller ESP32 is one of the microcontroller families introduced and developed by Espressif Systems. ESP32 is the successor to the ESP8266 microcontroller. This microcontroller is compatible with Arduino IDE. This microcontroller already has a WiFi module and is connected to BLE (Bluetooth Low Energ. via a chip, so it is very powerful and can be a good choice for creating an IoT application system. ESP32 stands for Espressif32 which is a development board developed by Espressif Systems. ESP32 is a 32-bit microcontroller equipped with a wireless or wifi network and Bluetooth Low energy (BLE) using the 802. 11 b/g/n wifi network protocol that works at a frequency of 2. 4 GHz and bluetooth v4. 2 technology. Figure 1. Model ESP32 DOI: https://doi. org/10. 54732/jeecs. Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Figure 2. ESP32 Pinout Parts The following are the specifications of the ESP 32 microcontroller module as follows: Table 1. the specifications of the ESP 32 microcontroller module The ESP32 memory consists of 448 kB ROM, 520 kB SRAM, two 8 kB RTC memory, and 4MB of flash This chip has 18 ADC pins . -bi. , four SPI units, and two I2C units. The main advantage of this microcontroller is that the price is relatively cheap. Programming for ESP32 microcontroller programming C Arduino IDE C ESP32 module pinout C PlatformIO C An expressive IOT development framework C Plugin eclipse ESP-IDF C Ekstensi kode visual studio ESP-IDF Based on this description, in this article a study was carried out on a comparison of the performance of ESP32 and Arduino Uno on measuring voltage and current values. There will definitely be differences in the data because ESP32 and Arduino UNO have different bits. The more bits the microcontroller has, the more data it processes at one time. The data will later be used to find the difference in sensor value reading errors . rror value. , so that the microcontroller can better understand the processing of voltage and current reading data. Jenis Jenis ESP-32 - ESP32 Devkit ESP32 microcontroller with DEVKIT V1 board. This microcontroller is suitable for various Artificial Intelligence (AI) projects as well as Internet of Things (IoT) projects. -ESP32 Wroom Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 The ESP32 WROOM-32 module is a development board module that makes it easy for you to learn and try circuits that use the ESP-WROOM-32 chip. The ESP32 chip has advantages over the previous ESP chip where ESP32 has a higher speed, 32 bits, larger memory, - ESP8266 ESP8266 itself is a WiFi chip with a complete TCP/IP protocol stack. NodeMCU can be analogous to the Arduino ESP8266 board. The ESP8266 program is a little difficult because it requires several wiring techniques and an additional USB to serial module to download the program. - NodeMCU V3 NodeMCU is basically a development of ESP8266 with e-Lua based firmware. NodeMcu Devkit is equipped with a micro USB port that functions for programming and power supply. NodeMCU ESP32 is a development board for Internet of Things applications. The board consists of the highly versatile ESP32 IoT module and the CP2102 serial USB chip which simplifies the programming of this module. Just connect NodeMCU to the computer with a USB cable and we are ready to program The ESP32 module is a very extraordinary series compared to its predecessor, the ESP8266. The main difference is that the ESP32 is dual-core while the ESP8266 is only single-core. In ESP32, one core is reserved for WiFi Bluetooth connections. The other core is dedicated to user applications. Therefore. ESP32 is better suited to handle intensive applications. Plus, the ESP32 has WiFi and Bluetooth capabilities! Poko is very complete, moreover the ESP32 has 6 analog pins whereas most of its predecessors only have 1 analog pin. WROOM. SOLO and WROVER modules The small module family contains the ESP32 chip installed along with several key components including a crystal oscillator and antenna matching circuitry. This makes it easier to provide ESP32-based solutions ready to be integrated into the final product. Such modules can also be used for evaluation after adding some additional components such as programming interfaces, bootstrap resistors and break out headers. The main characteristics of this module are summarized in the following table. Some additional details are covered in the following chapters. Table 2. The ESP32 chip ESP32-D. indicates dual core. ESP32-S. indicates single core chip MIFA - Winding Inverted F Antenna U. FL antenna connector - U. FL / IPEX The ESP32-WROOM-x and ESP32-WROVER-x modules are also available with a custom flash size of 8MB or 16MB, see Espressif Product Ordering Information (PDF) ESP32 Chip Datasheet (PDF) The initial release of the ESP32-WROVER module has 4MB of PSRAM ESP32-WROOM-32 was previously called ESPWROOM-32. ESP 32 AeWROOM-32 The basic and common ESP32 module is adopted with the ESP32-D0WDQ6 chip installed. The first of the WROOM / WROVER family released to the market. By default, the module has 4 MB flash and can also be ordered with a custom flash size of 8 or 16 MB. Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Figure 3. The ESP 32 AeWROOM-32 ESP 32 AeWROOM-32D / ESP 32 AeWROOM-32U Both modules have the ESP32-D0WD chip, smaller than the ESP32-D0WDQ6, installed in the ESP32WROOM-32. The modules come standard with 4MB flash memory and can also be ordered in custom 8 or 16MB flash sizes, see ordering information for Espressif products. Version "D" has a MIFA antenna. The "U" version has only the U. FL/IPEX antenna connector. This makes it 6. 3 mm shorter than the "D" and at the same time the smallest representative of the entire WROOM/WROVER module family. Figure 4. The ESP 32 AeWROOM-32D / ESP 32 AeWROOM-32U Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 ESP32-SOLO-1 Simplified version of the ESP32-WROOM-32D module. It contains a single core ESP32 chip that supports clock frequencies up to 160 MHz. Figure 5. The ESP32-SOLO-1 ESP32-WROVER Phased upgrade of the ESP32-WROOM-32x module with an additional 8MB of SPI PSRAM (Pseudo static RAM) This module comes in several versions which are listed in the WROOM. SOLO and WROVER Modules A The ESP32-WROVER and ESP32-WROVER-I have PSRAM that operates at 1. 8V and can support clock rates up to 144 MHz. A The ESP32-WROVER-B and ESP32-WROVER-IB have PSRAM that operates at 3. 3V and can support clock rates up to 133 MHz. By default, the module has 4 MB flash and can also be ordered in a custom flash size of 8 or 16 MB, see Ordering Information for Espressif Products. Depending on the version, the module has either a PCB antenna . hown belo. or a U. FL / IPEX antenna connector. Due to the additional components inside, this module is 5. 9 mm longer than the ESP32-WROOM-32. Figure 6. The ESP32-WROVER ESP32-PICO-KIT V4. the smallest ESP32 development board with all the necessary components to plug it directly into a PC's USB port, and header pins to connect to a mini breadboard. Equipped with the ESP32-PICO-D4 module which integrates 4 MB flash memory, crystal oscillator, filter capacitor and matching circuitan RF dalam satu paket tunggal. Hasilnya, papanfully functional development requires only a few external components that mount easily on a 20 x 52 mm PCB including antenna. LDO. USB-UART bridge and two buttons to reset and put it into download mode. Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Figure 7. The ESP32-PICO-KIT V4. Compared to the ESP32-PICO-KIT V4, this version contains a more capable CP2102N USB-UART bridge that provides transfer rates of up to 3 Mbps. ESP32 DevKitC V4 Small and convenient development board with ESP32-WROOM-32 module installed, removing pin headers and minimum additional components. Includes a USB to serial programming interface, which also provides power supply for the board. Has a push button to reset the board and put it in upload mode. Compared to the previous ESP32 Core Board V2 / ESP32 DevKitC, instead the ESP32-WROOM-32 can accommodate ESP32-WROVER modules and has a CP2102N chip that supports a faster baud rate. Figure 8. The ESP32 DevKitC V4 ESP-WROVER-KIT V4. The ESP-WROVER-KIT V4. 1 development board has a dual USB to serial port converter for programming and a JTAG interface for debugging. Power supply is provided via a USB interface or from a standard 5 mm power supply jack. The selection of the power supply is made by means of a jumper and can be switched on/off by a separate The board has a MicroSD card slot, a 3. 2Ay SPI LCD screen and a dedicated header for connecting cameras. provides RGB diodes for diagnostics. Includes 32. 768 kHz XTAL for the internal RTC to operate it in low power Development ESP-WROVER-KIT V4. 1 has a dual USB to serial port converter for programming and a JTAG interface for debugging. Power supply is provided via a USB interface or from a standard 5 mm power supply jack. The selection of the power supply is made by means of a jumper and can be switched on/off by a separate switch. The board has a MicroSD card slot, a 3. 2Ay SPI LCD screen and a dedicated header for connecting cameras. It provides RGB diodes for diagnostics. Includes 32. 768 kHz XTAL for the internal RTC to operate it in low power mode. This version of the ESP-WROVER-KIT board has the ESP-WROVER-B module installed which integrates 64-MBit PSRAM for expandable storage and flexible data processing capabilities. The board can accommodate other versions of the ESP module described under WROOM. SOLO and WROVER Modules. Compared to ESP-WROVER-KIT V3, this board has the following design changes: C JP8. JP11 and JP13 combined into one JP2 C The USB connector has been changed to DIP type and moved to the lower right corner of the card C R61 changed to 0R C Several other components, eg. The EN and Boot buttons have been replaced with equivalent functions based on test results and source options Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Figure 9. The ESP-WROVER-KIT V4. 2 Variables Used The variables used in this study are : Voltage Flow Power Frequency 3 Implementasi mikrokontroler ESP32 Literature study, this stage is carried out by collecting information related to the topics taken in this study, including 3-phase electricity, sensors reading electric quantities, types of microcontrollers and actuators, and GUI . raphical user interfac. System design, this stage is the stage of designing and determining the concept or workings of the system from this research. Tool and GUI design, this stage is the manufacture of tools and also a GUI system or interface . esktop applicatio. using Visual Studio software. Testing the system, this stage is testing the system both per component and as a whole for the tools that have been made. For testing per component, testing is carried out on the sensor reading the electric quantity, namely the PZEM-004T sensor, the ESP-32 microcontroller connection in the GUI that is made, and testing the relay as an electrical switch. Pembuatan Report, reporting the results of research in the form of a thesis book that is used as material for evaluating the research conducted. RESULTS AND DISCUSSION This chapter will discuss testing based on the planning of the system that has been made. The test program is simulated in a suitable system. This test is carried out to find out whether the system is in accordance with the plan or ESP32 Microcontroller Hardware Board Testing Testing the ESP32 microcontroller hardware board that has been designed aims to determine the ability of the ESP 32 microcontroller in running the program as well as to find out the wiring of the main board circuit and find out the analysis of troubleshooting results from any problems experienced when testing the board. The hardware board circuit can be seen in the following figure: Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Figure 10. Board hardware Mikrokontroller ESP32 Figure 11. Design PCB Board hardware Mikrokontroller ESP32 This experiment is carried out by checking each line connected to the pin whether it is connected or not to overcome troubleshooting and testing is carried out on the ESP32 microcontroller by providing an electric power supply and testing each pin used and providing a program that has been set, namely data collection, the output voltage is set at condition 1 (Max voltage 3V) and condition 0 . inimum voltage 0 V) as shown below: Figure 12. Experimental session Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Data retrieval The following is a table of the data taken in this study: Table 3. ESP32 MICROCONTROLLER PIN TESTING Results and Discussion Based on the data collection table for the esp32 microcontroller test that has been carried out, it is known that the output voltage when condition 1 averages a value of 3. 5 v and when it is in condition 0, the output voltage is 0. Then after checking each path that on the hardware board connected to the esp32 microcontroller can function Testing Desktop Application or GUI This desktop application test aims to determine whether data transmission from the ESP32 microcontroller can be received and displayed on the Application desktop page or not and the control success of activating and connecting the relay through the GUI. This test requires several components, namely the ESP32 microcontroller to control the system, the PZEM-004T sensor functions to read data, the computer functions as a screen to display desktop applications, a USB cable to connect the ESP32 microcontroller to a computer. Data retrieval The following are pictures of the data collection carried out: Login on the desktop Application login page Figure 13. Initial Display Login Desktop Application Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 Data Monitoring and Controlling page Figure 14. Display of Data Monitoring and Controlling Pages Realtime Electricity Usage Graph Fiure 15. Realtime Graphical Display of Electricity Usage Table of Electricity Usage for Each Phase Figure 16. Table Display of Electricity Usage for Each Phase Results and Discussion Based on the desktop application test results above, it is known that the GUI can function properly by being able to display data transmission from the ESP32 microcontroller and be able to control. Overall Testing of the Electrical Monitoring System This test is carried out to find out how well this system is made to work in monitoring and controlling threephase electric power. This test was carried out on a 3-phase electrical panel in the JNE Sinar Buduran Warehouse. this experiment, each phase is given a different load. In Phase R, loads are given in the form of solder and fans. Then in the S phase, a load is given in the form of a rice cooker and a laptop. Lastly, in Phase T, loads are given in the form of irons and drills. In this test, if there is a load that is overloaded or exceeds the efficiency of the MCB . his test sets Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 the MCB with an efficiency of 5%), the relay will automatically disconnect and also on the Desktop Application display screen it will show the status of the load on which phase is OFF and turns on an alarm on system. Data retrieval In collecting data from the entire system, the first is to connect the tools that have been made with each phase. Then, turn on all the loads that are used as a test on the plugs used for this monitoring. The following is the result of data retrieval from the load test in Phase R given a load in the form of Strika with a power of 400 Watts. Phase S was given an Electric Drill load with a power of 350 Watts and Phase T was given a load of an Electric Heater with a power of 500 Watts and the results of measuring the voltage between phases and neutral as well as the current in each phase were presented in Table 4. Table 4. Overall System Testing Results Figure 17. Desktop Application Display Shows Relay Status in Hazard T Phase Figure 18. When the system experiences an imbalance by disconnecting the relay and turning on the alarm led and buzzer. Results and Discussion Based on the test results above, it is known that each phase has a different power output value depending on the load connected to that phase. In the data above, successively the power released on phases R. S, and T is 360. 4 , and 508. 8 it is known that the load on phase T experiences an overload, so the relay cut off the power supply automatically and the display on the Desktop Application screen changes status to OFF. By knowing the results of this monitoring, it will make it easier for the user or users to know and control the power at which load the excess energy is used and abnormalities occur. Available online at: https://ejournal. id/index. php/jeecs Journal of Electrical Engineering and Computer Sciences Vol. No. December 2022 P-ISSN: 2528-0260 E-ISSN: 2579-5392 1273 - 1284 CONCLUSION This system can be used to monitor or monitor 3-phase electrical quantities using the PZEM-004T sensor to detect or measure voltage, current, and frequency quantities. ESP 32 is used to process and process data and send data to the Desktop Application display on the computer. When the system detects an overload on one of the phase loads, the system will automatically cut off the switch for the flow of electricity to the load. This system can control the phase load by activating and deactivating the load using a relay through the Desktop Application screen. REFERENCES