Design and implementation of a low cost grid-connected 5kVA solar photovoltaic (PV) system is proposed in this paper. Since the inverter is a major component of the PV system, the B4 inverter used in this paper reduces the total cost of the PV system. In order to eliminate the massive transformer, the PV system is connected to the grid through IGBT switches. In addition to injection of active power into the grid, the B4 inverter can compensate reactive power and reduce harmonics of the nonlinear loads. A TMS320F28335 DSP processor is used for effective control of the B4 inverter. Various features of this processor enable the implementation of the necessary control algorithms. As a first step, the PV system is simulated and evaluated in Matlab/Simulink. In the second step, hardware circuits are designed and implemented based on the simulation results. The operation of the PV system has been evaluated under balanced, unbalanced, linear and nonlinear loads which proves its accuracy and efficiency.