A new gradient-based routing protocol is proposed in this paper. It takes into account the minimum hop count and remaining energy of each node while relaying data from source node to the sink. The optimal routes can be established autonomously with our protocol. A simple acknowledgement scheme, which can be implemented without extra overheads, is proposed. Our protocol also employs data aggregation to save transmission energy. To handle the frequent change of the topology of the network, one scheme for topology update is provided. At last, simulation results illustrate the effect of system parameters on the protocol performance.