**2. Literature Review**

Several studies have considered photovoltaic systems monitoring. In [9], the authors used the IoT and MQTT (MQTT: Message Queuing Telemetry Transport) in web-based monitoring. They implemented this approach to monitor the performance of the solar panels and the battery system, as well as the energy consumption of a living laboratory. Similar work is reported in [10]. When compared to other protocols, MQTT has a small footprint, making it much more suitable for resource-constrained environments. Despite several benefits, it is important to note that MQTT brokers do not provide the same level of entity authentication or encryption capabilities [11]. Moreover, IoT devices are often not interoperable, and it is difficult to integrate external sources of information and cloud

computing to use energy more efficiently. Indeed, it requires the design and implementation of hierarchical architectures and standardized solutions to facilitate interoperability. Till today, no standard solution is established yet [12]. However, most providers share IoT middlewares, which has fostered the emergence of cross-domain applications.

In [13], the authors developed a Smart Home monitoring system using Power Line Communication (PLC) which has the advantage of not needing additional communication cables [14]. This article also demonstrates the potential of using PLCs to monitor individual photovoltaic panels.

Moreover, the review work [1] provides an overview on the importance of monitoring systems for photovoltaic plants (electrical and meteorological data). The article reviews different types of monitoring systems that are currently available for PV plants, including hardware and software aspects. The authors discuss the advantages and disadvantages of each type of system and provide examples of commonly used components.

There exist several commercial software for monitoring and simulation of PV systems such as LabVIEW ([15–18]) and MATLAB Simulink ([19,20]).

Furthermore, studies in [20–24], present an energy management system by using Programmable Logic Controller. Compared to other hardware control systems, PLCs have specific advantages as ruggedness, noise immunity, modularity, low cost, and small footprints [25].

We also reviewed several papers dealing with Digital Twins. This concept is particularly popular in the context of industry 4.0, where it is mainly implemented for manufacturing systems [26]. Nowadays, there is a significant trend to apply this concept to the electrical energy field [27]. That said, there are few concrete applications. Moreover, as there are several misconceptions about digital twin definition [28], it is important to distinguish the digital twin, the digital model, and the digital shadow. In fact, the digital model is defined as a digital copy of a physical system without any data exchange and is generally used for simulation and design purposes. Likewise, the Digital Shadow is a combination of a physical system and its digital model with a one-way data exchange.

Although some authors claim to use the concept of the Digital Twin as just defined above, most of the articles deal with the "digital model" or "digital shadow". For instance, authors in [27] study the digital twin possibilities for fault diagnosis purpose of PV system. However, they use a digital shadow instead of digital twin. We find the same confusion in the articles [29–33].

Relatively to our contribution, Table 1 summarizes the state of art of the current literature dealing with digital twin applications.

In this work, we propose a Digital Twin of a complete photovoltaic system using MATLAB software as a unified environment. This framework is suitable to address the following topics:


In other words, this experimental platform can be used to compare simulation results and monitored data in real time. Indeed, it could be used to develop new approaches for fault detection and prediction issues. This integrated environment allows on the one hand to have a large panel of toolboxes (modelling, code generation, machine learning, advanced control, cloud computing ... ). Therefore, it could be easily used for advanced control and optimization purposes.


**Table 1.** Literature review related to IoT and DT usage for energy management.

## **3. Materials and Methods**

The concept of the digital twin, object of this work, is implemented on a test rig. In this section we describe the structure of the demonstrator, its instrumentation and control system.

#### *3.1. PV System Description*

The stand-alone system is composed of the following elements (Figure 2):


**Figure 2.** PV system demonstrator.

#### *3.2. Sensors and Data Aquisition*

Developing a digital twin for renewable energy systems requires constant data collection and monitoring [40]. Therefore, it is necessary to implement techniques that provide a wide range of data:


The experimental platform is equipped with sensors of various technologies that do not use the same communication protocol. To transmit measurement data to a unified software environment, we have developed a hardware and software architecture based on the following components:


Figure 3 depicts the demonstrator overview and its control system architecture.

**Figure 3.** Control system architecture of the PV plant.
