Design of Internet Electrical Power Usage Metering System Based on
ESP32s Mcu and Mysql Database with User Interface Application
Andy Suryowinoto
1a
, Teguh Herlambang
2b
, Fahmi Jidan Mediansyah Fasla
1
and Hery Irawan
3c
1
Electrical Engineering Department,
Institut Teknologi Adhi Tama Surabaya,
Arif Rahman Hakim Street, Surabaya, Indonesia
2
Universitas Nahdlatul Ulama Surabaya, Surabaya, Indonesia
3
Mechanical Engineering Department, Institut Teknologi Adhi Tama Surabaya, Surabaya, Indonesia
Keywords: kWh Meter, Database MySQL, VB.NET, Internet of Things (IoT), Monitoring.
Abstract: This research concerned with the problem of high payment of electric power consumption for households
increasing to 12.6%. Normal price in August 2021 reached IDR 286,000 for consuming 1 TV, 2 fan, and 10
lamps. In September 2021, it increased to IDR 322,000 within the same electric power consumption as in
August 2020. Therefore, the researcher designed the monitoring system using kWh meter by implementing
the principles of Internet of Things (IoT) in the feature of MySQL database web server. The method use in
this research is engineering research, which tested several samples through observation method upon the
system of electric power consumption by employing kWh meter. The research results were divided in 2
categories during 7 days of trial to 2 users. Furthermore, the monitoring processes were classified in two
categories i.e. rush hour or night and non- rush hour or morning. The average inaccuracy of the current sensor
after testing and calibration is 0.31% for the ACS712ELCTR-5A-T current sensor and 0.0017% for the
ZMPT101B voltage sensor. Conclusion of this research that the data delivery to the web server database was
successful without any number differences send by microcontroller and UI VB.NET, meaning that it could
accumulate the kWh value.
1 INTRODUCTION
The use of electrical energy has become one of the
main needs for human life as one of the efforts of the
economic concept of capital to calculate the use of
electrical energy. Today a lot of equipment that has
been created uses and also depends on electrical
energy sources. To measure the use of electrical
energy using a device called the Kilo Watt hour-meter
(kWh-meter).
The use of electrical energy has become one of the
main needs for human life as one of the efforts of the
economic concept of capital to calculate the use of
electrical energy (Pujiharsono et al., 2015) Today a
lot of equipment namely, by using the kWh-meter
reading and converting it into a digital image that can
be read and sent. on (Lestari et al., 2021) Today a lot
of equipment that has been created uses and also
a
https://orcid.org/0000-0002-0709-4076
b
https://orcid.org/0000-0001-7940-5104
c
https://orcid.org/0000-0003-2979-9277
depends on electrical energy sources. To measure the
use of electrical energy using a device called the Kilo
Watt hour-meter (kWh-meter).
Therefore, this study aims to design a building, a
system for using electric power for homes, based on
internet protocol using web hosting as a means of
storing data from sensor readings, onto a server with
a MySQL database. a kWh meter equipped with
current and voltage sensors as input data which will
be displayed in the monitoring process in reading the
value of electric power consumption. How this kWh
meter works can determine the consumption input of
the household's electricity usage, with the hope of
knowing an efficient way of using this electricity with
a warning. Current and voltage sensor readings will
be converted into power units (Watts), and the results
will be uploaded to [3] web hosting protocol into
the MySQL database web server. Apart from
converting energy values, on Visual programming.
260
Suryowinoto, A., Herlambang, T., Fasla, F. and Irawan, H.
Design of Internet Electrical Power Usage Metering System Based on ESP32s Mcu and Mysql Database with User Interface Application.
DOI: 10.5220/0012108700003680
In Proceedings of the 4th International Conference on Advanced Engineering and Technology (ICATECH 2023), pages 260-264
ISBN: 978-989-758-663-7; ISSN: 2975-948X
Copyright
c
2023 by SCITEPRESS Science and Technology Publications, Lda. Under CC license (CC BY-NC-ND 4.0)
Where later it will also be converted into the price
per kWh into the nominal form of IDR (Rp.). The
average value of electricity usage per day will be
recorded and stored in the MySQL database for
estimation(Herlambang et al., 2022) use of electrical
energy. After achieving data collection for 30 days (1
month), the next step is to recapitulate electricity
usage, all averaged into prices for usage each month,
so that with the aim of users can save and estimate the
use of electrical energy at home.
2 LITERATE REVIEW
2.1 Energy Usage Measurement
Study (Shu et al., 2007)A kilo Watt Hour (kWh)
meter is a tool for measuring active energy that uses
a counter and uses the principle of magnetic induction
according to (Khawas & Shah, 2018) that alternating
current is used, and if there is self-induction in the
circuit, the energy given to the circuit cannot be
measured by observing the deflections on a voltmeter
and an ammeter and measuring the intervals of time
with a watch and multiplying of these values together,
the following equation can be used(Ricks, G.W.D.
(March 1896). “Electricity Supply Meters”. Journal
of the Institution of Electrical Engineers 25 (120):
57–77. - Google Search, n.d.)).
𝑉
𝐶 𝑑𝑡


(1)
where, V being considered as being constant, the
meter needs then only C measure with units coulomb-
meter. And t is time measured interval.
2.2 Convert kWh to Nominal
Electrical energy generates power, and from the
power generated it can power equipment to
facilitate human work which has the active power
formula [W] defined as follows (Shenbagalakshmi
& Jaya, 2020):
𝑃 = 𝑉. 𝐼. 𝐶𝑜𝑠∅ (2)
The formula for energy use (kWh) in electricity
tariffs in a day is obtained from the following
calculation:
𝑒𝑛𝑒𝑟𝑔𝑦 =

(3)
Where, P is the total power consumption used in
(Watts), while the constant 1000 is a constant used to
convert(Shenbagalakshmi & Jaya, 2020) from
Watt/hour units to kiloWatt/hour units. Calculation of
the fee paid to estimate the amount of energy used
(kWh) used in IDR (Rupiah) nominal units, where the
calculation will be cumulative with the use of
electrical energy for 1 month or 30 days. Using the
basic electricity tariff of IDR. 1444.70 per kWh, for
the tariff for class R-1/TR residential houses, then to
calculate the range of energy use against the basic
electricity tariff that applies is in equation 4 as
follows.
𝐸𝑙𝑒𝑐𝑡𝑟𝑖𝑐𝑖𝑡𝑦 𝑏𝑖𝑙𝑙 =
𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑 𝑘𝑊ℎ 𝑥 𝐼𝐷𝑅. 1444,70 (4)
2.3 Data Storage
In the cumulative data used, of course, data storage is
needed, where the database is obtained from
measurements from modules that have been designed
by researchers, installed in residential homes, and
sent using wireless transmission with internet
protocols, arranged into several categories or groups
of data types in one tabular form. or entities. Using a
MySQL database is a database server that is freeware.
3 METHOD
For the mutual benefit and protection of Authors and
Publishers, it is necessary that Authors provide
formal written Consent to Publish and Transfer of
Copyright before publication of the Book. The signed
Consent ensures that the publisher has the Author’s
authorization to publish the Contribution.
The copyright form is located on the authors’
reserved area.
The form should be completed and signed by one
author on behalf of all the other authors.
3.1 Internet of Things System Design
Each system has a relationship between the input and
output that will be given from the workings of the
system. The block diagram is one form of how the
system will work with the conditions to achieve the
intended goals. The following is a block diagram of
the system of the Internet of Things (IoT)-based
Electric Power Usage Monitoring System.
3.2 Work System Design
This section will explain the software diagram blog
and system flowcharts. The following is an
explanation of the Software Block Diagram as well as
Design of Internet Electrical Power Usage Metering System Based on ESP32s Mcu and Mysql Database with User Interface Application
261
the overall system flowchart which can be seen in the
following figure:
Figure 1: Hardware Block Diagram
Figure 2: Overall Work System Flowchart
In Figure 2.a it can be explained that the
connectivity between all the software, where in the
PHP programming to connect to the database and
contains the GET or POST sending methods that
will be used by the Arduino IDE programming.
After the Arduino programming is connected to
PHP, it then sends a series of reading data to be
stored in the MySQL database, provided that it is
sent to the microcontroller connected to Wi-Fi.
Furthermore, the monitoring process is carried out
by connecting to Wi-Fi on the monitor/PC so that it
can display data into the user interface that has been
made. In the VB.NET user interface, it will display
data per day or month according to the time and year
that has been determined. And lso, this UI will
convert kWh values into IDR values and upload IDR
values as bills for a month.
The workings of this system are active
microcontroller initialization, the sensor will
automatically take and send data to the
microcontroller to be processed through a calibrated
formula and conversion from the ADC, then the data
will be sent to the entry cloud web server which will
be authenticated by the MySQL database server via
the link instruction provided. programmed on the
ESP32 microcontroller. During the process of sending
data to the database in 10-minute intervals 1 data is
complete then the data will be collected into the
MySQL database server. If authentication is still
incomplete or not running, it must be re-authenticated
so that the data can be stored on the database server.
Furthermore, these data will be recorded and
processed to upload a billing list to the MySQL
database server.
3.3 Result and Discussion
3.3.1 Test Results Data 1 (on User 1)
This user has retrieved electrical power
measurement data in June from which is
automatically inputted into the tables in the user
database, namely dB_monitoring user1 which has
been changed to the following graphic image.
Figure 3: User 1 Data Graph.
Figure 4: Monitoring Data Conversion to kWh User 1.
In Figure 3.a is a graph of the results of the
monitoring process originating from sending the
microcontroller to the MySQL database which is
displayed on the VB.Net user interface. The sending
process from the NodeMCU-32S Microcontroller is
to send data at intervals of 10 minutes per 1 data
taken starting from 06.00 AM – 16.00 PM for 7
days, namely June namely June 13 – June 19, 2021.
From this graph it can be seen that the highest
power usage when using all equipment load of 2.21
A so that the kWh found also follows the increase.
ICATECH 2023 - International Conference on Advanced Engineering and Technology
262
The surge in current is due to the load of the iron
being too large, if the load of the iron is removed
from the normal use switch 5 loads The light and fan
only reach 0.7 A. the use of iron loads is used
significantly every 12 noon to 13 noon. In Figure 3.b
is a graph of the average hourly conversion on a
daily basis from the test results of Figure 3.b. This
conversion is to determine the average of the voltage
value, current value, and kWh power usage every
hour using the formula kWh = (6 kW data added / 6
data).
3.3.2 Test Results Data 2 (on User 2)
This user has retrieved electric power measurement
data in July from which is automatically inputted
into the tables in the user database, namely
dB_monitoring user2 which is changed to the
following graphic image.
Figure 5: User 2 Data Graph
Figure 6: Monitoring Data Conversion to kWh User 1
In Figure 4.a is a graph of the results of the
monitoring process originating from sending the
microcontroller to the MySQL database which is
displayed on the VB.Net user interface. The sending
process from the NodeMCU-32S Microcontroller is
to send data at intervals of 10 minutes per 1 data
taken from 06.00AM – 16.00 PM for 7 days, namely
June 21 – June 27, 2021. The highest power usage
when using all equipment loads is 2.11 Amp so that
the kWh found also follows an increase. The surge
in current is due to the load of the iron being too
large, if the load of the iron is removed from the
normal use switch 4 loads The light and fan only
reach 0.6 A.
sing the formula kWh = (6 kW data added
up / 6 data).
3.3.3 Test Results of Average Power Usage
Comparison Between 2 Users
The comparison of electric power usage between the
2 users of this monitoring system is by taking a
sampling of test data at certain hours, namely at
09.00 AM–13.00 PM.
Figure 7: Graph of Average Comparison of 2 Users.
In Figure 5 is data taken from a table in the
database, which is named tb kwh per hours, from the
author's observations it can be concluded that during
peak hours the two users can be compared, the first
user has the highest peak current at 2, 21 Amp, while
the second user is only 2.08 Amp and the use of
electric power used is more dominant in the use of
electrical equipment within 5 days of data
collection, it can be seen that there are only 5 surges
in the current load. After reaching 5 days, it can be
concluded that the last 2 days the load of the
equipment used by the two users of the monitoring
system only used normal equipment, because there
was no significant current spike between the two
users in the last 2 days of data collection.
4 CONCLUSIONS
Based on the research data, it can be concluded that
this system can work well. This web-based
monitoring system for kWh meters uses the
NodeMCU-32S microcontroller with 2 voltage
sensors (ZMPT101B) and current sensors
(ACS712ELCTR-5A-T) to process kWh values by
accumulating them into the active power formula,
namely from the data of the two sensors. From the
results of research through testing this monitoring
system with the UI that has been made to be able to
Design of Internet Electrical Power Usage Metering System Based on ESP32s Mcu and Mysql Database with User Interface Application
263
process the entire implementation of Internet Of
Things (IoT)-based data transmission correctly in
retrieving monitoring data on electric power usage
(kWh) for 7 days in June 2021 for 2 service users
Monitoring system with user 1 has a bill of IDR.
15,121,674 and user 2 has a bill of IDR. 16390,121.
REFERENCES
Herlambang, T., Rahmalia, D., Suryowinoto, A., Yudianto,
F., Susanto, F. A., & Anshori, M. Y. (2022). H-infinity
for autonomous surface vehicle position estimation.
Journal of Physics: Conference Series, 2157(1),
012022.
Khawas, C., & Shah, P. (2018). Application of Firebase in
Android App Development-A Study. International
Journal of Computer Applications, 179, 49–53.
https://doi.org/10.5120/ijca2018917200
Lestari, D., Arrohman, M. L., & Wirawan, I. M. (2021).
Implementation of the Internet of Things for kWh
Meter Data Logger in Shopping Mall. 2021 7th
International Conference on Electrical, Electronics
and Information Engineering (ICEEIE), 329–334.
https://doi.org/10.1109/ICEEIE52663.2021.9616836
Pujiharsono, H., Nugroho, H. A., & Wahyunggoro, O.
(2015). The stand meter extraction of kWh-meter. 2015
International Conference on Science in Information
Technology (ICSITech), 202–206.
https://doi.org/10.1109/ICSITech.2015.7407804
Ricks, G.W.D. (March 1896). “Electricity Supply Meters”.
Journal of the Institution of Electrical Engineers 25
(120): 57–77. - Google Search. (n.d.).
Shenbagalakshmi, V., & Jaya, T. (2020). A Study on
Monitoring an Air Conditioning (AC) system in a
Home environment using Machine Learning
Techniques. 2020 4th International Conference on
Electronics, Communication and Aerospace
Technology (ICECA), 1412–1417.
https://doi.org/10.1109/ICECA49313.2020.9297484
Shu, D., Ma, S., & Jing, C. (2007). Study of the Automatic
Reading of Watt Meter Based on Image Processing
Technology. 2007 2nd IEEE Conference on Industrial
Electronics and Applications, 2214–2217.
https://doi.org/10.1109/ICIEA.2007.4318804
Moore, R., Lopes, J. (1999). Paper templates. In
TEMPLATE’06, 1st International Conference on
Template Production. SCITEPRESS.
Smith, J. (1998). The book, The publishing company.
London, 2
nd
edition.
ICATECH 2023 - International Conference on Advanced Engineering and Technology
264