## 1 Introduction  
Wireless sensor networks can be divided into homogeneous wireless sensor network and heterogeneous wireless sensor network. All sensor nodes have the same software and hardware conditions in the homogeneous wireless sensor network. For the heterogeneous wireless sensor network (HWSN), all sensor nodes have two or more different kinds of the feature. The heterogeneous feature is mainly the different computing power, communicating protocol, communication range, transmission speed, function, energy, and others. In wireless sensor networks, the energy of the sensor is sometimes supplied by different energy devices (battery, renewable sources, and unlimited sources), and the initial energy is different. This is the energy heterogeneity wireless sensor network. This paper mainly discusses the energy heterogeneity of the sensor nodes that have varying levels of energy resources in HWSN [1; 2; 3; 4; 5]. The energy of sensors is supplied by a battery, so it is limited. Although many routing protocols for HWSNs have been proposed for achieving a network with a long lifetime and low-energy consumption data acquisition, how to prolong the lifetime of wireless sensor networks is still of attention to many researchers. Stable election protocol (SEP), which is designed to deal with heterogeneous networks, introduces the concept of advanced and normal nodes for cluster head selection [6]. This is based on the weighted election probabilities of each node's addition to a cluster head according to the remaining energy in each node. The SEP algorithm does not require any global knowledge of the energy at each election round. Numerous heterogeneous protocols based on SEP have been proposed. The zonal-stable election protocol [7] is a clustering algorithm based on zones in which the advanced nodes have the probability of becoming a cluster head. However, nodes cannot be randomly deployed, and only advanced nodes are selected as a cluster. The ridge method based cluster head selection protocol [8] uses a Ridge technique to select the best cluster head, and the algorithm always chooses cluster heads from nodes with higher residual energy. Modified stable election protocol (M-SEP) [9] is a heterogeneous protocol based on clustering that considers the existence of different transmission types. The event-to-sink directed clustering protocol [10] realizes energy efficiency in a sensor network configuration by clustering the nodes only within the event-to-sink data flow corridor. This is to avoid unnecessary cluster formation and directionally to minimize the number of hops for data forwarding. The lower energy adaptive clustering hierarchy with special energy advanced node protocol [11] is an extension of SEP. It follows the hybrid approach to forwarding data against the energy of the nodes. The improved energy aware distributed unequal clustering protocol protocol [12] considers the number of nodes in the surrounding area in addition to the location of the base station and the residual energy for electing cluster heads. The methodology used is for retaining the same clusters for a few rounds and is effective in reducing the clustering overhead. The prolong stable election routing algorithm [13] is presented to prolong the stable period of fog-supported sensor networks by maintaining balanced energy consumption. The Threshold-Sensitive Stable Election Protocol (TSEP) algorithm [14] is also an improvement based on the SEP method. TSEP algorithm adds super nodes to the network. However, in terms of routing, data is still transmitted to the base station (BS) using single-hop transmission in TSEP. This routing would consume a lot of energy. The process of the TSEP protocol is described in detail in Section 2. In this paper, an improved routing protocol for heterogeneous WSN is introduced by improving the TSEP algorithm to solve the problem of how to save energy and ensure a balanced network load.