The inevitability of energy storage has been placed on a fast track, ensued by the rapid increase in global energy demand and integration of renewable energy with the main grid. Undesirable fluctuations in the output of renewable sources is the main downside that call for manageable energy storage units. This study presents the viability of battery storage and management systems, of relevance to microgrids with renewable energy sources. In addition, this paper elucidates the development of a control algorithm for the management of battery power flow, for a microgrid connected to a mains electricity grid, is presented here. A shunt active filter algorithm for improving the power quality of grid is also implemented with power flow management controller. The overall management system is demonstrated for on grid and off grid modes of microgrid with varying system conditions. A laboratory scale grid–microgrid system is developed and the controllers are implemented.