Progressions in silicon innovation, micro-electro-mechanical frameworks (MEMS), wireless communications, and digital gadgets have prompted the expansion of wireless sensor networks (WSNs) in a wide mixture of use areas including military, health, ecology, environment, industrial automation, civil engineering, and medical. This wide application differing qualities joined with complex sensor hub architectures, usefulness prerequisites, and exceedingly obliged and harsh working situations makes WSN plan exceptionally difficult. One basic WSN outline test includes meeting application necessities, for example, lifetime, reliability, throughput, delay (responsiveness), and so on for heap of application domains. The proposed research work utilizes the firefly system in optimization methods, which forms the efficient WSN communication and reduces the risk of false routing while minimization of delay in path switching. In algorithms introduced for data transmission in such networks up to now, a single route is used for data transmissions that results in decrease in energy of nodes located on this route which in turn results in increasing of remaining energy. In this paper a new method is proposed for selection of data transmission route for splving the issue of the mobile receiver problem. This method is based on the energy usage in the network and dead nodes as parameters and number of nodes to sink. In this method average energy of network will be estimated and the reduction in energy will be noted and compared with previous system. This will result in increased energy conservation in routing of the WSN.