An ingenious control of DC–DC buck-boost converter with uncertain dynamics is proposed in this paper. The proposed converter operates in buck-boost mode based on the uncertain input either from a photovoltaic cell (boost) or piezoelectric generator (buck). A linear disturbance observer is designed to alleviate the disturbances in load resistance and input source. The control is synthesized using sliding mode control. The stability of system is assured. The results are validated for a practical case of multi-energy harvesters. © Springer International Publishing AG 2016.