This article presents a novel particle swarm optimization (PSO)-based energy management system (EMS) designed for microgrids (MGs) to enhance operational efficiency, reduce dependency on the utility grid, and minimize electric vehicle (EV) charging costs. . Microgrids can offer the best of both worlds, adding an integrated layer of clean on-site generation, battery storage, and controls to serve the twin purposes of reducing everyday electricity costs while also ensuring critical operations stay online in the event of a grid outage. However, there is. . The Sustainability Research Institute (SRI), has recently completed a comprehensive report entitled Toward net zero buildings: The investment case for smart EV integration. The proposed EMS integrates distributed. . • Microgrids offer economic advantages and enhance reliability. • Microgrids necessitateadditional investments.