Monitoring the Consumption of Electrical Energy Based on the Internet of Things Applications

One of the instrumental functional overheads in many commercial edifices and industrial plants is the electricity bill. The design and development of a Smart Power monitoring device used to make monitoring on the electrical parameters represented as voltage, current, and power of Wasit university buildings. The system has a unit with smart sensing to detect and control the electrical devices employed for daily activities by following different tariff rates. It has the capability to decrease consumer costs improving grid stability. A developed model was broadly examined and experimental results comparing these results with devices of conventional measuring. The Arduino based wireless power meter is a non-invasive existing meter for domiciliary power with a WI-FI Connection. The split-core is used to measure the current transformers. 802.11b connection is a means for transmitting data through the home’s wireless router to the base station and monitoring a web portal based on a wireless sensor network. A clear projection for domestic data use is one of the aims of this project. By these data, it can supply estimation to consumption power. Optimizing and reducing power usage are the objectives of providing such data. Keywords—Monitoring device, Power Consumption, Internet of Things


Introduction
At present, electric power consumption has become noticeable in all fields. Because of modern technology, various electrical appliances and equipment have become available everywhere, so it has become necessary to find different ways to control and monitor the consumption of electrical energy. Where Wasit University was chosen to implement a project by using the Internet of Things where it was designed to monitoring Power Consumption wirelessly by depending on IoT applications with using wireless sensor network via a WI-FI Connection. The WSN definition is a group of sensors that spatially dispersed and linked wirelessly by a Radio Frequency (RF connection) [1,2]. Those meant sensors collect gathered sensory info, like temperature, lighting, pressure, etc. which can be transferred over the wireless link to the base station that put the sensor data in the process of gathering the desired info about the setting. Throughout the latest improvement of the micro-electromechanical system (MEMS) potential devices, other sensors became pervasive over various fields for the purpose of sensing process and tracking one [3][4][5][6]. The inhospitable terrain deployment of the sensors is a very important advantage, such as by dropping them randomly from an airplane. Alternatively, if the haphazard positioning has been used, then the sensors must be able of defining themselves into a network wirelessly to gather and transfer the data to a base station for collecting info. The need for low power consumption is one of the node's primary constraints. Temporal functionality is a must for sensor nodes to be capable of switching to a power-saving mode when not necessary. Almost all those requirements attempt to create a very interesting area for researching and developing from sensor network technology. Gathering energy-consumption data for a certain loading section is one of the key challenges related to the energy auditing process. Logging and storing data of load consumption in a specific interval and periods usually require sophisticated measurement equipment. Sites without a functioning SCADA system, it would mean that the measurement is conducted manually and periodically by the qualified personnel [7][8][9].

Literature Review
Some researches and articles were presented, these researches talking about the WSN. the way to execute the IoT systems, the integration of the WSN with the IoT is a new generation of the M2M (Machine to Machine) Communication and the Scientific research played a valuable role in the Collecting data from sensors and use them in IoT applications [10][11][12][13]. In [14], the authors suggested a system for monitoring which is based on IoT technology, this system uses a triple-level context for offering the awareness services designed contextualization, throughout employing an opensource software and hardware. That test was carried out by employing two scenarios as a smart household based on an IoT-based Monitoring System (IMS). The disaster management service notifies the user to be knowing when certain situations took place, such as leaking damage of the gas, firing outbreak, and break-ins. The second scenario is the health care service, like the deep sleep management and comfortable management for the house. Rita T. Tse's (2016) designed a system consisting of WSN and Server to make analyses about the data gathered out of the network, the (SAKF) Self-adaptive Kalman Filter was employed in such system [15]. This WSN system can detect factors of multiple environments, gather data from multiple nodes, in addition to the gathered data to be envisioned in real-time. Each node is having the capability of sensing multiple factors, together with UV Ultraviolet radiation, atmospheric pressure, PM2.5 particulate matter, humidity, temperature, and geographical location. By using networks of WiFi (Wireless Fidelity), the node data can be transferred to the server to store in the database. Each sensor node in this work is ready for personal use. In addition, some authors offered an action of wireless sensor networking intended for solar photovoltaic (PV) planting, which is known as an IoT objective solution for a Monitoring System [16][17][18]. The system shows the performance of distant energy and its fields on smartphones or a device of the computer. A system that was developed and maintained with eight solar panels to monitor degrees of temperature and moisture, in addition to string Current and string voltage had been used to test such a http://www.i-jim.org concept. The system performance can be enhanced by a Wi-Fi communication technique with condensed places and facilities the performance of the monitoring system after every 30 seconds. CC3200 microcontroller was used by the proposed system with ARM Cortex-M4 as a core. Other authors proposed a design of an interface, which can be configured, supported by a smart sensor intended for the industrial WSN in IoT systems [19][20][21]. The process of collecting the data of the sensors intelligently can be carried out by the system, because the IEEE1451 protocol is inserted, and the system was executed with CPLD (complex programmable logic device) in addition to the applications of wireless communication. This is mostly utilized in the IoT environments containing a system for acquiring high-speed data and it was intended for real-time cases. The system could verify and fulfill the enhanced effective results in practical applications. This can be done by the water environmental application in the IoT environment [22][23][24].

Wireless Sensor Network
The WSN definition is a set of sensors that are dispersed over spatial and wireless linkage by an (RF) Radio Frequency connection. Those sensors collect gathered sensory info, like temperature, lighting, pressure, etc. transmitted then over wirelessly linking to the base station that performs certain processes of the sensors data and collects the desired info related to the environment. Throughout the latest development of (MEMS) micro-electromechanical system devices, sensors tended to be pervasive in several fields for sensing and tracking. The inhospitable terrain deployment of the sensors is a very important advantage, such as by releasing them randomly from an airplane. Instead, if the haphazard deployment has been used, then the sensors must be able of defining themselves into a wireless network to gather and transmit the data to a base station for collecting info. The need for low power consumption is one of the node's primary constraints. Temporal functionality is a must for sensor nodes to be capable of switching to a power-saving mode when not necessary. Almost all those requirements attempt to create a very interesting area for researching and developing from sensor network technology [25,26]. A typical WSN, which is shown in Figure 1, consists of the base station and sensing nodes that detect the physical environment and sends their data to the base station. The base station is more powerful than sensing nodes and acts as a connection to the outer world. If the base station is outside the range of the sensing nodes radio, the node that wants to transmit data to it, it will transmit its data via other internal nodes. The internal nodes are the same as others, but besides local sensing, they also provide forwarding service for others.

4
Proposed system Design The proposed system block diagram is shown in Figure 2, depicting the main system parts which are the sensing node, the Router, and the server. The Tree topology of WSN has been used in this design. The overall operation of the monitoring system can be depicted in the following few points: • The sensing node collects the information from the physical environment and sends them to the Server • The server will collect the received data and process them to be readily visualized in the web-portal • The web-portal gives a report about the collected and processed data by visualizing them The sensor node needs five main parts as explained in the figure below, which are the microcontroller unit for processing, power source, transmitter unit for sending the data, memory unit for storing, and sensing unit for detecting the interesting environment as shown in figure 3. The sensor nodes have to detect interested physical environments and send them to the Server. The microcontroller that has been used in sensor node design is the ESP32.This microcontroller supporting many serial communication protocols. The communication that has been used in the proposed system is the UART TX\RX protocol, by which the transceiver module that is used in this system will be able to communicate with the microcontroller. The transmitter that has been used in the proposed design is a WI-FI connection that was embedded in the ESP32 Microcontroller. The sensor node has been designed to detect the input AC voltage and consumption of the AC. For this purpose, the module PZEM-004t has been used.

PZEM-004t
PZEM-004t is an electrical AC power meter, able to measure the (current, voltage, active power, and energy), it is able to store the measured energy before the power off, and it is containing a TTL (transistor-transistor Total Consumption of logic) Serial communication function that gives the module the ability to communicate with different microcontrollers. This sensor able to detect AC voltage range from 80-260 V AC, the operating frequency is 45-65 Hz, and the acceptable range for the current measurement is 0-100 A AC, Figure 4 shows the connection diagram of the PZEM-004t sensor. The module wiring can be divided into two main parts: the test of voltage and test of the current input terminal wiring in addition to the wiring of serial communication, just as shown in Figure 4 according to the actual needs of the clients, with different TTL pinboard to achieve communicate with different terminals.

ESP32
ESP32 is recognized as a single 2.4 GHz Wi-Fi-and-Bluetooth with a designed combo chip with the TSMC (Taiwan Semiconductor Manufacturing Corporation) ultra-low-power 40 nm technology. Using this technology leads to carry out the best power activity and performance of RF, presenting robustness, versatility, and reliability in an eclectic applications variety and scenarios of power. ESP32 was made especially for the applications of mobile phones, wearable electronics, and Internet-of-Things (IoT). It characterizes almost the whole state-of-the-art and low-power chip properties, including fine-grained clock gating, modes of multiple power means, and scaling of dynamic power. For example, ESP32 is woken up periodically and only when a specified condition is detected, when power IoT related to sensor hub application scenario becomes low. The cycle of Low-duty is utilized for minimizing the energy amount that the chip expends. The power amplifier output can also be adjustable. Therefore, it is backing an ideal trade-off amongst the ranges of communication, data rate, and power consumption, Figure 5. Shows the ESP32 microcontroller.

Fig. 5. The ESP32 microcontroller
ESP32 is an extremely-integrated solution for Wi-Fi-and-Bluetooth IoT applications, with nearly 20 external constituents. ESP32 incorporates the switch of antenna, power amplifier, low-noise receive amplifier, filters, and power management modules. Figure 6 shows the block diagram of the ESP32. http://www.i-jim.org

Logic Level Converter
As digital devices get developed extremely by being the smaller size and faster performance, once pervasive 5 V logic paved the way to ever lower-voltage standards like 3.3 V, 2.5 V, and even 1.8 V, which could lead to components ecosystem zing that requires some assistance talking to each other. For instance, a 5 V part might be unsuccessful to read a 3.3 V signal as high, and a 3.3 V part might be damaged by a 5 V signal. Those problems can be solved by level shifters by offering bidirectional voltage translation reaching up to four independent signals, and they might be converting between logic levels as low as 1.5 V on the lower-voltage side and as high as 18 V on the higher-voltage side. Integrating into projects can be easily achieved by the compact size and breadboard-compatible pin spacing. [4]. 10 kΩ pull-up resistors to their respective supplies can achieve the logic high levels on the sides of the shifters; these could provide fast and adequate rise times to permit decent conversion of fast mode (400 kHz) I²C signals or other similarly fast digital interfaces (e.g. SPI or asynchronous TTL serial). Speeding up the rise time can be achieved by adding external pull-ups supplementary at the cost of a greater current draw. For more info, see the schematic diagram below.

Sensor Node Connection
An IoT-based Energy Management System (EMS) that uses the industrial Modbus communication protocol was improved by developing within this project. Figure 8 indicates the flow process of the way the IoT-based EMS system was advanced by developing it and implemented in addition to how this figure did so. The connection of the sensor node is shown below in figure 9, the PZEM-004t was connected to the ESP32 by using a logic level converter, the Logic level converter was used to converting the digital bits between the High level to the low level of voltage because the High voltage in PZEM is 5V while the High voltage in the ESP32 is 3.3 V.
The PZEM-004 will communicate with the ESP32 via the UART TX\RX protocol that was explained in the figure below. The ESP32 will get the information of the Voltage, Current, power, frequency, and Cost from the PZEM-004t then will process the information to be in JSON data format, after that the data will be transmitted to the Server via a WI-FI connection. Such a Server shall gather the data from the sensor node by a connection of WI-FI. After collecting the data, the Server will process and visualize the collected data by using the web portal that was designed on the server.

Conclusion
This paper offers Wasit University building the solution of developed energy monitoring which can monitor the electricity of campus-wide and is cost-effectively by embracing the Internet of things technology. Out of the results achieved from the suggested design and implementing the network of wireless sensors for IoT application based on non-IP network, the key concluding notes can be as follows: • For monitoring systems, the design, which was proposed, has conducted a special IoT application to do so. • The web-portal for monitoring is flexible for any change according to the customer's need. • By using the proposed system, the user able to view the history log of the consumed power.