# Smart Internet of Things Power Meter for Industrial and Domestic Applications
### Research Perspective  
From the research perspective, we tackle the following objectives and research questions:  
* Discussing the importance of smart power meters capable of measuring higher-order harmonics, both on voltage and current;
* How would a flexible modular IoT-integrated smart meter architecture look like?
* Due to the high price and unavailability of calibration equipment, how can we empirically calibrate and compare a hardware device using other certified industrial equipment?  
It is important to mention that the current paper offers the perspective of a proposed IoT-enabled smart meter architecture in the context of the continuously evolving smart grid domain. Our focus is oriented toward developing and building a cost-effective, small-size, flexible, and IoT-enabled smart meter. The focus of this paper is less oriented towards complex mathematical modeling, advanced algorithms, and compliance with various IEC industrial standards (that actually need specialized equipment).  
The integration of power quality measurement solutions (industrial devices that measure not only active, reactive, and apparent power but also harmonic distortions in the grid) often requires the use of industrial protocols that predate the Industrial IoT era. These protocols, in addition to necessitating protocol adaptations (specialized gateways), introduce security vulnerabilities due to the unencrypted (clear text) transmission of data.  
Moreover, although intelligent solutions for reporting consumed electrical energy (smart meters) exist and are compatible with IoT environments (e.g., capable of using MQTT for data transmission), they do not provide information regarding power quality (such as distortions, sudden voltage variations, and other parameters). Even when combining the two solutions--a power quality meter and a smart power consumption meter--space inefficiencies and, especially, cost considerations arise, and this combination still does not allow for a more complex analysis of current and voltage waveforms (e.g., for recognizing consumer patterns based on consumption signatures [13; 14; 15]).  
In this paper, we propose, analyze, implement, and test an architecture for a smart power quality meter integrated into the IoT domain that has multiple advantages over existing commercial devices. Or solution is characterized by the following features:  
* It is based on an open and well-known platform that can be programmed in C using freely available libraries and development environments (e.g., ESP32);
* It allows for both wireless and Bluetooth (integrated in the ESP32 MCU) connectivity;* It supports local storage of measured data, including raw samples, on a microSD card in a text file;
* It enables connection via the RS485 interface within an industrial network;
* It supports the implementation of various communication protocols such as Modbus TCP/RTU and MQTT without being limited to these;
* It allows for local data processing and result aggregation;
* It supports varying the signal sampling rates;
* It enables continuous monitoring of the network, even in the absence of a grid voltage, by being powered by the integrated rechargeable backup battery;
* It supports the implementation of various encryption algorithms, with the microcontroller featuring a dedicated module for AES.