Photovoltaic technology, which converts the sun’s light energy directly into electricity, can be used to make photovoltaic cells. The use of photovoltaic cells is centered on the idea of a low-carbon economy and green environmental protection, which effectively addresses the pollution problem in smart cities. Accurate identification of photovoltaic cell parameters is critical for battery life cycle and energy utilization. To accurately identify the single diode model (SDM), dual diode model (DDM), and three diode model (TDM) parameters of solar photovoltaic cells, and an improved honey badger algorithm (IHBA) is proposed in this paper. In the early stages of iteration, the IHBA uses the spiral exploration mechanism to improve the population’s global exploration ability. Furthermore, a density update factor that varies according to the quasi-cosine law is introduced to speed up the algorithm’s convergence speed and prevent the algorithm from falling into the local optimal value. Simultaneously, the pinhole imaging strategy is utilized to disturb the present optimal position to improve the algorithm’s optimization accuracy. The experimental comparison results of 18 benchmark test functions, Wilcoxon rank sum statistical test, and 30 CEC2014 test functions reveal that an IHBA shows remarkable performance in convergence speed, optimization accuracy, and robustness. Finally, the IHBA is used to identify the parameters of three kinds of commercial silicon R.T.C French solar photovoltaic cell models with a 57 mm diameter. In comparison to other algorithms, the IHBA can minimize the root mean square error (RMSE) between the measured current and estimated current at the fastest speed, demonstrating the practicality and superiority of the IHBA in tackling this problem.