This paper describes essential functions of prosumer's electric equipment (sources, resources) that can be interconnected to form microgrids for smart grid applications that are integrated with utility networks. Focus is on the protection and control functions of low voltage part of a substation. Functions of an experimental microgrid application were simulated with MATLAB. The aim of the modelling and simulation is to define and optimize parameters and functions that are important for automated energy exchange through a substation between energy storage, generators, loads, and utility networks. Sample control topologies and program modules of a substation controller are developed.