1. Introduction
The increase in energy demand worldwide has caused an accelerated consumption of fossil fuels and increased emissions of polluting gases from conventional generators. This trend, along with growing climate awareness and the need to mitigate emissions, has led researchers to develop renewable energy technologies to meet rising demand while reducing environmental impacts [
1,
2].
Buildings account for 40% of energy use and emissions in the U.S., highlighting the importance of intelligent management systems to improve efficiency [
2]. Smart grids and microgrids have emerged as solutions, integrating renewable generation, storage, and intelligent controllers to optimize local resources [
3].
Microgrids, in particular, provide flexibility, efficiency, and resiliency by combining islanding capability with grid connectivity [
4,
5,
6]. Islanding allows portions of the grid to disconnect and self-supply during disturbances, while grid connectivity enables beneficial import/export of power. Numerous studies have focused on optimizing microgrid operations to balance economic and reliability objectives [
7,
8,
9].
However, research specific to university campuses has been more limited [
10]. University microgrids face unique constraints in terms of load profiles, renewable generation, multi-stakeholder governance, and educational missions [
11]. This represents a critical gap given the research and demonstration potential on campuses.
With the energy-generating renewable energy resources, traditional power has presented several problems in maintaining stability and reliability; this has led to the development of smart grids, as advanced systems, which allow energy management, are presented as medium and long-term solutions essential to the global energy crisis, and climate degradation [
4,
5].
Smart grids are the first step to developing a more efficient and effective microgrid; in addition to presenting advantages, such as distributed energy resource integration, these grids present advantages of flexibility, deferred investment, and less pollution [
2,
5,
12]. The most significant advantage of the microgrid is its ability to work in island mode (disconnected from the grid) or to work in grid-connected mode. This unique feature of microgrids is one of great importance for distributed generation systems using renewable energy sources, local energy storage, and generator sets, as it can deliver or sell surplus energy to the grid or consume energy missing from the grid and thus be able to supply the energy demand of consumers connected to the microgrid or help lower the demand curve of the main grid [
13,
14,
15].
Microgrids integrate distributed generation (GD), storage, and intelligent control systems to improve resiliency, efficiency, and sustainability [
4,
5,
6]. Their unique islanding and connectivity capacities are key advantages [
14,
15]. Islanding allows microgrid portions to disconnect from the main grid and operate autonomously during disturbances [
16,
17]. This prevents blackouts and enables uninterrupted critical service [
18]. Grid connectivity allows beneficial electricity trading operations. Optimal microgrid dispatch has been extensively studied, especially balancing economic and environmental objectives [
19,
20].
University campuses represent a crucial emerging microgrid research area [
21]. Campus microgrids face distinct constraints around load variability, generation assets, multi-stakeholder governance, and educational missions. Effective optimization could enable sustainability goals and provide living laboratories to train students [
22,
23].
In Ecuador’s unstable national grid, energy supply shortfalls exasperate electricity problems for universities. At Salesian Polytechnic University (UPS), the campus microgrid cannot fully meet classroom and lab demand due to inadequate installed capacity. This motivates developing intelligent control solutions to optimize existing distributed campus resources.
This work performs energy optimization specifically for the electrical engineering lab on the UPS campus (
Figure 1). We utilize consumption indicators and linear programming to evaluate and enhance operational efficiency. The campus context offers a unique real-world optimization case study. Results could provide best practices for university campuses in Ecuador and beyond.
2. Smart Buildings
An intelligent building can be defined as a house, commercial premises, office, shopping center, lab, etc. In buildings, daily activities and processes occur that must be performed and monitored or controlled manually; these activities represent disadvantages both in the economic and energy fields. These processes consume more resources than they need, and it is for this reason that they currently tend to automate buildings and turn them into intelligent buildings to manage their resources and thus make them more efficient and profitable [
24].
Daily in buildings, various energy sources are used to comfort the inhabitants. Technological development seeks to transform conventional buildings into smart ones using emerging technologies. The main objective of smart building development is to reduce energy costs and environmental impact over the life cycle of the building. The development of smart buildings aims to transform conventional cities into smart cities, which are economically and ecologically viable through the use of smart energy technologies and systems. The pillar to achieving a smart building is the implementation of renewable energies, smart meters, intelligent lighting systems, etc. These technologies aim to develop smart grids and implement the Internet of Things [
16,
17,
25].
To transform a conventional building into an intelligent building, a platform must be implemented; with interoperability of all systems in an integrated manner, the Smart Building Energy Management System (SBEMS) is responsible for controlling the functions of the building system efficiently, quickly, and safely. The SBEMS is accountable for monitoring and controlling the electrical energy within a building; this system can control and manage all aspects of the building, such as lighting, ventilation, security, heating and air conditioning, alarm systems, maintenance, and energy management. SBEMS capabilities include optimizing building and plant operations, automatic utility control, controlling multi-building functions, and monitoring the building status and environmental conditions [
16,
18].
2.1. Microgrid
The DOE (U.S. Department of Energy) defines the microgrid as interconnected generators with site-connected electrical loads that have two connection modes: (1) grid-connected and (2) isolated mode; it can also be a low-voltage distribution network that has interconnected distributed energy resources (DER), feeding controllable loads and critical loads [
18,
26,
27].
The microgrid covers a small geographical area independent of the distribution grid and operates either connected to the grid or isolated from the grid (island mode). When a disturbance occurs in the distribution networks, the microgrid can disconnect from the grid and continue to deliver power to the load through the internal DER. The microgrid comprises several distributed generation (DG) technologies coexisting with each other [
14]. A microgrid can manage and coordinate distributed generation systems (DGS) decentralized, reducing the need for centralized control of the entire system. The need for centralized coordination and management is explained in several studies [
1,
28]. The structure of a microgrid is dynamic as its topology changes very often due to the entry of new DG, fault conditions, load entry and exit, or reconfiguration of the structure for reasons such as maintenance. An essential feature of a microgrid is its ability to disconnect from the local power distribution grid and operate in island mode. This represents a critical opportunity in distributed power generation (DPG) systems that use heterogeneous energy sources (photovoltaic panels, Battery Energy Storage Systems “BESS”, diesel generators, and residential power grids). However, these DPG units produce transients caused by system disturbances, such as a load change, the connection or disconnection of a DPG unit, a change in grid topology, and fluctuating energy resources [
15].
2.2. Photovoltaic Systems
Implementing a photovoltaic (PV) system in a microgrid is an area of outstanding research since PV has proven to have extraordinary reliability within the system and present better power quality than the local grid. It is essential to clarify that the PV microgrid must maintain a constant voltage and frequency, a balanced power flow between active and reactive power, and avoid transient surges in the system [
19,
20].
In [
21], researchers indicate the importance of correctly dimensioning energy sources to allocate energy resources. Equation (
1) shows the generation estimation obtained by a PV.
where:
is the PV current during daytime.
H is the peak sun hours.
is PV performance (85–95%).
The maximum power output of the PV system allows us to extract energy transfer more efficiently [
4]. The output power calculation is given by Equation (
2).
where:
is the power output of the PV.
A is the area of the photovoltaic cells.
is the efficiency of the solar array.
I is the solar irradiance.
is the atmospheric temperature.
2.3. Battery Energy Storage System
The decreased costs associated with the Battery Energy Storage System (BESS) have made implementing these systems economically viable. The BESS has a fast response time to start-up, which helps to maintain power, voltage, and frequency stability in the microgrid and helps to alleviate the demand curve [
21,
22,
29].
In [
30], the equation for modeling a battery bank is shown to indicate the state of charge and discharge at any instant of time of the batteries; the calculation of the SOC is shown in Equation (
3).
where:
is the BESS discharge state at t.
is the system charging energy.
is the charging efficiency of the battery bank.
is the discharge efficiency of the battery bank.
is a variation in the time
2.4. Grid Connected Microgrid
Energy management strategies must be implemented since the microgrid is connected to the grid. The microgrid must be capable of exchanging energy, i.e., selling surplus generation or consuming energy from the grid in case of an energy deficit. Equation (
4) shows the objective function’s calculation to minimize the connected microgrid’s operating cost. The objective function takes into account the cost of the generating units. Also, it takes into account the cost of the distributed generator units, the benefit of selling electricity to the main grid, the cost of heat-only boiler units, the purchase price of electricity from the main grid, the start-up cost of controllable distributed power generation units like Combined Heat and Power Systems (CHP), and the start-up cost for heat-only boiler units (HOB), respectively. The total grid cost is calculated by summing these terms over the number of microgrids in the grid as given in Equation (
4). The total daily cost of the microgrid is calculated by summing CMG (t) over all intervals [
23].
where:
is the cost per generation unit.
is the power of the distributed generator.
is the cost per unit of production of the controllable power of the distributed generator.
MG is the amount of energy produced per generation unit and power sold by the microgrid to the grid.
2.5. Management System
Performing the optimization system is key in the relationship of energy management of the microgrid to optimally control the power flow in the microgrid to meet the objective function by setting decision variables. For this study, the objective of the optimal power flow is to maximize the utilization of renewable energy resources and minimize the operational cost of MG. The objective function for each interval concerning time can be defined by the Equation (
5) [
24]:
where
and represent the power delivered to the microgrid by photovoltaic and BESS generation, respectively
and are the operating and maintenance costs of the power output of the PV and BESS systems, respectively.
is the cost of purchasing power from the main grid at time interval t.
T is the total time for the optimization problem, which ranges from 1 to 24 h.
Constraints must be considered to solve the optimization system and objective function. The power balance constraint of the system can be described by Equation (
6).
where:
is the power consumption of the microgrid.
The PV and BESS power must be limited to maintain stability in the system; these variables are limited to set maximum and PV and BESS values, in addition to maintaining a maximum and minimum state of charge (SOC) level of BESS.
where:
E is the BESS capacity.
The restrictions corresponding to the energy indicators expressed in Equations (
11) and (
12) must also be considered, which will indicate how consumption per user and per area will be reduced, depending on the energy management of the electricity lab.
where:
are the number of users, such as teachers and students working in the microgrid,
is the energy demand required at the meter border with the utility
is the space the microgrid occupies compared to the energy demand required at the utility boundary meter.
2.6. Energy Indicators
The study of energy indicators mainly focuses on distributed energy systems as they present a more significant energy problem. In most cases, single energy systems are used to evaluate existing energy systems [
31].
Energy indicators are chosen as the energy consumption per unit (ECPU). Factors affecting the magnitude of ECPU are multiple and include process equipment, method of operation, energy category, power supply material, system management, energy saving activity, production capacity utilization, etc. [
20,
32].
The heuristic used is a resource allocation model, which takes into account the total energy capacity of the microgrid, incorporating battery storage and generation capacity. It aims to maximize efficiency in terms of metrics such as energy yield per user or per unit area. However, it must balance these efficiency goals with the need to avoid system overload and eminent system shutdown, so meeting critical loads is important. The heuristic poses an optimization problem that allocates resources by determining how much energy to draw from each source at any given time. The key control variables are the energy dispatch rate of the generators and the discharge rates of the batteries as a function of efficiency indicators, subject to the following constraints: the energy capacity available in the microgrid, the efficiency indicators (user/load, area/load), the deep discharge of the batteries and the amount of load to supply and control. By dynamically controlling these variables, the model can achieve efficient and reliable operation despite the variability of both generation and demand. Critical constraints, such as battery thresholds and load targets, are observed within the optimization scheme. Thus, the heuristic controller is designed to maximize the sustainable operation of the microgrid.
3. Problem Formulation and Methodology
Data collection and load control are performed through an integrated system utilizing advanced metering, automation, and optimization algorithms; electrical parameters like voltage and current are measured every minute by PAC 4200 m with TC 100A/5A current sensors. These data are delivered via Modbus TCP/IP to a central management system.
The management system controls electrical loads in the system using a Fibaro smart home platform and Z-Wave protocol. It uses optimization heuristics to allocate resources and decide when to connect/disconnect loads based on the amount of energy available from distributed generation sources. The algorithms analyze efficiency indicators to make optimal control decisions. The metering system was calibrated using a Fluke 435 analyzer to verify data accuracy. The methodology utilizes purpose-built metering hardware, industry-standard home automation, and custom optimization algorithms tailored to the application to balance generation and loads for maximum efficiency Algorithm 1. Data verification tools ensure the accuracy of the key parameter inputs to the automated control algorithms.
Algorithm 1 Assignment algorithm |
- Step: 1
Input VAR: Output VAR: - Step: 2
Initialize: - Step: 3
- Step: 4
- Step: 5
Return:
|
3.1. Microgrid Description
The microgrid was implemented at the Salesian Polytechnic University in the electrical engineering block as a real laboratory for the study of the behavior of the RMs, which comprises the infinite bar formed by the Utility, critical loads, and manageable loads (Smart Home), renewable distributed generation, energy storage devices, a management and control system supported by a communication infrastructure to monitor and control the generation and distributed loads.
The proposed MR for the article has three photovoltaic systems; one of the largest capacity is installed on the rooftop and has an installed power of 10 [kW], and the other is installed in the courtyard of the electricity laboratory, which has an installed capacity of 2 [kW], additional 500 W with sun simulation, two wind turbines with a capacity of 1 kW, a 1000 W hydrogen cell.
The MR UPS also has 2 BESS to supply power in case of blackout or in case the demand of the electrical laboratory cannot be supplied by the PV system if it is operating in island mode; one of these systems has an installed capacity of 2 [kW], and the other system has an installed capacity of 7.2 [kw]. One of the important loads is the two electric vehicle charging points, as shown in the figure; the demand curve is shown in
Figure 2 and
Figure 3.
3.2. Description of Microgrid Operation
The microgrid system can operate in four different ways: (1) using the PV system to charge the BESS, (2) using the PV system to deliver power to the grid, (3) using the BESS to deliver power to the grid or microgrid, and (4) using the grid to charge the BESS. In the first part, when there is enough radiation, the PV system can charge the batteries of the BESS. In the second part, when there is overproduction of energy, and the BESS is fully charged, the energy produced by the PV system can be delivered to the national grid [
33]. In the third part, when solar power is scarce and the PV system cannot generate enough power, the BESS can deliver power to the grid or microgrid. In the fourth part, when the peak demand is high, to avoid power shortage in the microgrid, the grid can charge the BESS [
20,
32].
3.3. Problem of Study
The energy management of the microgrid in the electricity lab of the Salesian Polytechnic University will be carried out to reduce the electricity consumption in the electricity lab without sacrificing the comfort of the students and teachers of the electricity course. To achieve this goal, domotic systems will be implemented, which will allow for management of the energy consumption in the classrooms and laboratories of the electricity lab, making decisions to turn on or turn off lights, or optimize energy consumption depending on the actions of students and teachers.
Also, energy optimization of the electricity lab will be carried out, considering the generation of the two photovoltaic systems and the BESS installed in the electricity lab. In addition, energy indicators will be deemed to measure energy consumption and savings based on the areas of study and the number of people in the electricity lab.
4. Results Analysis
This article presents and analyzes the results of energy optimization of the microgrid of the electricity lab of the UPS to perform the energy management of the electricity lab. First, data collection was performed for a week, and thus, the actual power consumption at each instant of time was recorded to understand the behavior of energy consumption, to apply the energy indicators, and to be able to optimize the system to reduce energy consumption.
Figure 2 shows the initial demand curve of the case study, with a peak of 4.5 kW and a minimum power of 1 kW, with an increase in demand from 07:00 with a peak of demand from 14:00 to 16:00. The red color indicates the curve of the photovoltaic system, this curve shows the average data for a year, where it supplies a maximum power of 7 kW between 09:00 and 16:00 h.
In
Figure 3, The initial daily energy demand is shown by the blue curve, with an average baseline demand of 58 kWh/day. This represents the demand before applying any energy efficiency or demand management measures. Demand after Applying Management Model: After applying the demand management model utilizing distributed energy resources and efficiency measures, the demand is reduced significantly to an average of 20 kWh/day. This new demand profile is shown by the red curve. The demand management model and distributed resources help reduce the initial demand by 50% from 58 kWh/day to 20 kWh/day. This significant 50% reduction is a major outcome highlighting the benefits and potential of the proposed management model for supporting grid flexibility.
Figure 4 is based on the distributed resources of the microgrid starting from the energy consumed 24 h without the management system; we have 64.2 kWh consumed from the grid and applying the management model, we can observe the participation of the batteries from 19:00 to 06:00 with the participation of 10.6 kWh, accompanied by the energy coming from the electric company with an energy contribution of 9.9 kWh, from 07:00 the photovoltaic system begins to generate until 17:00 contributing 5.2 kWh and in turn 18 kWh for battery charging, where the management model performs the allocation of resources giving priority to the charging of the battery system, in addition to the optimization of energy consumption from 64.2 kWh to 25.7 kWh by controlling loads of the smart home.
In
Figure 5, The initial electricity demand profile of the microgrid system is shown for a three-phase feeder (L1, L2, L3) serving block H over a 7-day measurement period before applying the optimization model. The microgrid has a baseline peak demand of 4.5 kW on each phase, occurring between 7 AM and 4 PM. This maximum demand is indicative of the consumption from residential loads in the mornings and afternoons. During late night, a minimum base demand of 1 kW is observed on each phase, likely serving essential loads. The three-phase demand profiles exhibit similar consumption trends, with peak demand in the afternoons driven by increased usage from households. By optimizing the microgrid operations through demand response and distributed energy resources, the peak loads can potentially be reduced while still serving the daily energy needs. The optimization results can be compared to this initial 7-day demand profile to quantify the impacts of the model. The multi-phase demand data at 10-min intervals provide insights into the microgrid flexibility and where peak shaving measures can be targeted. Further analysis may reveal additional observations comparing the three phases or comparing weekday and weekend usage profiles before optimization.
Figure 6 shows that the implementation of the power consumption optimization in the two parts of the electricity lab shows a considerable improvement concerning the consumption presented in
Figure 2. We can see that the consumption decreased by an average of 3000 [W] of energy savings, which translates into more significant economic savings. It is worth mentioning that the implementation of the domotic system and the optimization of the electrical consumption was carried out first in the second part of the electricity lab. Since it presents a lower load, it was first decided to observe the behavior of the demand under the new conditions of the system and to determine if it is viable to be implemented in the first part of the electricity lab. Shows a considerable decrease in energy consumption when implementing the home automation system and the optimization of electricity consumption in the first part of the electricity lab, which indicates that these systems work correctly and that the electricity lab, as a whole, will show enormous energy savings by not wasting energy and consuming only what is necessary.
The results were favorable, indicating that implementing these systems in the first part of the electricity lab will substantially improve electricity consumption.
Figure 7 and
Figure 8 show the daily consumption, where the decrease in electricity consumption can be seen more clearly. This is due to the energy indicators and the implementation of measures and domotic systems, which made it possible to manage better the energy consumed in the electricity lab, since at times when the students are absent and the lights in the classrooms and laboratories are turned off when they do not feel a presence.
Figure 9 shows that once the demand curve is optimized, the quality indicators are analyzed according to the area and energy consumed, where the initial curve shows a low efficiency, with the highest efficiency points at night. At the same time, after applying the management model, there is a substantial improvement of two points during working hours, i.e., from 07:00 to 15:00.
Figure 10 expresses the quality indicator as a function of the number of users (students) that enter the microgrid, with an initial value of 0.05%. Once the management model is implemented, an increase of 2.5% of its initial value is obtained, making it more efficient in energy use.
Analyzing the behavior of the energy indicators, we can see that, depending on the number of users, the maximum efficiency is 2.5%, the minimum is 0.5%, and the average is 1.8%. In contrast, for the area, the indicator has a maximum of 2.2%, a minimum of 0.6%, and an average of one, as shown in
Figure 11.
5. Conclusions
The optimized microgrid resource allocation algorithms developed in this work demonstrate a strong ability to integrate high levels of solar PV, energy storage, and responsive load management. The systemic approach enables simultaneous improvements in the key objectives of efficiency, reliability, sustainability, and emissions reduction.
Specifically, the joint optimization model incorporates uncertainties in renewable generation to achieve a 10% optimization of overall consumption through controlled installed loads. Further analysis verifies energy savings of 65% versus conventional systems, with the proposed heuristic extracting 55% savings from optimized solar PV integration and storage dispatch. This significant penetration of renewables, accounting for 65% of total supply, is complemented by a reduction in grid purchases, which are reduced to only 15% of demand.
These results highlight the advantages of coordinated optimization and control enabled by microgrid architecture. Thanks to adaptive resource management with a localized and decentralized approach, grid efficiency increases by 1 to 3 percentage points while allowing very high integration of solar PV. As a result, environmental sustainability increases dramatically, with a 45% reduction in carbon emissions compared to grid-supplied power.
This applied microgrid research at the Universidad Politecnica Salesiana is an effective and validated framework for scalable deployment of microgrids, aiming to increase efficiency through optimized utilization of renewable energy, storage, and controllable loads. The solutions developed create an easily extensible foundation for managing the increasing variability of diverse distributed generators. These proven capabilities for unlocking flexibility assets will prove essential as grids evolve to rely more heavily on renewables in the coming decades.