Electrical energy generation by using Photovoltaic system is becoming popular day by day. This paper presents a control topology for multilevel inverters used in standalone PV system. A hybrid technique is used to optimize the switching angles of thirteen levels single-phase cascaded multilevel inverter for selective harmonics elimination. The nonlinear transcendental equations problem is solved by dividing the whole system into two stages. In stage-I: it will find the convergence angles region by using Fmincon optimization technique and then in stage II it will find the accurate convergence point by using most common technique which is Newton Raphson (NR) method. This approach is fast, low cost, efficient and it produces very low total harmonics distortion. The ability of the proposed technique is simulated by using MATLAB and implemented on cascaded h-bridge circuits, opto-isolators and Arduino UNO microcontroller. The simulation and hardware results verify the capability of proposed technique.