# Design of a Partially Grid-Connected Photovoltaic Microgrid Using IoT Technology
## 4 Design of the IoT Communication Network  
IoT technologies offer three classes of communication standards: PAN (Personnel Area Network), LAN (Local Area Network), and WAN (Wide Area Network). For instance, compared with Wi-Fi technology, the ZigBee communication protocol is very effective in creating a home area network (HAN). The communication link between smart meters and the centralized controller can be assured by wireless or wireline WAN/LAN communication protocol. The classifications and comparisons among these protocols have been discussed in [61]. The LoRa communication protocol is a very attractive solution for building private, secure, and low-power communication infrastructure for microgrids [62; 63]. LoRa uses spread spectrum technology which employs a low-complicity receiver, making it a suitable choice for machine-to-machine (M2M) communication, IoT, wireless sensor networks, and many other applications. Nodes in a LoRaWAN network are not linked to a single gateway. Therefore, data sent by a node are usually received via a number of gateways. Through some downlink, each gateway will transfer the received data from the end-node to the cloud-based network server. That server could be Wi-Fi, Ethernet, cellular, or satellite-based network. The server handles the complexity and intelligence required to  
Figure 12: Detailed architecture of microgrid operating in partially grid-connected mode. The solid lines denote to power flow and dashed lines denote to communication flow. administrate the network, filtering redundant incoming data packets, doing security checks, scheduling acknowledgments through an optimized gateway, and performing adaptive data rate, among other things. The nodes in a LoRaWAN network are asynchronous, which means that they communicate to each other only when they have data to be broadcasted, whether the data transfer is scheduled or event-driven. This technique can greatly save the energy required to operate LoRaWAN devices (i.e., increase battery lifetime). The incorporation of security into any low-power wide-area network (LPWAN) is critical. LoRaWAN has two security layers: one for the application and another for the network. The security application layer guarantees that the network operator does not have access to the end-user application data, while network security assures that each node in the network is legitimate. The key exchange is encrypted using an advanced encryption standard (AES) and an IEEE EUI64 identifier. Because of regional spectrum allocations and regulatory restrictions, the LoRaWAN specifications differ somewhat from region to region. End-node devices are used for different purposes and have varying requests. LoRaWAN uses multiple device classes to optimize a range of end-node device applications. The device classes compromise network downlink communication latency versus battery life. In many applications, communication latency is a crucial element in any actuator-type or control-type application. The latency requirements for implementing the DR program have been studied in research and industrial trends [62; 63; 64]. However, in the context of smart grids, there have been limited efforts devoted to using them in isolated-mode microgrids. The features of LoRa are summarized in Table 5.  
LoRa supports three classes of devices A, B, and C, as listed in Table 6. Each uplink end-device data transmission is followed by two short downlink reception windows, allowing for bi-directional communications. The end-transmission interval is determined by its own communication requirements, with a slight variance depending on a randomized time basis. In LoRa, class A device consumes low energy, most of the time in sleeping mode, transmits data to the gateway. These devices are used mainly to design battery-operated IoT sensor nodes. Bidirectional communication between a LoRa class A device and a gateway is supported. At any moment, uplink communications (from the device to the gateway) can be initiated.