SMART ENERGY METER USING TELEGRAM BOT
S.S. Sulaiman1, N. Mohd Nor1, Z. Haji Baharudin1,2, I. Ismail1, N. Baharudin2, H. Sidek2
Electrical & Electronic Engineering Department, Universiti Teknologi PETRONAS, 32610, Bandar Seri Iskandar, Perak,
Malaysia1
SIRIM Berhad, No.1, Persiaran Dato’ Menteri, Section 2, 40700, Shah Alam, Selangor, Malaysia 2
[email protected],
[email protected],
[email protected],2,
[email protected],
[email protected],
[email protected] Keywords: smart meter, energy meter, telegram bot, CT Since the inception of electricity deregulation and
sensor, raspberry pi market-driven pricing throughout the world, utilities have
been looking for a means to match consumption with
Abstract generation. Traditional electrical and gas meters only
measure total consumption, and so provide no information of
when the energy was consumed at each metered site. Smart
A smart meter in which the application designed to be meters provide a way of measuring this site-specific
able to perform two-way communication wirelessly between information, allowing utility companies to introduce
the meter unit with centralized units that differs from the different prices for consumption based on the time of day
conventional energy meter with functionality limited to and the season.
measurement of total energy consumption without being Energy utility producer designed a smart that are lesser
able to provide any information of energy usage to the user. in production cost to reduce their business cost. Reducing
The issue of untracked electricity usage during the one- the need to send employee to each residential housing area
month period make the system vulnerable to power theft, [1, 8], through the smart meter communication channel, the
power misused and overconsumption without prior notice to meter reading can be recorded remotely [9]. In cases of
the user. The system is developed using suitable controller power outages or power demand is higher than supplied, a
board and sensors to allow the system integration with quick utility response can be implemented with enough
conventional meter providing the smart meter functionality. monitoring from time to time. Nowadays, the access to real-
The objective of the project is to design a smart meter which time power usage billing information is becoming a common
provide user with wireless energy monitoring functionality thing in the society, thus slowly implementing an energy-
with the use of the Telegram bot application. saving habits as well helping people to save money as well.
Majority of the smart meter design have the capability to
send home warning message if the power usage and billing
1 Introduction limit is exceeded from the level designated.
Thus the current conventional electromechanical energy
A device that created with the capability of energy meter is still usable but lacking the functionality of
consumption recording of the intervals of per hourly basis or information sharing to the user as smart meter functionality.
even lesser is called the smart energy meter. The smart meter The development of a system that can be integrated with the
term usually associated with the electricity but it can also be conventional metering system without removal of existing
referred to the device for natural gas or water consumption system is a viable option that can be look into.
measurement in some countries. The smart meter will be This paper will discuss the development of smart energy
able to do two-way communication between the meter and meter using the telegram bot for the user interface. Further
the centralized unit [1] as the information sharing for discussion on the detail of energy meter design will be in
monitoring and billing purpose [2-5]. Similarly, the meter section 2 which cover about the main controller and sensors
that is built to function as interval or time-of-use meters [6] used as well as the setup for the telegram bot and the section
have long existed before but the “Smart Meter” designed to 3 will discuss on the Telegram bot application result.
involve real-time sensors, power outage reporting and power
quality monitoring in such example of an Advanced
Metering Infrastructure (AMI) that have two-way metering 2 Energy Meter System Design
communications differs from the conventional Automatic The Figure 1 is the general system design requirements
Meter Reading (AMR). The option of communication for the smart meter application. The whole design will be
networking from the meter can be done in two ways such as integrated with the existing energy meter to extend the
wired connections by power line and cables or wirelessly capability of the metering application with the wireless
[7]. By the means of wireless connections, the options are communication to the centralized unit and user.
widely available to use either cellular network, Wi-Fi,
Wireless network, mesh network, low power long range
wireless (LoRaWAN), Zigbee, Wi-SUN and etc.
Authorized licensed use limited to: Universitas Airlangga. Downloaded on January 15,2024 at 03:45:41 UTC from IEEE Xplore. Restrictions apply.
Table 1: Controller Boards Specifications [18]
Figure 1: General Energy Meter System Design
The significance of application of wireless technology is
becoming a major demand in private and public sector. The
creation of IoT designed specifically for the wireless
technology development and research. Usage of Wifi and
GSM standards is guaranteed to provide the same or better
functionality compared to the wired conventional
technology. Furthermore, the IoT allow the information
gathering and machine communication is done wirelessly to
cover such area that the cables cannot reach or too far with
the civilization. There are others controller boards available in the market
besides Raspberry Pi board. Table 1 shows the comparison
2.1 Main controller of the other boards with Raspberry Pi in term of size, weight,
cost, RAM, power, operating system, programming
As per project development, the Raspberry Pi with size language, analogues inputs, digital I/O pins, USB ports,
of credit card [10, 11] and fully customizable and LAN and Wifi module. All considerations are taken and with
programmable computer [12] is selected as the controller the latest model of Raspberry Pi 3 Model B built in wifi
board for the energy meter. Designed with 700Mhz ARM II module, the Raspberry Pi is decided as the chosen main
co-processor Broadcom Video Core IV graphics together controller for the project.
with 512Mb RAM for model B [10, 13-15] and 26Mb RAM
for model A [16]. The operating system for the Raspberry Pi 2.2 Voltage and current sensors
is an open-source Linux called a Raspbian OS [10, 17]
programmed by the GNU Octave and python [13] The sensors required for the energy meter system are
programming language. The board can run on android, arch voltage sensor and current sensor to allow the power
Linux ARM, firefox OS, Google Chromium, Fedora, Plan 9, measurement can be carried out. The proposed sensors for
risc and Unix for various usage other than automation the meter design are AC-AC adapter and CT sensor. Besides
purpose such as playing games and watching movies [10]. It that the absence of analog pin in the Raspberry Pi board can
also packed with MicroSD card slot, 10/100Mbps Ethernet be compensated by using an ADS1115 module as the analog
port, USB port, HDMI, audio and video jack [10] which give to digital converter (ADC) to be connected with the
it the more flexibility in the design and programming. The Raspberry Pi board in which the module can provide a high
Figure 2 shows the components of the board. precision data range of up to 15 bits measurement value.
The AC-AC adapter which is a small scale potential
transformer used for low AC voltage rating. Nevertheless,
the output of the sensor need to be conditioned so that it will
meet the condition for the ADC module analog pins. While
AC voltage have the positive and negative cycle, the ADC
module only can measure positive voltage of 0V while AC
voltage so a DC bias is supplied to the interfacing circuit to
allow the AC voltage to propagate in positive voltage range.
The Figure 3 shows the circuit consist of voltage divider and
2.5V DC bias to produce a voltage sensor output that within
5V peak-peak voltage.
Figure 2: the Raspberry Pi's Components [17]
Authorized licensed use limited to: Universitas Airlangga. Downloaded on January 15,2024 at 03:45:41 UTC from IEEE Xplore. Restrictions apply.
measurement for the real power, reactive power, apparent
power and power factor for analog voltage and current are
shown in below.
(1)
(2)
(3)
(4)
As mention earlier, the absence of analog pin in the
Raspberry Pi board cause the equation 1-4 cannot be applied
as the main equation for power measurement in the energy
Figure 3: Voltage Sensor Interfacing Circuit meter. Thus, equation 5-11 shown is applied since the
formula is designed for digital input signal measurement at
discrete time. The equations are used for the system that
only process digital input signal but able to obtain the same
power measurement value as the analog power equations
measurements.
(5)
(6)
(7)
Figure 4: CT Sensor Interfacing Circuit
(8)
Next, the CT sensor which is a small scale current
(9)
transformer designed to be used for current rating less than
100A also need to be connected with an interfacing circuit. (10)
The CT sensor give current output whereas the analog input (11)
pins only able to measure analog voltage input so, a burden
resistor is connected parallel to the sensor output to convert
2.4 Setting up the telegram bot
the current output into a voltage output. Figure 4 shows the
connection of CT sensor output to a burden resistor as well The Telegram is an optimal cloud-based instant
as with DC bias voltage so that the CT sensor output will be messaging service with application that can be combined
able to be measured by the ADC module. with Raspberry Pi for any developer’s usage. The
application compatibility with almost every platform such as
2.3 Power measurement formulation android, iOS, window phone, windows NT, macOS and
linux give a very good support for any developer. The
In the knowledge of electrical power calculation, there
flowchart for the setting up the Bot and application with the
are three basic AC power components which can be
energy meter is as in Figure 5.
identified as active power, reactive power and apparent
First of all, the user need to install the Telegram
power. The active power comes from the portion of power
application on the mobile device. Later on, using the Bot
that averaged over a complete AC waveform cycle while the
Father to create a new custom Bot since BotFather itself is a
reactive power comes from the stored energy that are
Bot created to allow easy bot creation for another developer.
returned to source in each AC waveform cycle. The
The bot created is for the energy monitoring bot is guided
combination of these active power and reactive power is
thoroughly by the BotFather as shown in Figure 6. The
represented by single name in which is the apparent power.
BotFather allow any developer with little knowledge of
In electrical calculation, the arithmetic is done in scalar
mobile app development to develop personalized wireless
quantities so any real and imaginary components need to be
application for various purpose. The Telegram app provide a
converted into its polar magnitude before any calculation can
platform for various complex development become a simpler
be done.
step for everyone.
Electricity exist as an analog quantities represented by
two basic form of voltage and current. The voltage and
current components is then used to formulate the
Authorized licensed use limited to: Universitas Airlangga. Downloaded on January 15,2024 at 03:45:41 UTC from IEEE Xplore. Restrictions apply.
Figure 6: List of Available Command Given By BotFather
Figure 5: Flowchart of the Telegram Bot setup
Figure 7 shows that the bot created will not overlap with
existing bot. The BotFather will notify about the existing bot
until the user set the username that do not overlap with other
bot. The bot created ensure that only the user with Token can
access the bot for any changes. This acts as a security or
password for the bot so that other people cannot simply
making changes to energy metering bot. The Token given as
in Figure 7 should be given to developers with admin access
only.
Figure 7: Creating a Custom Bot
Authorized licensed use limited to: Universitas Airlangga. Downloaded on January 15,2024 at 03:45:41 UTC from IEEE Xplore. Restrictions apply.
The bot created is then programmed so that it will
respond to any command given from the Raspberry Pi
program. The user will be notified through the Telegram
application whenever the bot received any information or
command from the Raspberry Pi program.
3 Result and Discussion
The bot is coded so that it will react and send data
according to user command. To ensure the bot provide the Figure 10: Telegram Bot Meter Billing
easiest user access, the list of command already pre-set in
the bot system so that user only need to choose the command Further development of the energy monitoring bot
needed for any command. The Figure 8 shows the including user able to control the home appliances wirelessly
‘command1’ response given by the telegram bot. with just a simple Telegram bot command. The telegram bot
can give command to the controller to trigger the I/O pins to
turn ON or OFF any electrical appliances with the help of
relay circuit.
4 Conclusion
The smart energy meter development using Telegram
bot is one of alternative for the energy monitoring though
wireless communication since the application can function
with the internet access through Wifi or GSM. The system
developed should be able to be integrated with the existing
conventional kwh energy meter without need to replace with
new meter thus providing an easier and cheaper alternative
for smart metering application implementation.
Figure 8: Telegram Bot Energy Meter Reading Acknowledgements
In the cases that the sensor is damaged or The author acknowledges the support from the Universiti
malfunctioning, user can use ‘command2’ input to get the Teknologi PETRONAS and Ministry of Higher Education
energy meter status. If the sensors are giving input reading to (MOHE) for the award of the Fundamental Research Grant
the main controller, the system will return status message to Scheme (FRGS) 0153AB-L07.
the Telegram bot as in Figure 9 below.
References
[1] Z. Jebroni, H. Chadli, B. Tidhaf, A. Benlghazi, and
A. Tahani, "Gain correction and phase
compensation of a smart electrical energy meter," in
2016 International Conference on Engineering &
MIS (ICEMIS), 2016, pp. 1-6.
[2] L. C. Saikia, H. Das, N. B. D. Choudhury, and T.
Malakar, "GPRS enabled smart energy meter with
in-home display and application of time of use
pricing," in 2016 IEEE Annual India Conference
Figure 9: Telegram Bot Meter Status (INDICON), 2016, pp. 1-5.
[3] R. K. Pandey and M. Misra, "Cyber security threats
The user also can monitor the total power used and the — Smart grid infrastructure," in 2016
corresponding electricity bill by key in the ‘command3’ National Power Systems Conference (NPSC), 2016,
input to the bot. Figure 10 shows the data for the cumulative pp. 1-6.
power and bill reading by the system. [4] R. V. Jadhav, S. S. Lokhande, and V. N. Gohokar,
"Monitoring of transformer parameters using
Internet of Things in Smart Grid," in 2016
International Conference on Computing
Communication Control and automation
(ICCUBEA), 2016, pp. 1-4.
Authorized licensed use limited to: Universitas Airlangga. Downloaded on January 15,2024 at 03:45:41 UTC from IEEE Xplore. Restrictions apply.
[5] S. Tayeb, M. Mirnabibaboli, L. Chato, and S. Latifi, constraints," in 2014 37th International Convention
"Minimizing energy consumption of smart grid data on Information and Communication Technology,
centers using cloud computing," in 2017 IEEE 7th Electronics and Microelectronics (MIPRO), 2014,
Annual Computing and Communication Workshop pp. 1013-1018.
and Conference (CCWC), 2017, pp. 1-5. [18] L. R. Wilhelmsson, M. M. Lopez, and D. Sundman,
[6] H. Das and L. C. Saikia, "GSM enabled smart "NB-WiFi: IEEE 802.11 and Bluetooth Low
energy meter and automation of home appliances," Energy Combined for Efficient Support of IoT," in
in 2015 International Conference on Energy, Power 2017 IEEE Wireless Communications and
and Environment: Towards Sustainable Growth Networking Conference (WCNC), 2017, pp. 1-6.
(ICEPE), 2015, pp. 1-5.
[7] V. Preethi and G. Harish, "Design and
implementation of smart energy meter," in 2016
International Conference on Inventive Computation
Technologies (ICICT), 2016, pp. 1-5.
[8] P. A. Chandra, G. M. Vamsi, Y. S. Manoj, and G. I.
Mary, "Automated energy meter using WiFi
enabled raspberry Pi," in 2016 IEEE International
Conference on Recent Trends in Electronics,
Information & Communication Technology
(RTEICT), 2016, pp. 1992-1994.
[9] T. Tony, P. Sivraj, and K. K. Sasi, "Net energy
meter with appliance control and bi-directional
communication capability," in 2016 International
Conference on Advances in Computing,
Communications and Informatics (ICACCI), 2016,
pp. 2650-2653.
[10] W. Anwaar and M. A. Shah, "Energy Efficient
Computing: A Comparison of Raspberry PI with
Modern Devices," Energy, vol. 4, 2015.
[11] M. Maksimović, V. Vujović, N. Davidović, V.
Milošević, and B. Perišić, "Raspberry Pi as Internet
of things hardware: performances and constraints,"
design issues, vol. 3, p. 8, 2014.
[12] V. Sandeep, K. L. Gopal, S. Naveen, A. Amudhan,
and L. S. Kumar, "Globally accessible machine
automation using Raspberry pi based on Internet of
Things," in 2015 International Conference on
Advances in Computing, Communications and
Informatics (ICACCI), 2015, pp. 1144-1147.
[13] S. Banerjee, D. Sethia, T. Mittal, U. Arora, and A.
Chauhan, "Secure sensor node with Raspberry Pi,"
in IMPACT-2013, 2013, pp. 26-30.
[14] N. Huu-Quoc, L. Ton Thi Kim, M. Bui Dinh, and
H. Eui-Nam, "Low cost real-time system
monitoring using Raspberry Pi," in 2015 Seventh
International Conference on Ubiquitous and Future
Networks, 2015, pp. 857-859.
[15] S. Ferdoush and X. Li, "Wireless Sensor Network
System Design Using Raspberry Pi and Arduino for
Environmental Monitoring Applications," Procedia
Computer Science, vol. 34, pp. 103-110,
2014/01/01 2014.
[16] S. Jain, A. Vaibhav, and L. Goyal, "Raspberry Pi
based interactive home automation system through
E-mail," in 2014 International Conference on
Reliability Optimization and Information
Technology (ICROIT), 2014, pp. 277-280.
[17] V. Vujović and M. Maksimović, "Raspberry Pi as a
Wireless Sensor node: Performances and
Authorized licensed use limited to: Universitas Airlangga. Downloaded on January 15,2024 at 03:45:41 UTC from IEEE Xplore. Restrictions apply.