The relationships between the environment and the energy sector are particularly relevant. The production and consumption of electricity are directly and indirectly responsible for some of the major negative impacts of human activity on the environment. Residential buildings have a strong impact on the electricity sector, and energy resource management models may be explored to minimize costs. This paper proposes the optimization of an energy storage system (ESS) capacity for residential use, in a single-family household, with the integration of photovoltaic (PV) generation and the use of electric vehicles (EVs) aiming to minimize electricity consumption costs. An economic viability study of the obtained solutions is also reported. The obtained results point that the optimal ESS capacity was 5.6 kWh. Furthermore, economic results show that the incentive householders' investment should be for environmental reasons.