Recently, Electric Vehicles (EV) have been providing fast response and substantial progress in the power generation model. Further, EVs are exploited as adaptable Energy Storage Systems (ESSs) and show a promising performance in ancillary service markets to increase the demand of Smart Grid (SG) integration. The expansion of Vehicle-to-Grid concept has created an extra power source when renewable energy sources are not available. Yet, numerous operational problems still are required to be considered for EV implementation to turn out to be extensive. Even the development of Photo-Voltaic (PV) technology creates a problem in SGs when used for EV charging. Because of this, the Energy Management System (EMS) is required to handle charging requirements and deal with the intermittent generation. Here, in this research, an Improved Honey Badger algorithm (IHBA) is proposed for integrating SGs with EV parking lot, solar panels, and dynamic loads at the Point of Common Coupling (PCC). The proposed IHBA uses a dynamic programming method to optimize the charging Grid-to-Vehicle (G2V) or discharging Vehicle-to-Grid (V2G) profiles of the EVs using the forecasts of PV generation. This algorithm considers user preferences while also lowering reliance on the grid and maximizing SG effectiveness. The study’s findings show that the Honey Badger method is efficient in resolving issues involving large search spaces. The developed method is used to optimize charging and discharging of EV which is tested in MATLAB to obtain a stable load profile. From the evaluation of obtained results, it is evident that the IHBA controller outperforms the WOA and EHO controllers in terms of total harmonic distortion voltage (3.12%), power loss (0.197 kW) and efficiency (98.47%).