Artículo - Node CMU IJETT-V72I6P125
Artículo - Node CMU IJETT-V72I6P125
net/publication/381880391
CITATIONS READS
0 423
2 authors:
All content following this page was uploaded by Pedro Miguel Portillo - Mendoza on 17 August 2024.
Original Article
Received: 25 March 2024 Revised: 01 June 2024 Accepted: 08 June 2024 Published: 29 June 2024
Abstract - The object of study of this research is to determine to what extent a monitoring and alert system of a residential
electrical network using NodeMCU is efficient, with the purpose of supervising and optimizing the efficiency of electrical power
consumption in a home. For this, current data collection techniques were used through the induction sensor, then an electronic
analysis technique for voltage reading by voltage division, which consists of scaling the AC input voltage to the reading ranges
of the microcontroller in D.C. Finally, the MQTT technique is used for the communication protocol that consists of the
transmission of values from a microcontroller to a database via Wi-Fi. In this research, electronic modules were used to capture
current and voltage data, and different computer programs, such as Eagle, for the electronic and electrical design of the system;
Autodesk Inventor for the development of the schematic of the system components and the design of the prototype of the case
that houses the electronic components; UltiMaker Cura 5.2, to configure 3D printing of the case; Arduino IDE, for the
development of the ESP32 microcontroller programming code that is carried out in C++ language; Firebase Google, to obtain
monitoring and alerts through an IDE interface which was programmed with HTML code and finally Visual Studio Code was
used to create the graphical user access interface on the web page. The results demonstrated that this proposal made it possible
to optimally monitor and obtain power consumption locally and remotely based on initial magnitudes of voltage, current, and
power, obtaining a low error percentage of 0.39% and 3.12% in voltage and current measurements, respectively, comparing
them with previously calibrated Fluke brand high precision measuring instruments. In addition, a calculated precision of
97.9289% was obtained for the power based on the values obtained by the instruments. With these parameters, the control
algorithm displays the power locally through an LCD screen and remotely through a web page. Finally, the system can notify
when an anomaly, such as a power outage, occurs through a notification to Gmail and the website interface.
Keywords - Power Consumption, IoT, Low-cost Monitoring System, Google Firebase, NodeMCU.
with a NodeMCU electronic microcontroller device, the In [16], the economical ESP32 development board is
installation of the device can be replicated in all the other used, being the most powerful of the NodeMCU family that
electrical appliances that make up the home., and thus, the manages to have a relative error below 20% in non-linear
owner will be able to map the consumption of each appliance loads of the measured parameters. Other researchers use the
and carry out his optimization plan. Wemos D1 Mini microcontroller [17] due to its benefit of
being smaller and more compact so that it can be placed in a
2. Related Works reduced structure thanks to its dimensions. Therefore, single-
Various investigations have been carried out around the phase and three-phase networks can be analyzed with this
world to address this problem, such as the use of Smart meters microcontroller. In [18], a quantitative methodology is used to
that store data hourly on a web server for subsequent studies measure electronic values of the single-phase electrical system
[1-2]. Other researchers used the combination of two of the line current (IL) of the home network.
development boards (Arduino Uno and Raspberry Pi 2) to
make voltage measurements [3]. There are disturbances that It has been found that other scholars use the same method
affect the quality of the measurement, such as the operation of to investigate electricity consumption [3]. In [19], it uses a
non-linear loads, natural phenomena or due to human effects 16x2 I2C LCD to see the values of the analyzed parameters
such as incorrect maneuvers in the distribution plant [4]. In and even be monitored through a Local Area Network (LAN),
addition, these problems are addressed with the use of smart entering a local IP address (192.168.1.X) from where it is
electrical meters such as the PZEM-004T to perform electrical components installed physically close to each other. In [17], it
metrics on the power consumed with the electrical variables to is proposed to place a 1.54-inch TFT screen with a resolution
be analyzed [5-6]. Although the vast majority of homes have of 240x240 pixels that is implemented with a capacitive touch
electrical services [7], audits are not provided to compare the panel, with which the person can see the numerical values of
data when there are problems in reading energy consumption. the sensed variables that are stored in the flash memory of the
processor ESP8266.
The recording of the energy consumed is in charge of the
electric meter, which is responsible for processing the voltage In [20], it uses the Bluetooth signal, given off by the
and current values [8]. Monitoring and control products are programmable integrated circuit, to display on a phone that is
mostly used by companies in order to know the status of the a maximum of 10 meters from the system and whose data is
machinery and because they must protect their high stored on an SD memory card. Some scholars optionally
investment [3]. Given this, various investigations have been propose how to transmit the data remotely to be viewed from
carried out with the purpose of implementing systems that anywhere in the world using a transmission channel such as
help us monitor and identify faults and/or breakdowns in the Wi-Fi or other communication protocols [5], [21] or with a
electrical system of homes. The implementation of “Smart mobile application which uses Google Sheets Excel to save
Grid” in the electricity supply diagnoses the possible causes the values obtained from the sensors [6].
of these damages and monitors the conditions that affect the
reliability of the service to end customers [9]. Likewise, in From the research reviewed, it is observed that although
[10], it is indicated that there should be different programming the monitoring of electrical variables using NodeMCU
and monitoring strategies for household appliances to improve technology has been related, however, the following have not
electrical efficiency and reduce energy costs in homes, thus been implemented: local - remote monitoring and alert at the
preventing and saving unnecessary current by controlling and same time, the notification system in Google Firebase, the cost
monitoring factors with the technology of the Internet of per energy consumed, historical graphs or technologies that
Things (IoT). are easy to understand for the common user.Therefore, it is a
necessary starting point to carry out this monitoring and alert
In [11], they propose the objective of developing a unit research applied to the residential electrical network that
that controls the electrical energy of homes in Malaysia so that allows knowing the behavior of the voltage and current, given
consumers can find out the values of electricity consumed and that peaks or excesses of these magnitudes possibly damage
calculate their monthly billing cost. Taking the same idea, in the connected devices to the energy supply.
[2], they design a smart monitoring project for household
appliances by measuring pulses of electrical consumption on 3. Materials and Methods
an hourly basis. Also, [1] uses data collection techniques with The methodology that was applied for the development
the help of an LDR sensor, while in [12], they address the idea was carried out considering five sequences of tasks in the
of using the ZMPT101B sensors for voltage and the SCT-013- design process in each engineering domain, such as
030 sensor for current. Others use ZigBee technology [15]; he mechanical, electronic and computer design. Figure 1 shows
points out the use of Arduino UNO and the ESP8266 the development of the methodology used, which has been
microcontroller, which are responsible for analyzing and divided and ordered in a Work Breakdown Structure (WBS)
digitizing the energy data, whose values have been obtained for a better understanding of the design and implementation of
experimentally. the proposed system.
260
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
DISPLAY STAGE
Voltage Sensor
MONITORING
(Design of a
voltage divider) NodeMCU ESP32
LCD 16*2 (Local)
Control algorithms
Webpage (Remote)
STORAGE STAGE
ALERT
API Google Firebase
HTML
261
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
The parts that make up the research system are organized be stored in an Excel table, which can be downloaded to have
using the indicated methodology to achieve the objective. To a historical report later.
do this, the requirements are defined based on a list of
demands: Main function, Design, Dimensions, Energy, 3.2. Mechanical Structure
Material, Connectivity, Signals, Safety, Ergonomics, Figure 3 shows the manufacture of the casing, and it was
Manufacturing, Installation, Transportation, Use, Calibration decided to use 3D printing, which allows for more detailed and
and Costs. specific parts to be made since it needs to be compact, resistant
and able to house all the components. The Polylactic Acid
3.1. Determination of the Monitoring and Alert System (PLA) material is a thermoplastic made from corn or sugar
Figure 2 shows a block diagram with its respective stages, cane, which provides good characteristics such as better
which are first, the signal acquisition phase through the mechanical resistance, low cost and ease of printing, being
sensors, the control stage using the NodeMCU chosen to build the casing. An ANET ET5 3D printer with
microcontroller of the ESP32 type, the communication stage UltiMaker Cura software was used to manufacture the casing.
with the use of the Wi-Fi network, the data visualization stage
through the 16X2 LCD and finally the storage stage with an 3.3. Selection of System Components
API connection to the Google Firebase database. These stages The selection of electronic components is carried out,
are related to each other to fulfill the purpose of optimizing taking into account a series of properties and calculations of
the monitoring and alerting of the electrical consumption that each element of the system to be analyzed and put into
occurs in the home. operation. It was decided to use a switched voltage source of
12VDC 5A that provides enough energy for the system to be
The system has a 12VDC voltage source, which provides stable, then it goes to a voltage regulation of 5VDC, and a
energy for the entire system and in case the power supply goes commercial voltage regulator is used, which is the LM2596
out, it has a built-in 12V Lithium Ion battery. Likewise, it does BUCK STEP-DOWN module.
not have a power button since it has a direct “Plug” type
connection to the SCT-013-030 current sensors and the self- With this module, it is adjusted to 5VDC, and its
made voltage sensor module, which transmits the voltage advantage is that if the input voltage varies by having a fixed
ranges to a microcontroller. The NodeMCU family of the output voltage, then you can have a stable system. In order to
ESP32 type transmits wirelessly via Wi-Fi to Google Firebase, measure the voltage with the ESP32, the measurement range
which stores and transmits to graphic indicators and in a list in must be reduced from (0 – 240 VAC) to (0 – 3.3 VDC), which
the form of a history that can be viewed in real-time, thereby is compatible with the inputs of said microcontroller. The
there is a display of voltage, current, and power data. When method is used to reduce the input voltage (0 – 240 VAC). In
the system does not detect voltage and current signals, which order to do this, a transformer must be used to obtain outputs
indicates that there is a power outage or an error in the system, of (0 – 18 VAC). Then, the alternating voltage must be
it sends a remote warning via email and “Push” notification on separated into positive and negative, and this is done using a
the web and a local alert through a red LED diode and audible diode bridge; then, an electrolytic capacitor of 100uF at 25V
by a Buzzer Module.In addition, the parameters can easily be is used to reduce the curves already separated by the diodes to
read by the user locally using an LCD screen; all of this can obtain a more linear result of positive and negative.
262
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
Having the voltage already in direct current in ranges of Using Equation (4), the voltage reading must be
(0 – 20 VDC), the design of a voltage divider is carried out to multiplied by the sensor factor (30A) to obtain the current.
obtain the maximum 3.3 VDC that is needed. It should be 𝑎 = 𝑉𝑠𝑒𝑛𝑠𝑜𝑟 × 𝑓𝑎𝑐𝑡𝑜𝑟 (4)
taken into account that for the ESP32, the current entering the Replacing:
reading pin must be limited, and this current must be 0.3 mA. 𝑎 = 𝑉𝑠𝑒𝑛𝑠𝑜𝑟 × 30
R2 = 1155 Ohms. Therefore, the commercial resistor R2 = 1K
Ohm, R1 = 6K. The ESP32 has 12 reading bits for its analog Having chosen and designated its configuration, the
inputs, which means that it ranges from 0 – 4095 within the characteristics that the sensors meet for correct operation are
program. To obtain the reading in the necessary range (0 – 240 observed, having a precision of less than 5%. Being non-
VAC) on the controller, the analog reading must first be invasive, it allows different points of a residence to be
converted into voltage within the program, as shown in analyzed and monitored without needing to cut the
Equation (1): connections of the circuit to be analyzed, having measurement
𝑎𝑛𝑎𝑙𝑜𝑔𝑅𝑒𝑎𝑑(35)
𝑉 = [3.3 × ] × 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 (1) ranges corresponding to a current sensor that is from 0 to 30
4095
amps and a voltage sensor. 50-250 VAC, working at
temperatures ranging from 21°C to 40°C.
V is in the range from 0 to 2.8, at the programming level,
is the real input voltage variable; then this real input voltage
must be converted to ranges from 0 to 240 VAC; for this, the
real Vmax is multiplied by a constant to reach 240V which is
the voltage that you want to read, that constant is found with
Equation (2):
𝑉𝑚𝑎𝑥
𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 = (2)
𝑉𝑚𝑎𝑥 𝑟𝑒𝑎𝑙
Replacing:
240
𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 = = 85
2.8
The ESP32 has 12 reading bits for its analog inputs, which
means that it ranges from 0 – 4095 within the program.
Equation (3) is used to convert the analog reading to voltage
within the program with voltage reference given by the sensor
specification (30A 1V).
𝑎𝑛𝑎𝑙𝑜𝑔𝑅𝑒𝑎𝑑(22)×1.1
𝑉𝑠𝑒𝑛𝑠𝑜𝑟 = (3) Fig. 5 Current sensor configuration
4095
263
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
For the visual alert module, the LED diodes used to Figure 10 shows the cover where the buzzer is housed
indicate correct operation are green and red, which indicate with the two LEDs; the green LED indicates when the system
good and bad operation, respectively. Figure 6 shows the is in incorrect operation, and the red LED indicates a system
configurations of both diodes that are connected with a resistor alert; in the main box part, there is the voltage sensor, the
that is activated with a logic signal that varies in voltage regulator with the aforementioned resistor arrangement and
ranges from 0V as off and 3.3V on. In order to determine the the ESP32 module, which is the controller. On the side parts
values of the resistances of the LEDs, the ideal voltage of the is the LCD screen, and on the other side is the 3.5 mm Jack-
diode was taken between 3.1 V and where its maximum type connector that connects the current sensor; there are the
current consumption is 20 mA. Figure 7 shows the connection “female banana” type connectors that are connected to the
of the LCD Screen; first, the GND input must be energized to voltage sensor, fulfilling the objective of having a stable and
ground, and the VCC to 5V, and then the SCL input of the easy-to-operate system.
264
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
Green LED
Red LED
signaling
signaling
(NORMAL
(ALERT)
STATE)
GPIO13 GPIO12
Indicators,
Current GPIO22 GPIO14 Buzer module graphics
sensor SCT- (ALERT) and history
013
Report in
WiFi Firebase
Excel
VIN GND
Notifications
VCC Gmail/Web
Power
GND module
3.5. Software
Figure 12 shows the analysis of the system, where the
system is activated by its energy source, and then the current
and voltage sensors are read, which sends the signals to the
processor, which converts these signals into digital values,
which are processed and converted into voltage, current and
power values. These parameters are sent remotely through a
Wi-Fi connection to the Google Firebase tool, which, upon
receiving the data and processing it, sends it to a website with
which you can view the variables of the system to be measured
and whether the system detects that there is a system
Fig. 10 Isometric view of electronic integration with structure disconnection, sends an alert via a registered email.
265
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
Signal processing
Data collection through.
through the ESP32 for Conditional alerts for the
current and voltage
voltage, current and system
sensor
power conversion
Visualization of energy
consumption through a
website with graphs and
reports
266
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
3.6. Data Transmission to the Cloud structured and understandable visual representation of real-
The programming code has been developed using the time information on the web page. Upon completion of the
Arduino IDE and Visual Studio Code development platforms. code, the JavaScript files were included. These files are
Various programming languages have been used, including essential for the dynamic operation and interactivity of the
C++ for the Arduino environment, JavaScript, HTML and web application. Users can view real-time data, including
CSS for the project as a whole. For the programming process, voltage, amperage and power, using interactive graphs and
the components are initialized with the code, HTTP requests charts. Additionally, it offers the ability to access historical
from the Web Server are handled, Firebase data is updated, data through graphs and tables, providing a complete and
and the power outage is checked to send alert emails. A detailed perspective of system performance at different times.
verification of Wi-Fi credentials is performed to ensure their
accuracy. In case the credentials are incorrect, the program The code is responsible for creating a table that represents
goes into an infinite loop until a valid Wi-Fi connection is the stored voltage, amperage and power data, displaying the
established. information along with the corresponding date and time on
which it was sent. This results in the generation of small
Using the Firebase library in the Arduino IDE, credentials graphic patterns, which makes it easier to interpret variations
are verified to ensure accuracy and confirm that the address in voltage over time visually. Implemented a circular indicator
provided is correct. A secure connection point is established for a detailed graphical representation of the voltage and
between Firebase and ESP32 using the HTTPS (Hypertext amperage values received from Firebase.
Transfer Protocol Secure) protocol, which encrypts data
transmitted between the Arduino device and Firebase servers. CSS styles are applied to the corresponding HTML
The sensor data is then transmitted for proper storage in elements in the web application, providing a consistent and
Google Firebase. This encryption ensures the confidentiality pleasing visual design for users. The web application is then
and integrity of information during communication, created, and the script is published. The website is accessed to
guaranteeing secure and reliable transmission of data between authenticate the user and provides a code, which is saved from
the device and the Firebase platform. The structure of the data being used with the ESP32, leaving the project configured and
coming from the sensors for subsequent storage in a JSON created in Google Sheets to program the Firebase. Afterwards,
format contains three fundamental data: voltage, amperage the Visual Studio Code software is installed to make and
and power. This data is sent to Firebase at predefined time configure the web application. Initially, you need to establish
intervals, for example, every 10 seconds or more, while the the packages in VScode to install the other software that is
system is in an infinite loop, thus ensuring a regular and used, such as Node.js and Firebase Tools.
accurate update of information on the Firebase platform.
The electronic analyses were corroborated thanks to the
Then, the SMTP Client is configured, and the email is previous design of the circuit in the Eagle software, obtaining
sent. This feature is designed to send emails using the SMTP a few clues for the elements and verifying their correct
protocol. A comparison is made to check if the equipment is connection with the system components. In the verification of
disconnected or if there is a power outage. If any of these the computer domain, the NodeMCU microcontroller code
conditions are met, the automatic sending of an alert message was compiled in the Arduino IDE software to make the Wi-Fi
to the email previously configured in Gmail is activated as a connection with the Google Firebase database, and finally, it
preventive and notification measure for critical situations. was reviewed that the interface was intuitive with
This configuration can be edited depending on the type of alert programming language. Easy programming for sensed
you want to notify the user. parameters in the form of graphs, statistical data and historical
reports. Subsequently, the Visual Studio Code software is
The Google Sheets refresh feature is intended to establish installed to be able to make and configure the web application.
a connection with Google Sheets and send accurate voltage
and amperage data for recording and storage. The operation is The Firebase web application project is configured by
essential to ensure the reliable transfer of relevant information, creating a “project” folder and a new terminal. Log in to
thus ensuring accurate and detailed recording of voltage and Firebase with the command (firebase login) and authenticate
amperage values in the Google Sheets platform. The HTML the account to be able to enter the project. Then, a template is
page provides an interface to modify the alert and set the created with different folders, which are added to the schedule
recipient of the associated email. Importantly, this to obtain the appropriate project and configure the web in
functionality can be performed without the need for an Firebase. To deploy the application, the command (firebase
Internet connection, offering flexibility and ease of deploy) is used, which helps save the changes that were made
configuration without relying on online connectivity. In the to the program so that they can be executed. Transmission
investigation, graphic elements such as tables and charts were routes and frames are configured, which are String-type data
implemented to display the data coming from Firebase, which of voltage, amperage and power, which indicates the date and
ESP32 had previously sent. These elements provide a time from which the signals are transmitted.
267
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
The verification of the computer domain was done with Figure 15 shows in circular graph format the voltage and
the compilation of NodeMCU microcontroller code in the current parameters that are being sensed in real time. Figure
Arduino IDE software to make the Wi-Fi connection with the 16 shows the obtaining of historical data, where the
Google Firebase database, and finally, it was reviewed that the parameters regarding each reading are indicated with date and
interface is intuitive with programming language in Visual time.
Studio to easily observe the sensed parameters in the form of
graphs, statistical data and historical reports.
268
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
Replacing:
0.10848
%𝐸𝑇(𝑉) = × 100%
28
%𝐸𝑇(𝑉) = 0.39%
Table II shows the values obtained from 28 tests to record
the current variable to apply statistical calculations. To do this,
the results of the proposed system were compared with the
Fluke brand current clamp to perform statistical error
Fig. 19 Remote system alert via Gmail calculations.
269
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
Table 1. Test of the multimeter and module voltage Table 2. Test of the current clamp and SCT-013 sensor
Voltage Current
%V Test I error % I error
Test V V V error I current
error I sensor
multimeter sensor clamp
N° 1 219.6 220.2 0.00273224 0.27% N° 1 0.4 0.42 0.05 N° 1
N° 2 0.4 0.42 0.05 N° 2
N° 2 220.2 220.2 0 0.00%
N° 3 0.4 0.39 0.025 N° 3
N° 3 219 219.6 0.002739726 0.27%
N° 4 0.4 0.39 0.025 N° 4
N° 4 219.2 219.6 0.001824818 0.18% N° 5 0.4 0.39 0.025 N° 5
N° 5 219.4 219.6 0.000911577 0.09% N° 6 0.4 0.41 0.025 N° 6
N° 6 220.4 219.6 0.003629764 0.36% N° 7 0.4 0.39 0.025 N° 7
N° 7 219.2 219.6 0.001824818 0.18% N° 8 0.4 0.39 0.025 N° 8
N° 8 219.2 219.6 0.001824818 0.18% N° 9 0.4 0.39 0.025 N° 9
N° 10 0.4 0.41 0.025 N° 10
N° 9 218.8 219.6 0.003656307 0.37%
N° 11 0.41 0.41 0 N° 11
N° 10 219.7 219.6 0.000455166 0.05%
N° 12 0.4 0.42 0.05 N° 12
N° 11 220.7 219.6 0.004984141 0.50% N° 13 0.4 0.41 0.025 N° 13
N° 12 220.3 220.2 0.000453926 0.05% N° 14 0.4 0.41 0.025 N° 14
N° 13 220.4 219.6 0.003629764 0.36% N° 15 0.4 0.41 0.025 N° 15
N° 14 221 219.6 0.006334842 0.63% N° 16 0.4 0.41 0.025 N° 16
N° 15 220.9 219.6 0.005885016 0.59% N° 17 0.4 0.41 0.025 N° 17
N° 18 0.4 0.41 0.025 N° 18
N° 16 220.7 219.6 0.004984141 0.50%
N° 19 0.4 0.41 0.025 N° 19
N° 17 220.3 219.6 0.003177485 0.32%
N° 20 0.4 0.41 0.025 N° 20
N° 18 217.9 219.6 0.007801744 0.78% N° 21 0.4 0.41 0.025 N° 21
N° 19 218.4 219.6 0.005494505 0.55% N° 22 0.4 0.42 0.05 N° 22
N° 20 220.3 219.6 0.003177485 0.32% N° 23 0.4 0.41 0.025 N° 23
N° 21 217.6 219.6 0.009191176 0.92% N° 24 0.4 0.41 0.025 N° 24
N° 22 219.1 220.2 0.005020539 0.50% N° 25 0.4 0.42 0.05 N° 25
N° 26 0.4 0.42 0.05 N° 26
N° 23 217.8 219.6 0.008264463 0.83%
N° 27 0.4 0.42 0.05 N° 27
N° 24 218.2 219.6 0.006416132 0.64%
N° 28 0.4 0.42 0.05 N° 28
N° 25 220.4 220.2 0.000907441 0.09% Total current error 0.03125 3.12%
N° 26 221.5 220.2 0.005869074 0.59%
N° 27 219 220.2 0.005479452 0.55% 4.4. Regarding the Efficiency of the System
With this, the results are compared to calculate the
N° 28 220.6 220.2 0.001813237 0.18% efficiency of the system with the values of the variables
Total voltage error 0.003874421 0.39% measured in the tables. First, the calculations are made with
commercial measuring instruments, which are the multimeter
In Equation (6), the percentage error of the current is and the Fluke brand clamp meter. To do this, Equation (7) is
found: used to find the average voltage of the multimeter, then
∑1
𝑛|𝐼𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑐𝑙𝑎𝑚𝑝 −𝐼𝑠𝑒𝑛𝑠𝑜𝑟 |
Equation (8) is used to find the average current of the current
%𝐸𝑇(𝐼) = × 100% (6) clamp and finally Equation (9) is used to find the average
𝑛
power.
Replacing:
∑1
𝑛|𝑉𝑚𝑢𝑙𝑡𝑖𝑚𝑒𝑡𝑒𝑟 |
0.875 𝑉𝑎𝑣𝑔 𝑚𝑢𝑙𝑡𝑖𝑚𝑒𝑡𝑒𝑟 = (7)
%𝐸𝑇(𝐼) = × 100% 𝑛
28
∑1
𝑛|𝐼𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑐𝑙𝑎𝑚𝑝 |
%𝐸𝑇(𝐼) = 3.12% 𝐼𝑎𝑣𝑔 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑐𝑙𝑎𝑚𝑝 = (8)
𝑛
270
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
𝑃𝑎𝑣𝑔 𝑡𝑜𝑜𝑙 = 𝑉𝑎𝑣𝑔 𝑚𝑢𝑙𝑡𝑖𝑚𝑒𝑡𝑒𝑟 × 𝐼𝑎𝑣𝑔 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑐𝑙𝑎𝑚𝑝 (9) 4.5. Discussion
From the results, it is concluded that the system supports
Replacing: local and remote monitoring for the supervision of different
𝑉𝑎𝑣𝑔 𝑚𝑢𝑙𝑡𝑖𝑚𝑒𝑡𝑒𝑟 = 219.6357 𝑉 electrical parameters, which has as its fundamental element
the NodeMCU ESP32 microcontroller that optimally
𝐼𝑎𝑣𝑔 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑐𝑙𝑎𝑚𝑝 = 0.4003 𝐴 interconnects with the selected components such as the current
sensor, the voltage, the LCD, the buzzer and the LEDs to
Multiplying both values from the average voltage and complement the designed device. Likewise, the efficiency
current measurements of the instruments: evaluation resulted in 97.9289% with an error percentage of
𝑃𝑎𝑣𝑔 𝑡𝑜𝑜𝑙 = 87.9327 𝑉𝐴 0.39% and 3.12% with respect to the voltage and current
analyzed, respectively. There are few researchers who point
Then, the current, voltage and power values of the out error percentages in their system for calculating power.
proposed system are calculated using the same equation. Thus, [14] results in an error of 0.018% and others [16] show
𝑉𝑎𝑣𝑔 𝑠𝑦𝑠𝑡𝑒𝑚 = 219.7714 𝑉 errors below 20%. However, they do not compare their results
with calibrated measuring instruments to obtain the efficiency
𝐼𝑎𝑣𝑔 𝑠𝑦𝑠𝑡𝑒𝑚 = 0.4085 𝐴 of the system, as has been evidenced in the present proposed
system.
𝑃𝑎𝑣𝑔 𝑠𝑦𝑠𝑡𝑒𝑚 = 89.7923 𝑉𝐴
According to the literature reviewed, researchers
With these results obtained, the percentage of efficiency managed to monitor the variables through an LCD screen [17-
of the system with respect to commercial Fluke measurement 19]; others were able to view the magnitudes through their
instruments is calculated using Equation (10): respective monitoring platform [15]; however, they do not
𝑃𝑎𝑣𝑔 𝑡𝑜𝑜𝑙
%𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 = × 100% (10) present “Push” type notifications. ” on the web nor alerts via
𝑃𝑎𝑣𝑔 𝑠𝑦𝑠𝑡𝑒𝑚
email when the equipment is disconnected nor historical
Replacing: reports of the measured variables. In this case, it could be
87.9327 achieved thanks to the programming of the code in Java Script
%𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 = × 100% and the configuration of the appearance of the website in CSS
89.7923 that allows the voltage, current and power data to be easily
%𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 = 97.9289% displayed on the Google Firebase platform.The components
used by other researchers [15] are mainly Arduino
This proves the high efficiency of the proposed system microcontrollers, others [13] used Xbee modules, as well as
based on the results obtained with commercial measurement [16-17] used NodeMCU. From this, it can be stated that the
tools. From the results, the system supports local and remote latter is more efficient and economical.
monitoring for the supervision of different electrical
parameters, which has as its fundamental element the 5. Conclusion
NodeMCU ESP32 microcontroller that optimally The design of the system, implementing both local
interconnects with the selected components such as the current monitoring through the values displayed on the LCD, as well
sensor, the voltage, the LCD, the buzzer and the LEDs to as remote monitoring with values displayed on a web page,
complement the designed device. Likewise, the efficiency allows us to record in real-time based on indicators, graphs
evaluation resulted in 97.9289% with an error percentage of and historical electricity consumption of the home within
0.39% and 3.12% with respect to the voltage and current optimal ranges of the measured variables, thereby ensuring the
analyzed, respectively. precision of the proposed system. A monitoring system with
NodeMCU is viable for remotely monitoring the electrical
It should be noted that this proposed system was power consumption of one or more loads installed in a home,
implemented, and its operation was verified in a real way with with the purpose of supervising and optimizing its electrical
the respective hardware and software. Although it is true that consumption. According to the results obtained with
a single device was built, which allows knowing the general calibrated measuring instruments, an efficiency of 97.9289%
consumption of the load installed in the home, devices can has been obtained; therefore, it can be stated that a monitoring
also be installed in each of the electrical equipment that the and alert system applied to the residential electrical network
home has in such a way that there is a mapping of all consumer using NodeMCU is efficient and allows through the ESP32
devices to perform an optimization based on the consumption microcontroller to track the sensed variables through a web
of each of them. In the same way, this device can be installed platform in an intuitive and easy-access way for the user.For
in each home supplied by the same electrical substation and, future work, it is recommended to make comparisons with
in this way, verify that the consumption of all of them is the more high-precision commercial instruments, such as the
same as that recorded by the totalizing meter installed in the Fronius Smart Meter 63A Single-Phase, to more accurately
substation, being able to quickly detect theft of energy. determine the error percentages and system efficiency. It is
271
Ramces Cavallini-Rodriguez & Pedro Portillo-Mendoza / IJETT, 72(6), 259-272, 2024
suggested that a SIM800/SIM900 module be attached in the microcontroller could be replaced and evaluated by a smaller
communication stage so that data transmission is through a one, such as the Attiny85 and can be applied in a three-phase
GSM chip from a local company. Likewise, the electrical network for the industrial sector.
References
[1] Anang Suryana, “Monitoring Electrical Energy Consumption Through Impulse Detection Using LDR Sensors and Relay With NodeMCU
ESP8266,” 2019 5th International Conference on Computing Engineering and Design, Singapore, pp. 1-7, 2019. [CrossRef] [Google
Scholar] [Publisher Link]
[2] R. Bharathi, M. E. Madhushree, and Priyanka Kumari, “Power Consumption Monitoring System Using IOT,” International Journal of
Computer Applications, vol. 173, no. 5, pp. 23-25, 2017. [CrossRef] [Google Scholar] [Publisher Link]
[3] Dyah Lestari, Irawan Dwi Wahyono, and Irham Fadlika, “IoT Based Electrical Energy Consumption Monitoring System Prototype: Case
Study in G4 Building Universitas Negeri Malang,” 2017 International Conference on Sustainable Information Engineering and
Technology, Malang, Indonesia, pp. 342-347, 2017. [CrossRef] [Google Scholar] [Publisher Link]
[4] T.M. Thamizh Thentral et al., “Implementation of Protection Circuit for Over Voltage and Under Voltage Protection,” Materials Today:
Proceedings, vol. 45, no. 2, pp. 2460-2464, 2021. [CrossRef] [Google Scholar] [Publisher Link]
[5] J.P. Iloh, A.C. Odigbo, and C.B. Mbachu, “Internet of Things Concept for Improving Energy Metering in Power Distribution Networks,”
International Peer-Reviewed Journal, vol. 6, no. 11, pp. 632-641, 2023. [Publisher Link]
[6] Thanh Ba Nguyen, and Tri Cao Nguyen, “Design and Fabrication of an IoT-Based Smart Electrical Meter for Residential Energy
Management,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 30, no. 3, pp. 1259-1268, 2023. [CrossRef]
[Google Scholar] [Publisher Link]
[7] Electricity Statistical Yearbook 2022, Ministry of Energy And Mines (Peru), pp. 1-383, 2022. [Online]. Available:
https://www.minem.gob.pe/_estadistica.php?idSector=6&idEstadistica=13609/
[8] The Electricity Industry in Peru: 25 Years of Contributions to the Country's Economic Growth, Osinergmin, pp. 1-178, 2016. [Online].
Available: https://www.gob.pe/institucion/osinergmin/informes-publicaciones/483410-la-industria-de-la-electricidad-en-el-peru-25-
anos-de-aportes-al-crecimiento-economico-del-pais
[9] I.O. Zaitsev et al., “Line Electrical Transmission Damage Identification Tool in Distributors Electrical Networks,” IOP Conference Series:
Earth and Environmental Science, Ukraine, vol. 1254, no. 1, pp. 12-36, 2023. [CrossRef] [Google Scholar] [Publisher Link]
[10] Fransiscus Yudi Limpraptono et al., “Design of Power Monitoring and Electrical Control Systems to Support Energy Conservation,”
Proceedings of the Pakistan Academy of Sciences: Part A, vol. 58, pp. 1-7, 2021. [CrossRef] [Google Scholar] [Publisher Link]
[11] Muhammad Faiz Bin Mohd Kamal et al., “IoT-Based Electric Monitoring System for Smart Electric Meter Application,” Control and
Measurement Applications for Smart Grid, vol. 822, pp. 209-218, 2022. [CrossRef] [Google Scholar] [Publisher Link]
[12] Paul Stone Macheso, and Doreen Thotho, “ESP32 Based Electric Energy Consumption Meter,” International Journal of Computer
Communication and Informatics, vol. 4, no. 1, pp. 23-35, 2022. [CrossRef] [Google Scholar] [Publisher Link]
[13] Darwin Alulema, Mireya Zapata, and Miroslava Aracely Zapata, “An IoT-Based Remote Monitoring System for Electrical Power
Consumption via Web-Application,” 2018 International Conference on Information Systems and Computer Science, Quito, Ecuador, pp.
193-197, 2018. [CrossRef] [Google Scholar] [Publisher Link]
[14] Wiwid Suryono et al., “Monitoring and Controlling Electricity Consumption Using Wemos D1 Mini and Smartphone,” International
Conference on Advanced Mechanical and Industrial Engineering, Banten, Indonesia, vol. 909, pp. 1-10, 2020. [CrossRef] [Google
Scholar] [Publisher Link]
[15] Oltean Andrei et al., “IoT Power Monitoring Device Using Wi-fi and Arduino,” 2021 9th International Conference on Modern Power
Systems, Cluj-Napoca, Romania, pp. 1-6, 2021. [CrossRef] [Google Scholar] [Publisher Link]
[16] Firdaus Jonathan, and Tri Wahyu Oktaviana Putri, “Prototype of Home Power Monitoring Tool for Electrical Outlet Using ESP32,” 2021
International Conference on ICT for Smart Society, Bandung, Indonesia, pp. 1-5, 2021. [CrossRef] [Google Scholar] [Publisher Link]
[17] Huan-Liang Tsai, Le Phuong Truong, and Wei-Hung Hsieh, “Design and Evaluation of Wireless Power Monitoring IoT System for AC
Appliances,” Energies, vol. 16, no. 1, pp. 1-27, 2023. [CrossRef] [Google Scholar] [Publisher Link]
[18] Komkrit Chooruang, and Kraison Meekul, “Design of an IoT Energy monitoring System,” 2018 16th International Conference on ICT and
Knowledge Engineering, Bangkok, Thailand, pp. 1-4, 2018. [CrossRef] [Google Scholar] [Publisher Link]
[19] Abdul-Waliyi O. Muhammed et al., “Design and Implementation of an IoT Based Home Energy Monitoring System,” 2022 5th Information
Technology for Education and Development, Abuja, Nigeria, pp. 1-7, 2022. [CrossRef] [Google Scholar] [Publisher Link]
[20] Ewerton L. de Sousa et al., “Development a Low-Cost Wireless Smart Meter with Power Quality Measurement for Smart Grid
Applications,” Sensors, vol. 23, no. 16, pp. 1-21, 2023. [CrossRef] [Google Scholar] [Publisher Link]
[21] Suhanto et al., “The Electrical Energy Usage of Monitoring System at Real-Time Using IoT as the Primary Policy of Energy Efficiency,”
International Conference on Advanced Mechanical and Industrial Engineering, Banten, Indonesia, vol. 909, pp. 1-9, 2020. [CrossRef]
[Google Scholar] [Publisher Link]
272