1. Introduction
The internet of things (IoT) has become a pivotal driver for substantial advancements across diverse sectors, including education, industry, and energy. By enabling seamless data transfer and exchange through networks, IoT plays a crucial role in fostering innovation. Specifically, the implementation of IoT technology facilitates the collection of data from interconnected devices, paving the way for interpretation and process optimization. A notable example is the application of IoT in monitoring energy generation, particularly in the context of cost mitigation and sustainability through renewable sources like photovoltaic (PV) energy. Despite significant strides in IoT, its full potential faces a bottleneck due to limited remote accessibility for users. This study emphasizes the urgent need for user-friendly tools to enable hassle-free remote connectivity, focusing on overcoming this limitation.
In the academic literature, various IoT applications for remote access to meteorological parameters, such as temperature, humidity, dew point, light intensity, atmospheric pressure, precipitation, and smoke percentage, have been documented [
1]. A specific instance is the prototype system detailed in [
2], utilizing an Arduino controller for remote monitoring of room temperature and humidity. Despite promising outcomes, this study acknowledges technological limitations associated with the Arduino controller. Another approach is outlined in [
3], presenting a low-cost monitoring system for off-grid PV systems. This system integrates a fault diagnostic algorithm into a cost-effective microcontroller, demonstrating effectiveness in accurately detecting various faults. However, this approach overlooks real-time monitoring of PV variations based on current weather conditions, a crucial aspect for future energy system planning. Several authors have developed smart meters, as evidenced in [
4], describing low-cost measurement equipment in PV installations in homes. Additionally, Ref. [
5] proposes a methodology to analyze the influence of data granularity on high-resolution household consumption profiles.
ThingSpeak, closely tied to IoT, emerges as a key player by providing a straightforward means to collect, store, and analyze data generated by IoT devices. Operating as a web service, ThingSpeak serves as a host for various sensors, facilitating cloud-based data monitoring through integration with MATLAB 2021a [
3]. This integration enables the plotting of daily and annual load profiles using advanced data analysis techniques while monitoring variables in real time [
6]. In parallel, monitoring PV systems assumes critical significance in enhancing energy production rates and demand management. However, monitoring the conditions of a PV system necessitates an extensive repository of measured data and software tools [
7]. In the specific domain of monitoring PV systems, some authors have proposed methodologies based on Python [
8] and intelligent monitoring techniques [
9]. However, these studies lack easily accessible online monitoring capabilities across various devices. An IoT-enabled smart solar water heater system using the ThingSpeak platform is presented in [
10], showing considerable potential to enhance water heater efficiency through real-time system observations. However, the authors do not incorporate a more advanced and robust monitoring system, thus limiting the scope of their results.
In a similar vein, Ref. [
11] proposes an IoT-based technique to monitor key values of a PV panel using an espressif systems 32 (Esp32) microcontroller. Although the system has undergone successful tests, it focuses solely on the behavior of isolated PV systems. Currently, PV systems operate within microgrids covering multiple energy flows, posing a significant challenge to the proper monitoring of the PV system, an aspect overlooked in [
11]. Monitoring PV systems through IoT and ThingSpeak involves connecting system components to the ThingSpeak platform via IoT devices. ThingSpeak facilitates data analysis and processing through its integration with MATLAB, allowing the application of advanced models and techniques to extract meaningful insights from the collected data. This includes fault detection, trend analysis, and performance optimization. By leveraging the power of IoT and ThingSpeak, efficient real-time monitoring of PV systems becomes possible, increasing visibility into energy generation. This enables timely anomaly detection and facilitates informed decision-making processes to optimize PV performance and energy management.
In the realm of energy storage systems (ESSs) optimization in microgrids, the study [
5] stands out for its innovative approach based on genetic algorithms. It addresses energy management in hybrid microgrids, proposing strategies that maximize battery efficiency and lifespan. Detailed evaluation through simulations reveals significant improvements compared to conventional strategies, solidifying the pioneering contribution of this study to ESS optimization. In [
12], attention is focused on microgrid planning in isolated environments, proposing a multi-objective approach based on optimization algorithms. This study highlights the benefits of maximizing microgrid autonomy and minimizing operational costs, providing a comprehensive perspective for sustainable and efficient microgrid planning in isolated contexts. Study [
13] contributes to understanding the stability of the electrical system in microgrids by applying battery-based energy storage technologies. The research includes detailed simulations under various operating conditions, emphasizing the effectiveness of storage systems in mitigating issues associated with renewable source variability. In [
14], the importance of efficient planning and management in microgrids to ensure power supply reliability is addressed. The approach, based on risk analysis and reliability assessment proposed in this study, emphasizes the need for holistic approaches to electrical supply continuity in microgrids. Within the framework of smart microgrids, study [
15] stands out by exploring energy management and analysis through the incorporation of the IoT. The use of a hybrid PV/wind and piezoelectric energy generation system, evaluated with ThingSpeak and MATLAB tools, presents an innovative perspective to enhance the efficiency of smart microgrids. In a similar approach, study [
16] implements an optimized energy management scheme for a hybrid microgrid, using a low-cost IoT communication platform. The applicability and scalable security of this intelligent hybrid microgrid solution are highlighted, contributing to the development of efficient technologies. In the field of IoT system security, Refs. [
17,
18] explore formal verification and validation techniques, addressing critical challenges and proposing future directions to enhance the security of connected systems.
Despite the exhaustive literature review addressing current advances, it is evident that only a limited number of studies have explored the integration of IoT and ThingSpeak in the monitoring of PV systems. Most of the existing research predominantly focuses on isolated PV systems, overlooking the inherent complexities of multiple energy flows within microgrids. Although some studies, such as that conducted by [
3], have conducted various tests to validate their models, and others, like study [
11], have conducted comprehensive tests to validate their data, none of them address monitoring in the context of a PV system connected to a microgrid or incorporate robust machine learning techniques to assess performance. In this regard, the ThingSpeak platform stands out as a straightforward resource for the collection, storage, and analysis of IoT device data. However, its application in monitoring PV systems connected to microgrids has been limited so far. Additionally, despite research on IoT system security, with notable studies like [
17,
18], there is an evident need for deeper exploration in the specific context of the fusion of IoT and ThingSpeak in monitoring PV systems. As a result, there is a significant gap in the literature that requires attention.
In this context, this study addresses a significant gap in the literature by proposing a comprehensive model to enhance the visibility of PV energy generation data through the ThingSpeak platform. It goes beyond conventional approaches by introducing a performance evaluation framework based on machine learning-driven linear regression models. This approach could not only reduce operational costs but also enable precise management of PV energy in various regions, leveraging available meteorological parameters. The concept of a remote microgrid for energy distribution is presented, facilitating the optimization of energy resources and global collaboration through internet connectivity. The rest of the paper is organized as follows:
Section 2 explains the proposed methodology,
Section 3 shows the system description,
Section 4 presents the case study,
Section 5 shows the main results and research discussion, and
Section 6 concludes the paper.
2. Methodology
The methodology of the proposed model is structured into three stages, as illustrated in
Figure 1. The initial stage involves microgrid data acquisition, followed by information processing in the second stage, and concludes with an energy management monitoring and control algorithm in the third stage. In the first stage, the data acquisition system is developed on the ThingSpeak platform, focusing on three primary channels: weather station (WS) monitoring, photovoltaic (PV) monitoring, and demand profiles, each operating at a frequency of 1 s. The variables obtained from the meteorological station include solar irradiation (W/m
2), ambient temperature (°C), relative humidity (RH%), wind speed (m/s), and wind direction (°). Additionally, for channel 2, a Pzem004t device is employed to measure electrical power, providing data on power demand profiles (kW).
Moving to the second stage, information processing involves the communication between channels 1 and 2 on the ThingSpeak platform, facilitated through Equations (1) to (4). Finally, the third stage presents the outcomes on channel 3 of ThingSpeak, where real-time values of the variables are visualized. This configuration ensures continuous monitoring of the PV system in the microgrid and its corresponding demand. Following this logic, if the PV generation exceeds the demand, it enables battery charging; otherwise, it can supply energy through discharge.
4. Case Study
This section delineates an experimental case study aimed at validating the proposed model. The study was conducted at the Microgrids Laboratory of the University of Cuenca (CCTI-B), utilizing a state-of-the-art testbed comprising a 15 kWp polycrystalline solar panel system. The system consists of 60 polycrystalline panels arranged in a 15 × 4 configuration (parallel-series) and is seamlessly integrated with an independent two-level GPTech inverter featuring advanced maximum power point tracking capabilities, as detailed in
Table 1 [
20]. It should be emphasized that the inverter operates at a distinct voltage level (440 VAC) compared to the primary electrical grid (220 VAC). All interconnected components are seamlessly synchronized with the public distribution grid, ensuring reliable and efficient power flow. Moreover, to facilitate comprehensive monitoring and analysis, a dedicated weather station located within the laboratory premises effectively captures crucial environmental parameters such as solar radiation, temperature, humidity, wind speed, and wind direction. The microgrid configuration and key equipment installations are visually depicted in
Figure 4, providing a holistic view of the system under investigation.
The model designed for comprehensive monitoring of the PV system was meticulously implemented using advanced script code in MATLAB. The model’s execution begins with the activation of a timer, ensuring periodic execution of essential processes. Subsequently, a robust Modbus communication framework is established, enabling seamless retrieval of the designated power value from the communication port. Simultaneously, leveraging a sophisticated serial communication protocol, the model efficiently acquires crucial data, including solar radiation and temperature, from the dedicated weather station. This process involves effective interfacing with the SCADA system. The acquired data are meticulously fed into a meticulously crafted linear equation model, specifically tailored for precise estimation of the PV power. Finally, to facilitate streamlined data management and dissemination, the model seamlessly transmits the processed data to the designated ThingSpeak channel, ensuring a seamless and reliable data flow. The intricate implementation and workflow of the model exemplify the technical prowess and meticulous attention to detail that underpins its superior performance and reliability.
Pseudocode: PV System online monitoring |
1: Start 2: TimerVal = tic 3: Modbus communication 4: while t = 1:N iterations 5: m = modbus(Transport, ‘Port’,Name,Value) 6: Ppv = read(m, ‘holdingregs’,address1,count) 7: Weather station data Reading 8: data = textread(‘data.csv’,’’,‘delimiter’,’,’,‘emptyvalue’,NaN) 9: sr(t) = str2num(data{position 1}) 10: tp(t) = str2num(data{position 2}) 11: Linear Regression Model Equation 12: Ppvm = 0.0118 tp(t) + 0.0999 sr(t) 1.1393 13: IoT communication 14: thingSpeakWrite(channelID,data,‘WriteKey’,writeKey) 15: break 16: end |
The model for the channel for the energy management model is described below, as indicated in
Section 3.4.
Model: Energy management model |
1: Data Input:, 2: while t = 1:N iterations 3: Start 4: TimerVal = tic 5: Start Modbus communication 6: m = modbus(Transport,‘Port’,Name,Value) 7: Read data from a Modbus server 8: read(m,target,address,count,serverId,precision) 9: Write data to a ThingSpeak Channel 1 10: thingSpeakWrite(channelID,data,‘WriteKey’,writeKey) 11: Read data stored in ThingSpeak Channel 2 12: thingSpeakRead(channelID,‘Fields’,[1,4], ReadKey = ‘channel Read API key’) 13: Execution of MATLAB script Control model 14: 15: If 16: 17: else 18: 19: end 20: Perform a write operation to the connected 21: Modbus server SC value 22: write(m,target,address,values,serverId,‘precision’) 23: end |
The SCADA screen provides a comprehensive synoptic overview of the microgrid, empowering users to monitor and command the operational states and total powers of each piece of equipment within the installation. Additionally, users can oversee and control the opening and closing of the main switches. The communication panel within the SCADA interface offers a synoptic of communication states, allowing the monitoring of connection and disconnection states for all equipment connected to the Modbus TCP/IP network. The model, represented as pseudocode in the MATLAB script, has been seamlessly integrated into the laboratory’s SCADA system for rigorous testing and evaluation.
Figure 5 visually showcases a screenshot of the SCADA system’s main menu, highlighting the successful implementation of the model [
20]. This integration underscores the robustness and versatility of the model, facilitating effective communication and interaction between the PV system and the SCADA infrastructure. The pseudocode implementation, coupled with its seamless integration into the SCADA system, exemplifies the meticulous attention to detail and technical proficiency employed in this advanced and sophisticated framework.
5. Results and Discussion
This section reveals the findings from the conducted experiment. Initially, data from the meteorological station were collected and stored, illustrating in
Figure 6 the peak solar power reaching 1200 W/m
2 and temperatures fluctuating between 12 and 20 °C. Notably, the study location, situated near the equator, lacks distinct seasons, resulting in relatively stable PV power and temperature patterns. For monitoring the PV system, three channels were established on the ThingSpeak platform, showcasing solar power (W/m
2), temperature (°C), modeled PV power (kW) derived from Equation (1), and actual PV power (kW) generated in the laboratory, as depicted in
Figure 6.
To rigorously validate the model, a comparison was made across three randomly chosen days of stable PV generation. The results, depicted in
Figure 7a for the generated power using the linear regression model and
Figure 7b for the power output derived from the model, highlight the effectiveness of the supervision model. These findings strongly suggest that the behavior of a PV system can be precisely characterized and controlled through the application of a model, facilitating efficient internet-based monitoring and control. Notably,
Figure 7c establishes a significant correlation between the model derived from Equation (1) and the observed real-world behavior. These highly promising results signify a considerable advancement, setting the stage for more rigorous and resilient methodologies crucial for enabling real-time analysis of microgrid management and demand through network-based systems.
Figure 8 illustrates the real-time monitoring of variables through two separate channels on ThingSpeak. On one side, it aggregates the outcomes from the meteorological station, as shown in
Figure 8a–f. This encompasses parameters such as solar radiation, temperature, humidity, wind speed, and wind direction. Additionally, it captures the monitoring of power demand and the energy consumption of loads, depicted in
Figure 8g and
Figure 8h, respectively.
The introduced monitoring system carries substantial potential for influencing the landscape of renewable energy integration and the management of remote microgrids. By harnessing the capabilities of IoT and ThingSpeak, the system provides heightened visibility into the PV system’s performance. Real-time analysis of crucial parameters, including solar radiation, temperature, and power generation, offers valuable insights into the dynamic behavior of renewable energy sources. This enhanced understanding facilitates optimized decision-making processes, empowering stakeholders to make informed choices regarding energy generation, consumption, and storage. The proactive maintenance capabilities of the system ensure the reliability and longevity of PV system components by swiftly detecting anomalies or deviations in performance. Moreover, the system’s integration with ThingSpeak enables remote accessibility, overcoming geographical constraints in microgrid management. Stakeholders can monitor and control the PV system from virtually any location with internet access, a particularly valuable feature for remote microgrids facing physical oversight challenges. The inclusion of energy consumption data from the Pzem004t energy monitor enhances the system’s capacity to manage demand effectively, allowing for optimal resource allocation and a balanced, reliable power supply. In the broader context, the implemented monitoring system aligns with global efforts to transition toward renewable energy sources, contributing to a more sustainable and resilient energy ecosystem.
In consideration of the importance of ensuring the reliability and correctness of IoT services, formal verification and validation techniques play a crucial role in enhancing the overall quality of our proposed monitoring system. By employing formal methods, we can systematically analyze and validate the functionality of the IoT services integrated into our system. Formal verification provides a rigorous means to mathematically verify that the system behaves according to its specifications, reducing the likelihood of errors and enhancing its robustness. Moreover, this approach facilitates the identification and mitigation of potential security vulnerabilities, contributing to the system’s resilience against cyber threats. Incorporating formal verification and validation techniques aligns with the best practices in IoT system development, reinforcing the trustworthiness and dependability of our monitoring system.
Finally, the proposed model, built upon the IoT platform, facilitates the integration of ten channels, each supporting a maximum of eight fields. This configuration enables support for up to 80 IoT devices. To enhance the effectiveness of monitoring and managing microgrids, the inclusion of a greater number of variables, such as frequency, voltage, harmonics, among others, could be considered. These additional parameters have the potential to enhance the operability of the microgrid. Consequently, these aspects will be subject to analysis in future studies.
6. Conclusions
This paper introduces a comprehensive monitoring system for a PV system utilizing IoT technologies and the capabilities of ThingSpeak. The system underwent development and testing in a laboratory microgrid setting, where the PV system is integrated with various generation and storage systems, along with the electrical grid. Through the integration of IoT technologies and ThingSpeak, the system achieved real-time monitoring and data acquisition from the PV system and its interconnected components.
The monitoring system seamlessly integrates the PV system with other energy generation and storage systems, facilitating efficient management and control of the entire microgrid. Leveraging ThingSpeak, data from the PV system, including solar radiation, temperature, and power generation, can be collected, analyzed, and visualized in a user-friendly manner.
This case study serves as a practical application of IoT and cloud-based platforms, demonstrating their effectiveness in monitoring and managing PV systems within a microgrid context. The integration of multiple energy sources and the electrical grid introduces a complex operational environment, and the developed monitoring system provides valuable insights into the performance and behavior of the PV system within this context.
Through the utilization of IoT and ThingSpeak, the monitoring system enhances visibility, offers real-time data analysis, and enables remote accessibility. This facilitates efficient decision making, optimization of energy resources, and proactive maintenance of the PV system. Such monitoring systems hold the potential to contribute significantly to the advancement of renewable energy integration and the effective management of remote microgrids.
Further research and development in this field are crucial to explore additional functionalities, enhance system reliability, and validate the scalability of the monitoring system for real-world applications.