## 5 Conclusions and Future Work  
This paper introduces a new BTS HW/SW architecture based on an MG paradigm, which allows an efficient energy management strategy to be implemented through a local EMS. The key function of the EMS is to derive profit from self-consumption of photovoltaic energy generated on the BTS site. With this aim, the EMS implements a load-shedding approach, which depends on the available energy and is applied to non-critical loads. Furthermore, a controllable BESS is used, in which the charging and discharging cycles are optimized to increase its lifespan. Thus, the power supply of conventional BTSs has been entirely transformed into a more sustainable solution by adding new HW/SW elements, which have been described in detail, namely: (i) a monitoring system for determining the value of several electrical and environmental parameters; (ii) electronics to control the energy flow; (iii) a local EMS system; (iv) an IEC 61850 compliant model for the BTS; and (v) a wireless weather station. The proposed HW/SW architecture has been experimentally validated on a pilot BTS plant subjected to different test and weather conditions. Finally, for a two-tariff pricing scheme which is usually offered by energy providers in the Spanish electricity market, annual savings of 16.8 \(\mathrm{\upmu}\)/kW per installed battery power can be obtained.  
A benefit of this system is that it can be applied to both new and existing installations, providing a two-way connection to the electricity grid, photovoltaic generation, smart measurement systems and the required management software, all integrated in a flexible and low-cost HW/SW architecture. More importantly, by adopting an MG-based model, the transformed BTS can also be regarded as an aggregated controllable VPP node. This greatly facilitates the integration of several BTSs into the grid, thereby improving performance by developing a hierarchical network structure based on a hierarchical control scheme in which both the MG and VPP approaches are adopted. Therefore, within the framework of the MG-based BTS architecture proposed in this work, the feasibility of injecting energy into the AC network can be demonstrated by implementing more complex EMS algorithms within larger microgrids for optimal battery management, relying on meteorological information to forecast PV power generation. These are the new challenges which the authors are currently addressing.  
[PERSON] designed and coordinated the overall project; [PERSON], [PERSON], [PERSON], [PERSON], [PERSON] and [PERSON] designed and developed the system. [PERSON] designed the EMS; [PERSON] developed software of the MG-based BTS; [PERSON], [PERSON] and [PERSON] designed and developed the electronics; [PERSON] defined the 61850 models. Experimental tests were carried out by [PERSON], [PERSON] and [PERSON]. Finally, [PERSON], [PERSON], [PERSON] and [PERSON] wrote the manuscript. All authors have read and agreed to the published version of the manuscript.  
This research was funded by the Ministry of Science, Innovation and University of the Government of Spain under the HELIOS Sharing project (RTC-2017-6231-3) and Autonomous Community of Madrid under the project P2018/EMT-4366.  
Not applicable.  
The authors thank the company CLYSEMA SA for its collaboration in this research.  
The authors declare no conflict of interest.