IoT-Based Low-Cost Photovoltaic Monitoring for a Greenhouse Farm in an Arid Region

: In this paper, a low-cost monitoring system for an off-grid photovoltaic (PV) system, installed at an isolated location (Sahara region, south of Algeria), is designed. The PV system is used to supply a small-scale greenhouse farm. A simple and accurate fault diagnosis algorithm was developed and integrated into a low-cost microcontroller for real time validation. The monitoring system, including the fault diagnosis procedure, was evaluated under speciﬁc climate conditions. The Internet of Things (IoT) technique is used to remotely monitor the data, such as PV currents, PV voltages, solar irradiance, and cell temperature. A friendly web page was also developed to visualize the data and check the state of the PV system remotely. The users could be notiﬁed about the state of the PV system via phone SMS. Results showed that the system performs better under this climate conditions and that it can supply the considered greenhouse farm. It was also shown that the integrated algorithm is able to detect and identify some examined defects with a good accuracy. The total cost of the designed IoT-based monitoring system is around 73 euros and its average energy consumed per day is around 13.5 Wh.


Introduction
Nowadays, as reported by the international energy agency (IEA), some isolated and rural areas are experiencing a large shortage in the supply of electric power [1].Around 770 million people are still living without access to electricity, particularly in Africa and Asia [1].Sub-Saharan Africa's share of the global population without access to electricity has risen from 74% before the COVID-19 pandemic to 77% after [1].Due to the increase in energy demand, the challenge has shifted from saving classical fuel-based energy sources to creating and efficiently managing renewable energy sources mainly composed of solar and wind.
Starting a few years ago, investment in solar photovoltaic (PV) energy has become a common trend in developed and developing countries.This new orientation is mainly empowered by a relative decrease in solar module cost.Thus, a large number of PV plants were installed around the world.According to IEA [2], about 940 GW of PV were installed at the end of 2021.The African Energy Outlook 2022 report estimates that between 2021 and 2030, more than 40% of total capacity additions will come from solar PV [3].
There are various applications of PV systems around the globe where PV sources may provide appropriate solutions for remote sites without access to electricity.As this source of power is free and does not require hard maintenance, most sectors are attracted by the application of PV systems (e.g., telecommunication, water pumping, rural electrification, building, health, transportation, street lights, electric vehicles, agriculture, etc.).For the above-cited reasons, the current research work is devoted to investigate the performance of Energies 2023, 16,3860 2 of 21 a PV system used to supply a small-scale greenhouse farm in a remote site located in the south of Algeria.
Monitoring PV installations in order to detect probable defects is a real challenge that should be faced by PV systems designers and end-users.The main objective of a monitoring PV system is to maintain a high level of reliability, effectiveness of operation and availability of the system to provide electricity in the best conditions.The defects that may occur in a PV installation may significantly decrease the power yield and may exhibit a high risk of fire [4,5].As per the reference [6], the annual energy loss due to defects in PV systems is estimated to be around 18.9%.
From research and engineering design perspectives, various kinds of PV monitoring systems have been designed, deployed and studied.Among the recent automatic monitoring systems developed worldwide, the system developed in [7] was based on the European Solar Test Installation sensor.Despite the advanced technologies and novelties of the developed system, the high sampling period (8 min) is a big drawback.In addition, the storage capacity, limited to 16,300 measurements (observations), may represent a challenging limitation.Another recent work dedicated to a universal data acquisition system (DAQ) for PV performance monitoring is designed based on a microcontroller (68B09).The collected data can be easily accessed through a server, which can help users to perform the diagnosis and analysis of the PV system under various operating conditions [8].In [9], the authors developed another data logging system using a 12-bit precision Analog to Digital Converter (ADC).Despite the improvements embedded to the designed monitoring system, the number of acquired variables remains small, which may limit the deployment of the device.However, this system has the advantage of not requiring the physical connection of the monitored system to the data collection server [10].In [11], the authors designed an improved Data Acquisition (DAQ) system for which the number of variables to be acquired has reached 20 analog inputs, which seems to be acceptable, particularly for small-scale applications.
Recently, with advancements in the field of embedded microcontrollers and telecommunication technologies such as wireless sensor networks (WSNs), many researchers were attracted by the application of the internet of things (IoT) to remotely monitor their PV systems.For instance, the authors in [12] designed a monitoring system (IoT-DAS) for grid-connected PV systems.Among the features of such a system, we can cite its ability to identify non-ideal (faulty or degenerated) operating conditions.The obtained results are reported to show compliance with the International Electrotechnical Commission (IEC) standard.Moreover, the developed system is found to be efficient in monitoring all necessary parameters with low power consumption and high accuracy.Additionally, a smart solar still prototype for water desalination was designed using a remote monitoring system, based on the IoT technique [13].The monitoring system is developed and integrated into the hybrid solar still in order to control its evolution online, as well the quality of the freshwater.
A monitoring system for smart greenhouses using IoT and deep convolutional neural networks has been designed [14].The controlled parameters such as air temperature, relative humidity, capacitive soil moisture, light intensity, and CO 2 concentration were measured and uploaded to a designed webpage using appropriate sensors with a low-cost Wi-Fi module (NodeMCU V3).The same Wi-Fi module, NodeMCU V3 ESP8266, was used in [15] to monitor PV parameters such as current, voltage, and other data (air temperature and relative humidity).In [16], the authors also used the same Wi-Fi-module (NodeMCU V3) to monitor data of a 3.6 kWp On-grid PV system.The hardware cost of the designed prototype is affordable.A low-cost monitoring system based on the internet as a prototype was designed to measure solar PV generation of an off-grid system.The system cost was around 33 USD [17] and an html page was used to upload the measured data.
A wireless low-cost solution based on long-range (LoRa) technology was used to develop a PV monitoring system applied to an installation of 5 kW [18].It allows for the correct display of electrical and meteorological data in real tim, while the main limitation is its restricted duty cycle (1%).In [19], a new technique for fault diagnosis of PV systems based on independent component analysis (ICA) is proposed.It can mainly diagnose defects related to electrical failures.The system was evaluated based on simulation and experimental data.A DAQ system based on open-access software and cloud service is proposed in [20].A comparative study against other IoT-based monitoring systems was also presented and the result showed that this system could save energy up to 58%.In [21], a novel strategy for monitoring a PV junction box based on LoRa for a PV residential application is designed.The designed DAQ system is able to collect various parameters and achieve excellent characteristics.The use of low-cost LoRa for designing an IoT-based monitoring system was evaluated for a large-scale PV system in Istanbul [22].The main advantage of such a system is its low-cost.A Supervisory Control and Data Acquisition (SCADA) system was also implemented through a DAQ.Extensive tests have shown this system to have the lowest cost when applied for a PV plant with local data logging [23].The total cost of the designed monitoring system was around 761 USD, which is competitive compared to the available SCADA systems.An intelligent monitoring system for automatically monitoring PV plants was described and developed in [24].To design this monitoring system, the authors used software and cost-efficient hardware.Another option included in this monitoring system is its ability to detect defective PV modules.For more details about various configurations of data-acquisition systems based IoT, a good systematic review can be found in [25].
A large share of future solar energy plants are going to be located in desert environments [26].Dust build-up is the greatest technical challenge facing a viable desert solar industry.Desertic regions (such as Sahara of Algeria) are more influenced by sandstorms, and this has a negative impact of the PV plants installed in such regions.60% energy yield losses during and after sand storms are widely reported [27].Various works were carried out to study the performances of PV plants installed in similar regions [28][29][30][31]; however, few works related to the development of smart PV monitoring systems were found in the literature [32].
In one of our previous works [33], a DAQ system based on an Arduino board (a low-cost microcontroller) and an ESP8266 Wi-Fi module, for PV parameters monitoring, was developed.Although the designed DAQ system is inexpensive and can display the collected data remotely via a website, some of the sensorsused are not sufficiently accurate, such as the LM335 for temperature.In addition, this monitoring system is not able to detect anomalies.To improve the system performance, in [34], we presented a similar work as the one in [35], but in this work, the developed monitoring system is equipped with a simple fault detection procedure.We also used more accurate sensors to measure solar irradiance and cell temperature.The PV monitoring system was tested and evaluated at a location in the north of Algeria (Jijel region) characterized by a Mediterranean climate.The idea consists of integrating a fault detection algorithm inside a low-cost microcontroller in order to detect faults in real-time.The system showed its ability to detect defective PV modules with acceptable accuracy.The same monitoring system was tested and evaluated in another location (Amiens, France, characterized by typical oceanic climate) with a little improvement.In fact, we used the Matlab/Simulink environment with DSpace to examine the accuracy of the designed monitoring system [35].Three defects were studied and the system showed a good ability to detect and identify the origin of the fault [35].
In Table 1 below, a summary of previous systems designed for monitoring PV solar systems covering the period between 2018 and 2023 is provided.The focus of this comparative study was mainly the location, used equipment/devices, cost, and power consumption.Later in this paper, the performance of the system designed in this work will be provided and compared to the systems provided in Table 1.The mostly used communication technology are the Wi-Fi, Zigbee, and GPS.Each of them has a different performance in power consumption, distance covering, and cost.
The objective of the present study is to develop a low-cost IoT-based PV monitoring system equipped with an effective fault diagnosis procedure.The system is evaluated under specific climatic conditions (arid climate, Sahara of Algeria) with sandstorms.Additionally, other improvements are added to the system such as using suitable and low-cost components.The PV system is used to supply a small-scale greenhouse farm installed in this region.The greenhouse is considered as a load of the stand-alone PV system.Thus, the novelty is to evaluate the developed system (PV monitoring with fault detection procedure) under an arid-region with specific climatic conditions.To the best of the authors' knowledge, this kind of monitoring system was not evaluated under such arid areas.
The main contributions of this work are summarized as follows: -Develop a low-cost, portable IoT-based PV monitoring system that can be easily extended to other applications in control and PV systems characterization.-Integrate a PV fault diagnosis procedure in order to detect failures that may occur in the PV module.-Study and verify the feasibility of providing electricity to a mini greenhouse farm at isolated arid area (Sahara of Algeria) under high temperature in summer and sandstorms phenomena.
The rest of this paper is organized as follows: Materials and methods are given in Section 2, including PV system and greenhouse prototype description, as well as the designed IoT-based monitoring system description.Results and discussion are provided in Section 3. Concluding remarks and perspectives are reported in the final section.

Photovoltaic System Description
The considered stand-alone PV system is installed in a desert region of Algeria (Ouargla city), which is characterized by an arid climate.The system consists of two photovoltaic panels connected in parallel, a charge regulator and a battery (See Figure 1).The climate of Ouargla is subtropical desert, with mild winters (during which, it can be cold at night) and very hot sunny summers.The PV system is designed to supply a small-scale greenhouse farm (prototype).The PV module specifications and the corresponding I-V curve are shown in Table 2 and Figure 2, respectively.
Since the objective of the present study is to develop a PV monitoring system to analyze the behavior of the PV module under different operating conditions, including different deficiencies, different kinds of faults were created intentionally.Figure 3      Since the objective of the present study is to develop a PV monitoring system to analyze the behavior of the PV module under different operating conditions, including different deficiencies, different kinds of faults were created intentionally.Figure 3 shows photos taken onsite of the created/investigated faults.
The studied faults are, respectively, shading effect, short-circuited PV module,

Greenhouse System Description
Due to severe climatic conditions in the study location, keeping suitable environmental conditions for plants is a big challenge.Plant watering and providing adequate air conditioning need energy, which is not sufficiently available in such remote regions.

Greenhouse System Description
Due to severe climatic conditions in the study location, keeping suitable environmental conditions for plants is a big challenge.Plant watering and providing adequate air conditioning need energy, which is not sufficiently available in such remote regions.Figure 4 shows a real photo of the designed greenhouse prototype.The greenhouse is equipped with a watering system, light, and fans to keep adequate environmental conditions inside the greenhouse.A simple controller is developed to monitor the operational parameters such as temperature, humidity, water, and lighting inside the greenhouse.For that purpose, three sensors were used; namely, soil moisture, Light Dependent Resistor (LDR), and air temperature.

Greenhouse System Description
Due to severe climatic conditions in the study location, keeping suitable environmental conditions for plants is a big challenge.Plant watering and providing adequate air conditioning need energy, which is not sufficiently available in such remote regions.Figure 4 shows a real photo of the designed greenhouse prototype.The greenhouse is equipped with a watering system, light, and fans to keep adequate environmental conditions inside the greenhouse.A simple controller is developed to monitor the operational parameters such as temperature, humidity, water, and lighting inside the greenhouse.For that purpose, three sensors were used; namely, soil moisture, Light Dependent Resistor (LDR), and air temperature.To measure the temperature and the relative humidity, an AM2302 sensor (See Figure 4) was used.Through this sensor, both the temperature and humidity can be measured simultaneously.Cooling and heating are performed by using a Peltier cooling piece circuit (Plate module 12706) (See Figure 4).Soil moisture is measured via the Soil Moisture Detector Sensor (See Figure 4).Figure 5 shows the developed system during the testing phase.The direction of the cooling or heating circuit is controlled by a 180 • motor.It rotates in two directions, according to the demand, through special electrical circuits (see illustration in Figure 5, below).
Once the temperature is measured and compared to the reference temperature (T ref , stored into the microcontroller), Algorithm 1 is run to set a suitable temperature.Once the instantaneous value of humidity is measured using the previously mentioned sensor, it is possible to control the increase or decrease in the humidity through a similar algorithm used for the control of temperature.When the humidity level is slightly increased, the fan installed at the top of the greenhouse is turned on until it returns to the reference percentage.A door could be also opened for fresh air.To measure the illumination intensity, we used an LDR sensor.When the illumination value decreases, a LED light turns on immediately.A watering pump is turned on based on the measured value of soil moisture.
Currently, for operating actuators, the implemented algorithms compare the measured value with the reference value and make a decision.Table 3 shows the used components, their specifications, and cost.The total estimated cost is also provided in this table.
To measure the temperature and the relative humidity, an AM2302 sensor (See Figure 4) was used.Through this sensor, both the temperature and humidity can be measured simultaneously.Cooling and heating are performed by using a Peltier cooling piece circuit (Plate module 12706) (See Figure 4).Soil moisture is measured via the Soil Moisture Detector Sensor (See Figure 4).Figure 5 shows the developed system during the testing phase.The direction of the cooling or heating circuit is controlled by a 180° motor.It rotates in two directions, according to the demand, through special electrical circuits (see illustration in Figure 5, below).Once the temperature is measured and compared to the reference temperature (Tref, stored into the microcontroller), the following algorithm is run to set a suitable temperature.
Step #1: Measure air temperature (Tm) Step Step#3: Display the results Once the instantaneous value of humidity is measured using the previously mentioned sensor, it is possible to control the increase or decrease in the humidity through a similar algorithm used for the control of temperature.When the humidity level is slightly increased, the fan installed at the top of the greenhouse is turned on until it returns to the reference percentage.A door could be also opened for fresh air.To measure the illumination intensity, we used an LDR sensor.When the illumination value decreases, a LED

IoT-Based PV Monitoring System Description
A block diagram of a general PV monitoring system based on IoT technique is shown in Figure 6 [32].It consists of a PV array, sensors for measuring electrical and climatic parameters (DC current, voltage, air temperature, and solar irradiance), a data-acquisition unit based on a low-cost microcontroller (e.g., Arduino Mega), a combiner box, an inverter with other sensors (AC current and voltage), a Wi-Fi module (network), and display devices (computer or phone) posting the collected data.
The used ESP8266 Wi-Fi module is a self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to a Wi-Fi network.The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor.

IoT-Based PV Monitoring System Description
A block diagram of a general PV monitoring system based on IoT technique is shown in Figure 6 [32].It consists of a PV array, sensors for measuring electrical and climatic parameters (DC current, voltage, air temperature, and solar irradiance), a data-acquisition unit based on a low-cost microcontroller (e.g., Arduino Mega), a combiner box, an inverter with other sensors (AC current and voltage), a Wi-Fi module (network), and display devices (computer or phone) posting the collected data.The used ESP8266 Wi-Fi module is a self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to a Wi-Fi network.The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor.
Wi-Fi (based on IEEE standard 802.11) is a mature networking technology and is appropriate for medium distances (100 m-few kms) with medium power consumption, while Zigbee (based on IEEE standard 802.15.4) has low power consumption and cost, but it is suitable only for small distances (up to 100 m).LoRa network is much appropriate for large distances, up to 15 km, with low power consumption [32].
The electronic components of the developed monitoring system as well as the cost of each item are included in Table A1 (See Appendix A) .
To measure the PV current and voltage, an ACS712 sensor with a maximum current of 30 A, and a voltage sensor with a maximum voltage of 25 V are used.Both sensors are Wi-Fi (based on IEEE standard 802.11) is a mature networking technology and is appropriate for medium distances (100 m-few kms) with medium power consumption, while Zigbee (based on IEEE standard 802.15.4) has low power consumption and cost, but it is suitable only for small distances (up to 100 m).LoRa network is much appropriate for large distances, up to 15 km, with low power consumption [32].
The electronic components of the developed monitoring system as well as the cost of each item are included in Table A1 (See Appendix A).
To measure the PV current and voltage, an ACS712 sensor with a maximum current of 30 A, and a voltage sensor with a maximum voltage of 25 V are used.Both sensors are calibrated using the following expressions: where, I r is the measured real value of current.
where, V r is the measured real value of voltage, R1 and R2 series resistors (tension divider) Solar irradiance was measured by using a reference solar cells and calibrated with a pyranometer (the calibration coefficient is K = 1000), so where, V m is the produced voltage by the reference solar cell The estimated total cost is around 73 EUR.As compared to other monitoring systems such as those, respectively, in [33][34][35], this cost can be considered as low with acceptable performance.

Fault Detection Procedure
The developed fault detection and diagnosis procedure is summarized in Algorithm 2. Thp and Thv were estimated empirically after several experiments.Additionally, the value limits of Isc (0.45 A and 0.55 A) were estimated experimentally (based on several tests).It should be noted that these parameters are related to this PV configuration.K1 and K2 denote the used relays allowing the measurement of two physical parameters (Isc and Voc).These later help the estimation of the nature of the defect, which may occur in the PV module.

Experimental Results
Figure 8a shows the designed PV monitoring system based on the IoT technology.It consists of voltage and current sensors, air temperature sensors, reference solar cell, a DC-DC MPPT converter, a 16 × 4 LCD display for local results, and an electronic circuit based mainly on an Arduino Mega2560 board and ESP8266 Wi-Fi module.Figure 8b depicts the PV modules used to test the monitoring system under normal and abnormal This procedure was written and integrated into an Arduino Mega board for a realtime application.The algorithms built into the circuit were designed through the Matlab program to determine the state of the system, normal or faulty, and then classify the type of the defect.

Experimental Results
Figure 8a shows the designed PV monitoring system based on the IoT technology.It consists of voltage and current sensors, air temperature sensors, reference solar cell, a DC-DC MPPT converter, a 16 × 4 LCD display for local results, and an electronic circuit based mainly on an Arduino Mega2560 board and ESP8266 Wi-Fi module.Figure 8b depicts the PV modules used to test the monitoring system under normal and abnormal conditions.In order to display the results online (measured data), a webpage was designed.For example, Figure 9a shows the collected data, such as the PV current, PV voltage, air temperature, and solar irradiance (morning at 8 o'clock, 3 December 2022).Figure 9b shows the measured data of the greenhouse.In order to display the results online (measured data), a webpage was designed.For example, Figure 9a shows the collected data, such as the PV current, PV voltage, air temperature, and solar irradiance (morning at 8 o'clock, 3 December 2022).Figure 9b shows the measured data of the greenhouse.Table 4 summarizes the power consumed by each used component of the monitoring system.The power consumed by the designed IoT-based monitoring system is estimated to be around 13.5 Wh/day.In order to display the results online (measured data), a webpage was designed.For example, Figure 9a shows the collected data, such as the PV current, PV voltage, air temperature, and solar irradiance (morning at 8 o'clock, 3 December 2022).Figure 9b shows the measured data of the greenhouse.Table 4 summarizes the power consumed by each used component of the monitoring system.The power consumed by the designed IoT-based monitoring system is estimated to be around 13.5 Wh/day.

Discussion
Figure 11 reports the collected curves under normal and abnormal operating conditions.To check the effectiveness of the developed PV data-acquisition system, we compared the measured (See Figure 11a) with the simulated under the Matlab environment (See T 11.b).As can be seen, a good agreement is obtained.
To check the effectiveness of the designed system, faulty scenarios were created.As shown in Figure 11b, the measurement intervals were divided into 9 time periods (Z1, Z2, …Z9) and each experiment lasted approximately 20 min.To test the circuit's ability to detect the fault, each period was compared with the corresponding one extracted from the result obtained by the Matlab program.
For example, in region 2 (Z2), we notice that an error occurred (anomaly in the output power).The error was detected based on the following detection algorithm.The idea consists of comparing the measured power with the estimated power.∆P = Pmax_m − Pmax_e If ∆P > Thp then default = true else default = false endif Where Pmax_m is the measured power, Pmax_e is the estimated power based on an explicit model [39].The threshold Thp  3 was estimated empirically throughout the experiments.
Then the next step aims to find the fault type based on the proposed procedure.In this case, a single PV module is disconnected from the system.More details are listed in Table 5.

Discussion
Figure 11 reports the collected curves under normal and abnormal operating conditions.To check the effectiveness of the developed PV data-acquisition system, we compared the measured (See Figure 11a) the simulated under the Matlab environment (See Figure 11b).As can be seen, a good agreement is obtained.
To check the effectiveness of the designed system, faulty scenarios were created.As shown in Figure 11b, the measurement intervals were divided into 9 time periods (Z1, Z2, . . .Z9) and each experiment lasted approximately 20 min.To test the circuit's ability to detect the fault, each period was compared with the corresponding one extracted from the result obtained by the Matlab program.
For example, in region 2 (Z2), we notice that an error occurred (anomaly in the output power).The error was detected based on the following detection Algorithm 3. The idea consists of comparing the measured power with the estimated power.Where Pmax_m is the measured power, Pmax_e is the estimated power based on an explicit model [39].The threshold Thp ∼ = 3 was estimated empirically throughout the experiments.
Then the next step aims to find the fault type based on the proposed procedure.In this case, a single PV module is disconnected from the system.More details are listed in Table 5.
For example, in zone Z6, after measuring the module temperature and solar radiation values, G = 802 W/m 2 , T = 20 • C, it was expected that the maximum power value should be 182 W.However, the value of the current and voltage in the MPP were 2 A and 14 V, respectively, and the estimated power was 28 W. Thus, the threshold Thp = 182-28 = 154 W. The fault detection algorithm detects an anomaly in the system, and by tracking the value of V oc and I sc , it was estimated that the defect corresponds to a covered solar panel.Figure 12 shows other tests developed under IoT-ThingSpeak application in the same region.As can be seen from 12:55 to 13:00, the system works normally without any fault (stable DC voltage and DC current).In a very short period of 1 min, we observe a remarkable decrease in solar irradiance, DC voltage, and DC current.This is not a fault, rather, the reason is that the clouds moved.However, during the period from 13:03 to 13:06, we can clearly observe a decrease in DC voltage and DC current due to the artificially covered PV module.In the period from 13:07 to 13:08, the system is also faulty, due to an accumulation of dust on the PV module.Then, when we removed the sand from the PV module, the DC voltage and current increased again (time period 13:10).Once the fault is detected and the nature of the defect estimated, an SMS is sent to notify the user about the state of the system using a SIM8001 module (See Figure 13).Once the fault is detected and the nature of the defect estimated, an SMS is sent to notify the user about the state of the system using a SIM8001 module (See Figure 13).Once the fault is detected and the nature of the defect estimated, an SMS is sent to notify the user about the state of the system using a SIM8001 module (See Figure 13).The designed system is equipped with an interactive webpage.This can help users check the state of the PV system remotely.As an example, Figure 14 shows the notifica-tion on the website.Additionally, the designed webpage is able to display the state of the PV system, indicating the type of the defect online.As shown in Figure 14  The designed system is equipped with an interactive webpage.This can help users check the state of the PV system remotely.As an example, Figure 14 shows the notification on the website.Additionally, the designed webpage is able to display the state of the PV system, indicating the type of the defect online.As shown in Figure 14, all investigated faults are reported clearly on the website (Faults: open circuit 1 PV module, open circuit 2PV module, short circuit, and other faults).
Our IoT-based monitoring system is equipped with a fault detection procedure and can notify users about the system.In other presented systems, this option is not available.This is the main difference between our study and those published that are only used to monitor data.

Advantages and Limits of the Designed IoT-Based Monitoring System
Some advantages and limits of the proposed monitoring system are listed in Table 6.

Advantages Limits
Low cost and lower power monitoring system Easy to implement Interactive webpage can help users monitor their system remotely The integrated code can be reprogramed and updated at any time Other types of defects could be easily integrated into the microcontroller Users can be notified by an SMS regarding the state of their PV system The used Wi-Fi module ESP8266 module is an extremely cost-effective board The system was tested and evaluated for a small-scale PV system Security of the collected data Limited distance of the used Wi-Fi module The fault diagnosis procedure is developed for only three types of faults The system is not able to detect multiple faults The benefits of the PV monitoring system-based IoT technique compared to classical monitoring systems are: (1) cost effective, as we use a low-cost Wi-Fi module, (2) higher productivity and efficiency, is easily realized, and increases mobility.The major drawback of the IoT is to ensure the security of application in its large database.In addition, a non-smart IoT system will have limited capability and will be unable to evolve with big data.No security protocol is associated with the system to secure the uploaded data the website.Another limit is the short distance of the used Wi-Fi module.A cost-effective embedded solution including IoT and fault detection techniques seems to be an important technology that should be further improved for large scale photovoltaic applications.
IoT technology will continue to play a major role in increasing the quality of the monitoring and diagnosis of PV plants installed in remote locations.This can help users to check their PV systems online, predict possible faults, visualize the evolution of different parameters, and analyze the data [32].

Conclusions and Perspectives
In this paper, a low-cost PV monitoring system with a fault detection procedure was designed.The system was simulated and verified experimentally in a specific desertic region with a hot climatic condition and sandstorms (south of Algeria).The obtained results show the designed system to be effective, particularly in its data-acquisition component and real-time monitoring, specifically in fault detection and isolation.To collect data remotely, a webpage was developed and activated.The investigated types of defects were, respectively, disconnection of one or more panels, sand accumulated on a PV module, and short circuit in a PV module.The IoT is a good platform for the development of a cost-effective smart monitoring system, assuming the final application successfully complies with the relevant technical standards.The developed system can help O&M make correct decisions about the cleaning or changing of the PV modules.
This system was used to supply a small greenhouse farm (prototype) with consistent environmental conditions.Experimentation investigation showed the capability of this system to feed the used components by the greenhouse prototype, such as sensors, fans, lamps, and a water pump.
IoT technology is strongly recommended for designing smart monitoring systems with fault detection techniques for PV plants installed in desert regions.Furthermore, a smart scheme is highly recommended for the fast isolation and immediate protection of the plants.
The main limits of the developed PV monitoring system are: (1) it is suitable only for very small-scale off-grid PV systems (PV string), (2) the Wi-Fi module used is limited in terms of distance (up to 100 m), (3) only three major faults can be detected, and (4) the uploaded data on the developed webpage are not secured.
To address the above issues, we plan to test the system for a large PV array by using other suitable sensors (current and voltage).Additionally, other type of defects related to the PV modules will be investigated, such as browning, bubbles, snail trails, and others.We will use another long-range data transfer technology, such as LoRa, as LoRaWAn works on a lower radio frequency band than Wi-Fi.

Energies 2023 , 23 Figure 1 .
Figure 1.The PV system under consideration and the considered location (Ouargla city: 31.9527°N, 5.3335° E).The PV module specifications and the corresponding I-V curve are shown in Table2and Figure2, respectively.
shows photos taken onsite of the created/investigated faults.The studied faults are, respectively, shading effect, short-circuited PV module, opencircuited PV module, sand accumulated on PV modules, and covered PV module.As can be seen in this figure, PV modules are subject to sandstorms, which decrease their output Energies 2023, 16, 3860 6 of 21 power significantly, in addition to the high temperature, which may reach 55 • C in the summer at the study location.

Figure 2 .
Figure 2. (a) The I-V curve of the PV module at Standard Test Conditions (STC) (b) the used PV module.

Figure 2 .
Figure 2. (a) The I-V curve of the PV module at Standard Test Conditions (STC) (b) the used PV module.

Figure 3 .
Figure 3. Illustration of the investigated defects: (a) dirty PV module, (b) shading effect, (c) sand accumulated on the surface, (d) open circuit, (e) short-circuit, and (f) covered PV module.

Figure 3 .
Figure 3. Illustration of the investigated defects: (a) dirty PV module, (b) shading effect, (c) sand accumulated on the surface, (d) open circuit, (e) short-circuit, and (f) covered PV module.

Figure 3 .
Figure 3. Illustration of the investigated defects: (a) dirty PV module, (b) shading effect, (c) sand accumulated on the surface, (d) open circuit, (e) short-circuit, and (f) covered PV module.

Figure 4 .
Figure 4. Photo of the designed greenhouse farm (prototype) with sensors.Figure 4. Photo of the designed greenhouse farm (prototype) with sensors.

Figure 4 .
Figure 4. Photo of the designed greenhouse farm (prototype) with sensors.Figure 4. Photo of the designed greenhouse farm (prototype) with sensors.

Algorithm 1 :
Setting a suitable temperature Step #1: Measure air temperature (T m ) Step #2: Compare the measured (T m ) with the reference temperature (T ref ), ∆T = T m -T ref If not (−2 • C < ∆T < 2 • C) then If T > 2 then Open relay #1, open heating system with a delay of 3 min else open relay #2, open cooling system with a delay of 5 min endif endif Step#3: Display the results

Figure 5 .
Figure 5. Illustration of the whole system during testing phase.
#2: Compare the measured (Tm) with the reference temperature (Tref), T = Tm-Tref If not (−2 °C  T  2 °C) then If T  2 then Open relay #1, open heating system with a delay of 3 min else open relay #2, open cooling system with a delay of 5 min endif endif

FanWindowFigure 5 .
Figure 5. Illustration of the whole system during testing phase.

Figure 6 .
Figure 6.Block diagram of a PV monitoring system based on IoT technique.

Figure 6 .
Figure 6.Block diagram of a PV monitoring system based on IoT technique.

Algorithm 2 : 23 Figure 7 .
Figure 7a,b show the operation of the electronic circuits related to the two relays during the measurement of I sc and V oc .Energies 2023, 16, x FOR PEER REVIEW 11 of 23

Figure 7 .
Figure 7. (a) Electronic circuit for measuring Isc (relays position) (b) Electronic circuit for measuring V oc (relays position).

Energies 2023 , 23 Figure 8 .
Figure 8.(a) The developed PV monitoring system based on the IoT technology and (b) the PV modules used to test the monitoring system.

Figure 8 .
Figure 8.(a) The developed PV monitoring system based on the IoT technology and (b) the PV modules used to test the monitoring system.

Figure 8 .
Figure 8.(a) The developed PV monitoring system based on the IoT technology and (b) the PV modules used to test the monitoring system.

Figure 9 .
Figure 9. (a) Collected data of the PV system: Solar irradiance, air temperature, PV voltage and PV current.(b) Collected data of the greenhouse farm: Temperature, Humidity, soil moisture, solar irradiance and water level.

Figure 9 .
Figure 9. (a) Collected data of the PV system: Solar irradiance, air temperature, PV voltage and PV current.(b) Collected data of the greenhouse farm: Temperature, Humidity, soil moisture, solar irradiance and water level.

Figure 10
Figure 10 displays an example of the measured data (DC current and DC voltage) of a PV module for a short period of a configuration of three PV modules connected in parallel by the developed monitoring system.

Energies 2023 , 23 Figure 10 .
Figure 10.Measured Dc current and DC voltage of a PV module.

Figure 10 .
Figure 10.Measured DC current and DC voltage of a PV module.

Algorithm 3 :
The errors detection procedure ∆P = Pmax_m − Pmax_e If ∆P > Thp then default = true else default = false endif

Figure 11 .Figure 11 .
Figure 11.Electrical and changes in the faulty system.(a) The curve extracted from our website.(b) The simulated curve under Matlab.

Figure 12 .
Figure 12.Monitored data (air temperature, solar irradiance, DC voltage, and DC current) based on ThingSpeak application.

Figure 12 .
Figure 12.Monitored data (air temperature, solar irradiance, dc voltage, and dc current) based on ThingSpeak application.

Figure 13 .
Figure 13.Notifications of faults: Sending SMS messages to notify the user by phone about state of the PV system.
, all investi-gated faults are reported clearly on the website (Faults: open circuit 1 PV module, open circuit 2PV module, short circuit, and other faults).

Figure 13 .
Figure 13.Notifications of faults: Sending SMS messages to notify the user by phone about the state of the PV system.

Figure 14 .
Figure 14.Notification of the state on the PV system displayed on the website.

Figure 14 .
Figure 14.Notification of the state on the PV system displayed on the website.

Ref./Year System/Monitored Parameters The Used Devices Platform/Type of Network Cost or Complexity Power Consumed Wh/Day Region
From the above Table1the following points can be highlighted:-Wi-Fi module 8266 is the most used device to upload and visualize data into a platform -The main collected data are DC current, DC voltage, module temperature, and so-

Table 3 .
The used components, specification and cost (Greenhouse farm).

Table 4 .
Power consumption of the used sensors and components.

Table 4 .
Power consumption of the used sensors and components.

Table 5 .
The state of the PV system over the time periods.

Table 6 .
Advantages and limits of the proposed IoT-based monitoring system.