A design of a single-phase bidirectional AC-DC converter and bidirectional DC-DC converter is presented in this study to transmit electrical power from the grid to an electric vehicle (EV) and from an EV to the grid while maintaining the grid's increased power factor. A single-phase bidirectional AC-DC converter is utilised to convert a 230 V 50 Hz AC supply to 380V dc in the first stage, and a bidirectional buck-boost dc-dc converter is used to charge and discharge the PHEV's battery in the second stage (Plug-in Hybrid Electric Vehicle). It discharges electricity back to the grid at 230V, 50 Hz in discharging mode. In a PHEV, a battery with a charging power of 1.2 kW at 120V is employed. The buck-boost DC-DC converter charges and discharges the battery in buck and boost modes, respectively. The charging current and voltage are controlled using a proportional-integral (PI) controller. The efficacy of the suggested algorithm and the system's practicality is confirmed by simulation results.