Data collection on Wireless Sensor Networks (WSNs) is a significant challenge to satisfy the requirements of various applications. Providing an energy-efficient routing technique is the primary step in data collection over WSNs. The existing data collection techniques in the WSNs field struggle with the imbalance load distribution and the short lifetime of the network. This paper proposes a novel mechanism to select cluster-heads, cluster the wireless sensor nodes, and determine the optimal route from source nodes to the sink. We employ the genetic algorithm to solve the routing problem considering the hop-count of the cluster-heads to the sink, the number of each cluster member, residual energy of cluster-heads, and the number of cluster-heads connected to the sink as the fitness criteria. Our proposed mechanism uses a greedy approach to calculate the hop-count of each cluster-head to the sink for integrating the clustering and routing process on WSNs. The simulation results demonstrate that our proposed mechanism improves the energy consumption, the number of live nodes, and the lifetime of the network compared to other data collection approaches on WSNs.