Abstract: Energy consumption is the most important aspect of designing an efficient wireless sensor network. Finite electrical energy in each sensor node is defined by the capacity of the onboard battery [1]. Due to size and cost, variations of solar radiance, and constraints imposed by the rechargeable battery, solar energy harvesting modules have to face a problem in the continuous power supply. There are various protocols that have been developed for the purpose of reducing the energy consumption such as LEACH, DEEC, TEEN etc. But all of these protocols lacks somewhere to support the network in various terms such as the lifetime of the network, energy consumption by the nodes, the number of dead nodes in the network, the number of alive nodes. The proposed work is based on the firefly algorithm which is quite efficient for increasing the lifetime of the network. This performs the cluster head selection on the basis of two parameters that is the amount of residual energy of a node and the distance between the nodes. On the basis of these two parameters the fitness parameter is evaluated and then from these fitness values best fitness value is selected and its corresponding node is selected as a cluster head. The result section shows the efficiency of the proposed work.