In this paper, the charging dynamics of one or more electric car batteries connected to a traditional three-phase grid through a controlled rectifier and DC-DC converter. Two renewable energy sources that integrate seamlessly into the traditional grid are photovoltaic arrays (PVA) and wind farms. The battery charging procedure optimizes the energy derived from these sustainable sources. When there is insufficient renewable energy available, the rectifier uses the three-phase grid to produce electricity for battery charging. A comprehend control framework for energy management is simulated, encompassing the grid, residential loads, electric vehicle charging stations, and sustainable energy resources. Using MATLAB Simulink software, we analyze many operational scenarios while accounting for changing environmental factors that affect both renewable sources and EV battery charging. The 'powergui' toolbox is used to provide graphical representations of system performance over time under different conditions.