Solar photovoltaic (PV) cells play a major role as natural, renewable energy sources. It is characterized by having nonlinear photoelectric voltage and current characteristics. These properties depend on the amount of solar radiation and temperature. PV can be used as an electrical charge circuit. But due to the low efficiency of the resulting photoelectric power, it should operate in conditions of maximum power point. There are several algorithms for achieving this maximum power point condition. In this paper, a PV system is proposed to obtain the maximum power point using a modified firefly algorithm. The modifications have been made both in fireflies’ locations and their random movement. Several simulations are implemented using MATLAB to verify the performance of the proposed system. From the simulation results, the proposed algorithm outperforms all traditional algorithms such as firefly and perturbation and observation technique. Moreover, the impacts of some variants of the proposed technique are studied. The variants are the number of the fireflies, the randomness, the maximum iterations, and the effect of changing the sampling time. A proposed modified firefly is presented with an MPPT controller in the PV system to ensure operating the PV at the MPP. Additionally, the mathematical expressions are explained. Moreover, MATLAB simulation programs are done to compare the performance of the proposed scheme with other related ones.