# A Low-Cost Secure IoT Mechanism for Monitoring and Controlling Polygeneration Microgrids
## 1 Introduction  
According to the United States Energy Information Administration (EIA), over $370 billion has been spent annually in recent years on electricity generation. Roughly 48% ($177.6 billion) of the total generation was spent in the residential sector [1]. To increase the efficiency in energy consumption, data acquisition equipment such as smart meters, smart plugs, and many other sensors are commonly used. Although Home Energy Management System (HEMS) are anticipated as one of the promising technologies to fulfill the demand for energy saving, thus far it has only had limited implementation because the high initial equipment cost [2] and the lack of optimal managing software because the power consumption pattern of residence is too diverse to find an optimal power management for each home [3]. A HEMS works by placing sensors at different appliances and/or devices that reads their energy consumption. By scheduling major household appliances, residents can reduce their electricity bills [4; 5; 6]. In several cases, the sensors are connected to the Internet reporting the data to the owner. The extension of the Internet connectivity into physical devices is named the Internet of Things (IoT), defined by the Institute of Electrical and Electronics Engineers (IEEE) as a network of items embedded with sensors that are connected to the Internet [7]. Monitoring applications can provide valuable information about your home from the actual status to a detailed history. This technology can provide the services, information, communication, and dataanalysis anytime, as long there is a connection to the Internet, to tackle the energy consumption along with augmentation of the modern home living experience [8; 9; 10]. In addition, the integration of renewable energy sources (RESs) in distributed generation (DG), with proper control systems, have proven a lower electric bills in the residential sector [11]. In addition, the usage of RESs reduces carbon dioxide emissions by 1925 million metric tons in 2015, or roughly 36.5% of the total of all sectors in the United States [12]. However, the integration of RESs presents challenges in power quality, cost, power availability, location of RESs resource, and power forecast, among others [12]. Therefore, the integration of an IoT monitoring systems would improves the network performance to make a more resilient and efficient cyber-physical system. Since this environment is connected to the Internet, it needs to be protected from security threats. As shown in [13], the scheme has to fulfill three requirements:  
1. Confidentiality concerns the protection of data, such that only approved users can access the data. 2. Authentication means checking that the data have not been altered and that the data can be confirmed by the claimed author to have been sent. 3. Access refers to only allowing suitably authorized users to access data, communications network, and computing resources and ensuring that those authorized users are not prevented from such access. This paper presents a cyber-physical system consisting of a low-cost secure IoT mechanism for monitoring and controlling appliances/devices connected in a polygeneration microgrid. The hardware of the system was implemented using low-cost commercial off-the-shelf items, while the software was developed using free and open source resources. The IoT control scheme is comprised of a Wireless Sensor and Actuator Networked Control System (WSANCS) which implements a star topology with one sink node (S-N) and a set of sensor-actuator nodes (SA-N). The sensor-actuator nodes are an embedded entity composed of a micro-controller, a communication device, and a current/voltage sensor. The sink node is an embedded entity comprised of a micro-controller, a communication device, and a micro-computer. The data gathered by the WSANCS are sent to a cloud database. In addition, a mobile application allows the user to monitor and control the system in real-time.