A new microcontroller-based MPPT algorithm for photovoltaic applications