Under partial shading conditions (PSC), most traditional maximum power point tracking (MPPT) techniques may not adopt GP (global peak). These strategies also often take a considerable amount of time to reach a full power point (MPP). Such obstacles can be eliminated by the use of metaheuristic strategies. This paper shows, in partial shading conditions, the MPPT technique for the photovoltaic system using the Bat Algorithm (BA). Simulations have been performed in the MATLAB ®/Simulink setting to verify the efficacy of the proposed method. In MPPT applications, the results of the simulations emphasize the precision of the proposed technique. The algorithm is also simple and efficient, on a low-cost microcontroller, it could be implemented. Hardwar in loop (HIL) validation is performed, with a Typhoon HIL 402 setup.