Photovoltaic (PV) arrays have a considerably lower output when exposed to partial shadowing (PS). Whilst adding bypass diodes to the output reduces PS’s impact, this adjustment causes many output power peaks. Because of their tendency to converge to local maxima, traditional algorithms like perturb and observe and hill-climbing should not be used to track the optimal peak. The tracking of the optimal peak is achieved by employing a range of artificial intelligence methodologies, such as utilizing an artificial neural network and implementing control based on fuzzy logic principles. These algorithms perform satisfactorily under PS conditions but their training method necessitates a sizable quantity of data which result in placing an unnecessary demand on CPU memory. In order to achieve maximum power point tracking (MPPT) with fast convergence, minimal power fluctuations, and excellent stability, this paper introduces a novel optimization algorithm named PSO-AWDV (particle swarm optimization–adaptive weighted delay velocity). This algorithm employs a stochastic search approach, which involves the random exploration of the search space, to accomplish these goals. The efficacy of the proposed algorithm is demonstrated by conducting experiments on a series-connected configuration of four modules, under different levels of solar radiation. The algorithm successfully gets rid of the problems brought on by current traditional and AI-based methods. The PSO-AWDV algorithm stands out for its simplicity and reduced computational complexity when compared to traditional PSO and its variant PSO-VC, while excelling in locating the maximum power point (MPP) even in intricate shading scenarios, encompassing partial shading conditions and notable insolation fluctuations. Furthermore, its tracking efficiency surpasses that of both conventional PSO and PSO-VC. To further validate our results, we conducted a real-time hardware-in-the-loop (HIL) emulation, which confirmed the superiority of the PSO-AWDV algorithm over traditional and AI-based methods. Overall, the proposed algorithm offers a practical solution to the challenges of MPPT under PS conditions, with promising outcomes for real-world PV applications.