A novel optimized energy-delay sub-network routing (OEDSR) protocol for wireless sensor networks (WSN) is presented. Routing is based on a link cost factor, which is defined using the quality of service (QoS) metric selected as a ratio of the remaining energy of the nodes and end-to-end delay times the distance from the base station (BS).. Initially in OEDSR, the nodes are either in idle or sleep mode, but once an event is detected, the nodes near the event become active and start forming sub-networks. Formation of the inactive network into a sub-network saves energy because only a portion of the network is active in response to an event. Subsequently, the sub-networks organize themselves into clusters with cluster heads (CHs). The data from the CHs are sent to the BS via relay nodes that are located outside the sub-networks in a multi-hop manner by using the proposed routing protocol. This routing protocol improves the lifetime of the network and the scalability. GloMoSim results indicate that the OEDSR protocol results in lower average end-to-end delay, fewer collisions and less energy consumed when compared with DSR, AODV, and Bellman Ford routing protocols.