Abstract The development of countries like Iran and Iraq is closely tied to the efficient use of energy. In the coming years, these countries are likely to face challenges such as drought and the depletion of fossil fuels. Additionally, they are confronted with air pollution issues caused by fossil fuel-powered vehicles. In recent years, hybrid electric vehicles (HEVs) have gained significant attention from both policymakers and the general public in these nations. However, one of the challenges associated with these vehicles is electromagnetic interference (EMI) generated by their power systems, which can impact battery performance and stability. If automotive electronic systems lack proper electromagnetic compatibility (EMC) measures, significant disturbances can occur, jeopardizing the safe operation of the vehicle. Therefore, it is crucial to develop optimal and sustainable EMC solutions to ensure the safety and reliability of HEVs. In this study, a new optimization approach for enhancing the electromagnetic compatibility of battery management systems (BMS) stability is proposed, using the particle swarm optimization (PSO) algorithm. The system was first modeled, followed by an investigation of the key parameters influencing EMI levels from HEV power systems. An optimization problem was then formulated, with the objective of minimizing EMI while adhering to certain constraints. The PSO algorithm was applied to solve this optimization problem. The simulation results show that the proposed method has reduced the interference by 1.16 times compared to the normal mode, which is a very good result for practical applications.