Today in Brazil, due to the government incentives, the Net-metering scheme can be seen as a Photovoltaic system that uses the power grid as a virtual battery. This analogy is possible due to the energy credits accumulated in the metering when the prosumer injects power to the network. When the government incentives run out, it can trigger an opportunity market to stimulate the consumers to have their own batteries. Associated with this, the Lithium-ion battery storage systems market has been promising due to a significant drop in battery prices in the last few years.This work proposes a stochastic mixed integer linear programming (MILP) model to design a photovoltaic system integrated with battery energy storage, using generation and consumption scenarios under a Time-of-Use tariff model applied in Brazil. The decision variables are the number of panels, inverters, batteries, its daily operation and the power demand contracted. The objective function aims to minimize the annual cost of investment in photovoltaic system and battery as well as in electricity bill in the context of the Brazilian rules.The proposed model was adapted for a scheme with free export to the network and other with zero export in order to assess the importance of a storage system to keep the economic attraction of the photovoltaic system. Results indicated that the synergic effect of the photovoltaic system and battery, potentialize the arbitrage, which is related to the difference between peak and off-peak energy tariff, mainly with Zero Export scheme because the consumer is free to choose the capacity of the photovoltaic system, which is limited for Net-metering scheme.