Wireless sensor networks are equipped with batteries with limited charge, and are often deployed in conditions that make their retrieval and replacement infeasible. Thus, energy conservation has been a primary consideration for protocol design for such networks. Recent advancements in the transfer of energy wirelessly over large distances, such as through radio frequency electromagnetic (EM) waves and magnetic coupling, may give rise to a new class of networks that allow the sensors to be charged on the field, thereby prolonging the network lifetime. Moreover, wireless charging though EM waves may be undertaken in the same unlicensed band as that used for communication, leading to several unique protocol design challenges for such a network. The contribution of this paper is threefold: First, a set of experiments is undertaken to investigate the effect of distance and location on the energy transfer through EM waves. Second, a new routing metric based on the charging ability of the sensor nodes is proposed. Finally, an optimization framework is developed to determine the optimal charging and transmission cycle for the sensor network, resulting in enhanced lifetime of the network under user-specified end-to-end constraints of throughput and latency.