The main aim of the proposed paper is a study of the DC/DC buck-boost converter for interfacing with Renewable Energy systems, while overcoming the problem of voltage/current ripples. This goal can be achieved by the reduction or the elimination of low order harmonics from the output voltage spectrum. To fulfill this requirement; the heuristic evolutionary algorithm of particle swarm optimization (PSO) is used, where the Selective Harmonics Elimination (SHE) method is applied based on the minimization of an objective function. This objective function is presenting the switching angles used for the DC-DC converter which lead to the elimination of output voltage ripple and keeping its average equal to the desired value. Simulation applications are used to study the capabilities of the optimization method and the objective function is used to achieve the main goal of the present work, which is minimization of voltage/current ripples.