In most applications, wireless sensor networks are supposed to operate in an unattended manner for a long period after sensor nodes' deployment. However, in such networks, sensor nodes frequently become faulty and unreliable because of the harsh environment of the observed area. Therefore, protocols used in wireless sensor networks must be designed to be robust. Moreover, because the battery capacity of a node is limited, energy savings are crucial in wireless sensor networks. To meet the requirements of future diverse wireless sensor networks, a sophisticated any-to-any routing protocol is thus required. As well as meeting the typical demands of wireless sensor networks, an any-to-any routing protocol needs to achieve low energy consumption, high scalability, robustness, and reliability. In this paper, we realize a potential-based any-to-any routing protocol (PBAR) by merging potential-based upstream and downstream routing. In PBAR, sensor nodes can send data to a certain sensor node by routing the data via a sink node. In simulation experiments, we show that, given a suitable node density, PBAR attains a data delivery ratio greater than 99.7%. We also show that the data delivery ratio recovers immediately after failure of 30% of sensor nodes or failure of a sink node.